Pathology
Pathology
Source Code
import mysql.connector
import os
import platform
myCursor = myDB.cursor()
def CreateDb():
os.system('cls')
myCursor = myDB.cursor()
myCursor.execute(CreateDBQuery)
CreateTable()
##
def CreateTable():
os.system('cls')
myDB = mysql.connector.connect(host='localhost',
database='Pathology',
user='root',
passwd='root')
BookID Varchar(15) ,
Address Varchar(20),
contact varchar(10),
email varchar(25),
BookingDate date,
SampleDate Date,
ReportDate date,
TestType Varchar(20),
myCursor = myDB.cursor()
result1 = myCursor.execute(Patient)
def AdmitPatient():
os.system('cls')
try:
myDB = mysql.connector.connect(host='localhost',
database='Pathology',
user='root',
passwd='root')
myCursor = myDB.cursor()
myCursor.execute(sql)
for x in myCursor:
#print(x[0])
newBookID=int(x[0])
#print(newAccountId)
newBookID=int(newBookID)+1
print("\
t************************************************************************")
print("\t\t*\t\t\t\t\t1. Sugar")
print("\t\t*\t\t\t\t\t2. Thyriod")
print("\t\t*\t\t\t\t\t3. MRI")
print("\t\t*\t\t\t\t\t4. CT Scan")
print("\t\t*\t\t\t\t\t5. X-Ray")
print("\t\t*\t\t\t\t\t1. Lab")
print("\t\t*\t\t\t\t\t2. Home")
print("\t\t*\t\t\t\t\t3. Hospital")
RefferedBy=input("\t\t*\t\tReffered By : Dr.")
mySql_insert_query = """INSERT INTO Patient VALUES (%s, %s, %s, %s,%s, %s, %s, %s,%s, %s, %s,
%s,%s) """
SampleDt,ReportDt,TestType,Center,"Dr. "+RefferedBy,AdvDeposit)
myCursor.execute(mySql_insert_query, recordTuple)
myDB.commit()
finally:
if (myDB.is_connected()):
myCursor.close()
myDB.close()
def GererateReport():
myDB = mysql.connector.connect(host='localhost',
database='Pathology',
user='root',
passwd='root')
myCursor = myDB.cursor()
print("\t\t*\t\t\t\t\t1. Sugar")
print("\t\t*\t\t\t\t\t2. Thyriod")
print("\t\t*\t\t\t\t\t3. MRI")
print("\t\t*\t\t\t\t\t4. CT Scan")
print("\t\t*\t\t\t\t\t5. X-Ray")
myCursor.execute(sql,(BookID,TestType,))
record = myCursor.fetchall()
print("\t\t===============================================================")
print("\t\t*\t\tBook ID :",rec[0])
print("\t\t*\t\tGander :",rec[2])
print("\t\t*\t\tCenter :",rec[10])
print("\t\t*\t\tReffered By :",rec[11])
SugarReport()
if rec[9]=='2':
ThyriodReport()
if rec[9]=='3':
MRI()
if rec[9]=='4':
if rec[9]=='5':
if rec[9]=='6':
def SugarReport():
print("\t","-"*190)
print("\t\t\tBIOCHEMISTRY")
def ThyriodReport():
print("Ordered Items")
print('-'*150)
print('-'*150)
print("Thyroid Panel")
print('-'*150)
print("Thyroid Panel: Thyroxine (T4): reference range 4.5 to 12.0 mcg/dL; T3 Uptake: 22-35%;
Free Thyroxine Index (T7): 1.4 to 3.8.")
def MRI():
print('-'*150)
print("MRI Scan")
print('-'*150)
print('SEQUENCES: Sagittal FLAIR and coronal T2-weighted images are supplemented by axial T1,
T2,and FLAIR images.\
\n\tThere is diffuse dilatation of sulci and ventricles more than one would expect for a patient of
this age group.\
\n\tThere has been extensive tissue loss in the right cerebral hemisphere due to an old insult, \
\n\tpresumably an ischemic event. This primarily involves the right temporal/occipital region
and is\
\n\tassociated with obvious ex vacuo prominence of the right lateral ventricle. There is
wallerian\
\n\tThere are few focal defects identified in the periventricular white matter bilaterally. These
are likely\
\n\tdue to some superimposed small vessel ischemic change rather than a demyelinating
condition.\
\n\tThere is no evidence of focal defects identified within the brainstem at any level. The orbits
are\
\n\tunremarkable.\n\
\nIMPRESSION:\n\
\n\t1. Extensive tissue loss right temporal/occipital region with ex vacuo prominence of right
lateral\
\n\t2. Subtle focal defects periventricular white matter probably due to superimposed small
vessel\
\n\tischemic disease.\
\n\t3. No previous studies are made available for review. At such time that a previous study
becomes\
def displayAll():
myDB = mysql.connector.connect(host='localhost',
database='Pathology',
user='root',
passwd='root')
myCursor = myDB.cursor()
myCursor.execute(sql)
record = myCursor.fetchall()
print("\t\t===============================================================")
print("\t\t*\t\tBook ID :",rec[0])
print("\t\t*\t\tPatient Name :",rec[1])
print("\t\t*\t\tGander :",rec[2])
print("\t\t*\t\tCenter :",rec[10])
if rec[9]=='1':
if rec[9]=='2':
if rec[9]=='3':
if rec[9]=='4':
if rec[9]=='5':
if rec[9]=='6':
print("\t\t*\t\tReffered By :",rec[11])
print("\t\t===============================================================")
if ch.upper()=='N':
break
def mainMenu():
CreateDb()
while True:
print("\t\t\t1. AdmitPatient")
print("\t\t\t2. Report")
print("\t\t\t4. Exit")
if ch==1:
AdmitPatient()
if ch==2:
GererateReport()
if ch==3:
displayAll()
if ch==4:
break
## Calling Module/Function
mainMenu()
Screen Shot: