Professional Documents
Culture Documents
Name : ABCD
CertifiCate
Year: 2021-2022
1. REQUIREMENT
2. PROGRAM SPECIFICATIONS
3. SOURCE CODE
4. CONSOLE OUTPUT
5. SHORTCOMINGS
6. APPENDIX
7. BIBLIOGRAPHY
REQUIREMENTS
HARDWARE:-
SOFTWARE:-
ANACONDA DISTRIBUTION
ADDITIONAL LIBRARIES:-
1. PANDAS
2. RANDOM
3. DATETIME
4. MYSQL.CONNECTOR
PROGRAM SPECIFICATIONS
HOSPITAL MANAGEMENT
The following code is for a hospital management system that can be used
for the managerial purposes that take place in a hospital such as the
maintenance and storage of data of patients as well as records for doctors.
In a growing world where big data is increasing haphazardly, effective data
management is the key to systematic analysis and storage. Hence this
program can be used for the aforementioned purposes to avoid cluttering
of large amounts of data.
Pandas, MySQL, Random are the libraries that have been used for running
this code.
import datetime
import random as rd
import pandas as pd
con=sqltor.connect(host="localhost",user="root",password="airani")
cur=con.cursor()
cur = con.cursor(buffered=True)
cur.execute("use hello")
"("
"name char(20),"
"age int(10),"
"gender char(1),"
"phone char(10),"
"bg char(3))")
print(t.center(80))
d=datetime.date.today()
t=datetime.datetime.now()
print(" ")
print(" ")
print(" ")
print(" TIME:-",t.strftime("%H:%M:%S"))
print("")
print('')
print("""
| | | | | |
| | | | | |
""".center (50))
if e=="1" :
def dat():
while True:
idn=input("Adhaar no.:")
if len(idn)==12 :
break
else:
name=input("Patient name:")
while True:
age=int(input("Age:"))
if type(age)!=int:
print("~!~!~!~~digits required~~!~!~!~")
else:
break
while True:
gen=input("Gender M/F:")
if gen==("M") or gen==("F"):
break
else:
while True:
ph=input("Phone no.:")
if len(ph)==10 :
break
else:
while True:
bg=input("""Blood group(A+,B+,O+,AB+,A-,B-,O-,AB-):-""")
break
else:
con.commit()
print(" ")
print("""
| |
""")
print("""
| |
| |
""")
d=cur.fetchall()
for i in d:
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
return("")
def name():
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
else:
print('')
print('''
''')
print("")
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
con.commit()
dat=cur.fetchall()
print('')
print('''
''')
print('')
print(''' Name:-''',row[1])
print(''' Age:-''',row[2])
print(''' Gender:-''',row[3])
print(''' Phone:-''',row[4])
print(''' Bloodgroup:-''',row[5])
con.commit()
return("")
def age():
dat=cur.fetchall()
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
else:
print('')
print('''
''')
print("")
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
con.commit()
dat=cur.fetchall()
print('')
print('''
''')
print('')
print(''' Age:-''',row[2])
print(''' Gender:-''',row[3])
print(''' Phone:-''',row[4])
print(''' Bloodgroup:-''',row[5])
con.commit()
return("")
def gen():
dat=cur.fetchall()
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
else:
print('')
print('''
| YOUR OLD DETAILS ARE |
''')
print("")
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
con.commit()
dat=cur.fetchall()
print('')
print('''
print('')
print(''' Name:-''',row[1])
print(''' Age:-''',row[2])
print(''' Gender:-''',row[3])
print(''' Phone:-''',row[4])
print(''' Bloodgroup:-''',row[5])
con.commit()
return("")
def ph():
dat=cur.fetchall()
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
print('~!~!~!~!~~NO DATA FOUND~~!~!~!~!~')
else:
print('')
print('''
''')
print("")
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
con.commit()
dat=cur.fetchall()
for row in dat:
print('')
print('''
''')
print('')
print(''' Name:-''',row[1])
print(''' Age:-''',row[2])
print(''' Gender:-''',row[3])
print(''' Phone:-''',row[4])
print(''' Bloodgroup:-''',row[5])
con.commit()
return("")
def bg():
dat=cur.fetchall()
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
else:
print('')
print('''
''')
print("")
print(''' Name:-''',i[1])
print(''' Age:-''',i[2])
print(''' Gender:-''',i[3])
print(''' Phone:-''',i[4])
print(''' Bloodgroup:-''',i[5])
n=input('ENTER NEW BLOOD GROUP:-')
con.commit()
dat=cur.fetchall()
print('')
print('''
''')
print('')
print(''' Name:-''',row[1])
print(''' Age:-''',row[2])
print(''' Gender:-''',row[3])
print(''' Phone:-''',row[4])
print(''' Bloodgroup:-''',row[5])
con.commit()
return("")
def ret():
dat=cur.fetchall()
a=[]
for i in dat:
a.append(i)
if len(a)!=1:
print('')
else:
while True:
print('''
| |
|SELECT DEPARTMENT:- |
| |
|1.Cardiologist |
|2.Rheumatologist |
|3.Psychiatrist |
|4.Neurologist |
|5.Otolaryngologist |
|6.ER |
|7.Back |
| |
''')
x=int(input("Enter choice:-"))
if x==1:
q=(i,j)
h=rd.choice(q)
print(" ")
u=(12,43,54,71,32,65)
o=rd.choice(u)
print("Appointment no:-",o)
break
elif x==2:
q=(i,j)
h=rd.choice(q)
print(" ")
u=(12,43,54,71,32,65)
o=rd.choice(u)
print("Appointment no:-",o)
break
elif x==3:
q=(i,j)
h=rd.choice(q)
print(' ')
o=rd.choice(u)
print("Appointment no:-",o)
break
elif x==4:
q=(i,j)
h=rd.choice(q)
print(' ')
u=(12,43,54,71,32,65)
o=rd.choice(u)
print("Appointment no:-",o)
break
elif x==5:
q=(i,j)
h=rd.choice(q)
print(' ')
print("Your appointment is fixed with",h,"Date:-",datetime.date.today() +
datetime.timedelta(days=4))
u=(12,43,54,71,32,65)
o=rd.choice(u)
print("Appointment no:-:",o)
break
elif x==6:
q=(i,j,k,l)
h=rd.choice(q)
print(" ")
u=(12,43,54,71,32,65)
o=rd.choice(u)
print("Appointment no:-",o)
break
elif x==7:
break
else:
return(" ")
"DEPARTMENT":["Cardiologist","Cardiologist","Psychitrist","Psychitrist","Otolaryngon
ologist","Otolaryngonologist","Rheumatologist","Rheumatologist","Neurologist",
"Neurologist",'ER','ER','ER','ER'],
"ROOM NO.":[201,202,203,204,205,206,207,208,209,200,401,402,403,404]}
df=pd.DataFrame(l)
df=df.rename(index={0:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10,10:11,11:12,12:13,13:14
})
f={"Services":["X-Ray","MRI","CT Scan","Endoscopy","Dialysis","Ultrasound
","EEG","ENMG","ECG"],
"Room no.":[101,102,103,104,105,301,302,303,304]}
dt=pd.DataFrame(f)
dt=dt.rename(index={0:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9})
while True:
print("""
##====================================##
|| ||
|| ||
|| |
|
|| 1. Register |
yourself |
|| 2. Appointment |
|
|| 3. List of Doctors ||
|| 4. Services ||
available
|| 5. To modify data ||
|| 6. Back |
|
|| ||
##====================================##
""")
x=int(input("""YOUR OPTION:-"""))
if x==1:
print(" ")
print(dat())
elif x==2:
print(" ")
print(ret())
elif x==3:
print(" ")
print(" ")
print(df)
elif x==4:
print(" ")
print(" ")
print(dt)
print(' ')
elif x==5:
print(" ")
while True:
print("""
| |
| |
|1.Name |
|2.Age |
|3.Gender |
|4.Phone no. |
|5.Blood group |
|6.Back |
| |
""")
if s==1:
print(name())
break
elif s==2:
print(age())
break
elif s==3:
print(gen())
break
elif s==4:
print(ph())
break
elif s==5:
print(bg())
elif s==6:
break
else:
print(" ")
elif x==6:
break
else:
print(" ")
d={"NAME OF PATIENT":["Amit","Sanjay","Vipul","Sayeed"],"AGE":[23,34,27,26],
"APPOINTMENT NO.":[64,52,12,56]}
d1=pd.DataFrame(d)
d1=d1.rename(index={0:1,1:2,2:3,3:4})
g={"NAME OF
PATIENT":["Ankit","Sanjeev","Vikas","Shoib",'Rehan','Suarav','Ganpat'],"AGE":[12,45,
21,23,34,27,26],
"APPOINTMENT NO.":[3,82,12,31,54,39,46]}
d2=pd.DataFrame(g)
d2=d2.rename(index={0:1,1:2,2:3,3:4,4:5,5:6,6:7})
f={"NAME OF
PATIENT":["Tanay","Ajay","Akaash","Shakib","Rohan",'Raju','Farhan','Bhuvan'],"AGE":
[42,58,32,67,23,34,27,26],
"APPOINTMENT NO.":[43,23,61,32,21,43,56,31]}
d3=pd.DataFrame(f)
d3=d3.rename(index={0:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8})
h={"NAME OF
PATIENT":["Ashish","Joy","Jayesh","Somesh","Rahul",'Arham','Bhanu','Danish'],"AGE"
:[42,58,32,67,23,34,27,26],
"APPOINTMENT NO.":[43,23,61,32,21,43,56,31]}
d4=pd.DataFrame(h)
d4=d4.rename(index={0:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8})
s={"NAME OF PATIENT":["Manav","Dheeraj","Kamal","Sohrab","Yash"],"AGE":
[12,23,34,27,26],
"APPOINTMENT NO.":[64,57,22,12,56]}
d5=pd.DataFrame(s)
d5=d5.rename(index={0:1,1:2,2:3,3:4,4:5})
i={"NAME OF
PATIENT":["Umesh",'Kamal','Pankaj','Dhyanesh','Arnav'],"AGE":[12,23,34,27,26],
"APPOINTMENT NO.":[64,57,22,12,56]}
d6=pd.DataFrame(i)
d6=d6.rename(index={0:1,1:2,2:3,3:4,4:5})
while True:
print('')
e=input("ENTER YOUR ID NO. (press enter to exit):-")
print(" ")
if e=="1":
w=7001
pswd=int(input('ENTER PASSWORD:'))
if pswd==w:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=="2":
w=7002
pswd=int(input('ENTER PASSWORD:'))
if pswd==w:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='3':
z=7003
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='4':
z=7004
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='5':
z=7005
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='6':
z=7006
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='7':
z=7007
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='8':
z=7008
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='9':
z=7009
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print("||| GOOD MORNING MR. AJAY |||")
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='10':
z=7010
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print(" YOU HAVE APPOINTMENT WITH FOLLOWING PATIENTS:-")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='11':
z=7011
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='12':
z=7012
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='13':
z=7013
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
elif e=='14':
z=7014
pswd=int(input('ENTER PASSWORD:'))
if pswd==z:
t=datetime.datetime.now()
l=t.strftime("%p")
if l=="PM":
else:
print(" ")
print("")
q=(d1,d2,d3,d4,d5,d6)
o=rd.choice(q)
print(o)
else:
print('~!~!~!~~PASSWORD OR ID IS WRONG~~!~!~!~')
else:
break
elif e=="3":
print(" ")
print("Thank You".center(50))
print('''
Made by:
Piyush Airani
Rohan Nair
Ninad Bennur
'''.center(50))
break
else:
print(" ")
con.close()
OUTPUTS
i. Home Page of Program
This is just a basic version of the actual hospital management systems that
are currently available in the marketplace and as a result it does not
provide the variety of services that the actual software offer to their
customers.
It does not dive deep into the financial side of things in the data.
1. “Tutorials” (https://pandas.pydata.org/pandas-docs/stable/tutorials.html)
2. “MySQL Connector” (https://www.mysql.com/products/connector/)
3. “Python MySQL”
(https://www.w3schools.com/python/python_mysql_getstarted.asp)
4. “Introduction to Pandas” (https://towardsdatascience.com/a-quick-
introduction-to-the-pandas-python-library-f1b678f34673 )
5. For troubleshooting: (https://www.stackoverflow.com/)