Rani Laxmi Bai Memorial School Vikas Nagar, Sector-3: Computer Science (083) Project
Rani Laxmi Bai Memorial School Vikas Nagar, Sector-3: Computer Science (083) Project
SESSION: 2020-2021
ROLL NO. :-
__________________________ __________________________
SIGNATURE OF EXTERNAL SIGNATURE OF INTERNAL
EXAMINAR EXAMINAR
__________________________
SIGNATURE OF PRINCIPAL
DATE:_________________
ACKNOWLEDGEMENT
In the accomplishment of this project successfully, many
people have best owned upon me their blessings and the
heart pledge support, this time I am utilizing to thank all
the people who have been concerned with this project.
Primarily I would like thank god for being able to
complete this project with success. Then I would like to
thank my principal Mrs. Neelam Shukla and my
Computer
Science teacher Mrs. Soumya Rastogi whose valuable
guidance
has been the ones that helped me patch this project and
make it full proof success, his suggestions and
instruction has served as the major contribution towards
the completion of this project.
Then I would like to thank my parents who have helped
me with their valuable suggestions and guidance has
been very helpful in various phases of the completion of
the project.
THANK YOU
INTRODUCTION
SYSTEM:
Microsoft windows 7
Service pack 1
COMPUTER:
AMD athlon(tm) 64x2 dual core
processor 4200+
TEXT EDITOR:
Microsoft office word
INTERPRETER
Python 3.7
CODING
conn =
msc.connect(host="localhost",user="root",passwd="prateek24",database="hospital_management_syste
m")
cur=conn.cursor()
def AdminMenu():
print("| |")
print("| |")
def UserMenu():
print("| |")
print("| |")
conn.commit()
conn.close()
conn.commit()
conn.close()
conn.commit()
conn.close()
cur.execute("desc doctor_details")
for i in cur :
print(i)
conn.close()
cur.execute("desc patient_details")
for i in cur :
print(i)
conn.close()
def desc_worker(): #TO Describe Worker_details
cur.execute("desc worker_details")
for i in cur:
print(i)
conn.close()
if x==1:
col=input(" Enter column name with respect to which you want to order the records : ")
elif x==2:
col=input(" Enter column name with respect to which you want to order the records : ")
else:
for x in cur:
for j in x:
print(j,end='\t')
print()
conn.close()
def DisplayAllPatient(): #To Display All Patients
if x==1:
col=input(" Enter column name with respect to which you want to order the records : ")
elif x==2:
col=input(" Enter column name with respect to which you want to order the records : ")
else:
for x in cur:
for j in x:
print(j,end='\n')
print()
conn.close()
if x==1:
col=input(" Enter column name with respect to which you want to order the records : ")
elif x==2:
col=input(" Enter column name with respect to which you want to order the records : ")
else:
for x in cur:
for j in x:
print(j,end='\n')
print()
conn.close()
x = cur.fetchone()
if x == None:
else:
for i in x:
print(i,end="\t")
print()
x = cur.fetchone()
if x == None:
else:
for i in x:
print(i,end="\t")
print()
x = cur.fetchone()
if x == None:
else:
for i in x:
print(i,end="\t")
print()
a = input("1: To change the Age \n 2: To change the Department \n 3: To change the post \n 4: To
change the phone number \n 5: To Change All the details \n ")
if a == '1':
elif a=='3':
elif a=='4':
elif a=='5':
cur.execute("update doctor_deatils set p_age =%s ,p_name ='%s',p_post ='%s',p_phone =%s where
d_id =%s"%(ag,p,po,n,d))
else :
return
conn.commit()
conn.close()
a = input(" 1: To change the Age \n 2: To change work name \n 3: To change the phone number \n 4:Change all the detail\n:")
if a == '1':
elif a=='2':
elif a=='3':
elif a=='4':
cur.execute("update worker_deatils set w_age =%s ,w_workname ='%s',p_phone =%s where w_id =%s"%(ag,w,n,d))
else :
return
conn.commit()
conn.close()
a = input(" 1: To change the Age \n 2: To change patient's problem \n 3: To change the phone number \n 4: Chage All details
\n")
if a == '1':
elif a=='2':
elif a=='3':
elif a=='4':
cur.execute("update patient_deatils set p_age =%s ,p_problems ='%s',p_phone =%s where p_id =%s"%(ag,p,n,d))
else :
return
conn.commit()
conn.close()
conn.commit()
conn.clos()
for i in cur :
for j in i:
print(j,end="\t")
print()
conn.close()
def delete_records(): #To Delete Records
a = int(input("1: Delete Doctor's Record \n 2: Delete Patients's Record \n 3: Delete Worker's Record \n 4: Delete Bill Record "))
if a == 1:
x = input(" Enter a column name on the basis of which you want to Remove the Doctors : ")
if x in ("d_id","d_age","d_phone"):
else:
conn.commit()
conn.close()
elif a == 2:
x = input(" Enter a column name on the basis of which you want to Remove the Patient : ")
if x in ("p_id","p_age","p_phone"):
else:
conn.commit()
conn.close()
elif a == 3:
x = input(" Enter a column name on the basis of which you want to Remove the Worker : ")
v = input(" Enter its value : ")
if x in ("w_id","w_age","w_phone"):
else:
conn.commit()
conn.close()
elif a == 4:
x = input(" Enter a column name on the basis of which you want to Remove the Bill details : ")
if x in ("p_id","p_age","drvisit","medicines","room"):
else:
conn.commit()
conn.close()
conn.commit()
conn.close()
print("| All Doctor removed successfully |")
conn.commit()
conn.close()
conn.commit()
conn.close()
def AdminChoiceQuery_doctor():
if ch==1:
cur.execute(s)
d=cur.fetchall()
if d==[]:
print(" :( SORRY!!! None of the records satisfied your query ")
else:
for m in d:
for n in m:
print(n,end="\t")
print()
elif ch==2:
cur.execute(s)
conn.commit()
p=cur.fetchall()
for m in p:
for n in m:
print(n,end="\t")
print()
else:
def AdminChoiceQuery_patient():
if ch==1:
s=input(" Enter your Select command Query\n")
cur.execute(s)
d=cur.fetchall()
if d==[]:
else:
for m in d:
for n in m:
print(n,end="\t")
print()
elif ch==2:
cur.execute(s)
conn.commit()
p=cur.fetchall()
for m in p:
for n in m:
print(n,end="\t")
print()
else:
if ch==1:
cur.execute(s)
d=cur.fetchall()
if d==[]:
else:
for m in d:
for n in m:
print(n,end="\t")
print()
elif ch==2:
cur.execute(s)
conn.commit()
p=cur.fetchall()
for m in p:
for n in m:
print(n,end="\t")
print()
e lse:
def UserChoiceQuery():
s=s.lower()
if "select" not in s:
print(" Invalid query !! Try Again, Give Select query only ")
else:
cur.execute(s)
d=cur.fetchall()
if d==[]:
else:
for m in d:
for n in m:
print(n,end="\t")
print()
if ch==1:
if a == "Hospital123":
while True:
print("\n")
AdminMenu()
print("\n")
if n==1:
Doctor_details()
elif n==2:
desc_doctor()
elif n==3:
Add_doctor()
elif n==4:
DisplayAllDoctor()
elif n==5:
Patient_details()
elif n==6:
desc_patient()
elif n==7:
Add_Patient()
elif n==8:
DisplayAllPatient()
elif n==9:
Worker_details()
elif n==10:
desc_worker()
elif n==11:
Add_worker()
elif n==12:
DisplayAllWorker()
SearchDoctor()
SearchPatient()
SearchWorker()
elif n==16:
update_doctor()
elif n==17:
update_patient()
elif n==18:
update_worker()
elif n==19:
Bill_details()
elif n==20:
AddBill()
elif n==21:
ShowBill()
elif n==22:
delete_records()
elif n==23:
RemoveAllDoctors()
elif n==24:
RemoveAllPatients()
elif n==25:
RemoveAllWorkers()
elif n==29:
AdminChoiceQuery_doctor()
elif n==30:
AdminChoiceQuery_patient()
elif n==31:
AdminChoiceQuery_worker()
elif n==32:
break
else:
elif ch==2:
print("\n")
UserMenu()
print("\n")
if n==1 or n==7:
SearchDoctor()
SearchPatient()
SearchWorker()
elif n==4:
DisplayAllDoctor()
elif n==5:
DisplayAllPatient()
elif n==6:
DisplayAllWorker()
UserChoiceQuery()
elif n==13:
break
else:
#END OF CODING
OUTPUT
TO CREATE DOCTOR’S TABLE
BEFORE
AFTER
UPDATE PATIENT’S DETAIL
BEFORE
AFTER
TO ADD NEW BILL