Hospital Management
Hospital Management
1
INTRODUCTION
This software is Hospital Management application .It start with a menu page
displaying the options necessary for the hospital manager. The project consists
of 16 options. Register patient details, List patient records, Change patient
information, Check out, Generate Bill, Exit program. Along with the menu there
also appears a message displaying “Enter your choice (1-16):” where you have
to select your choice that is what you wish to do from the menu and enter its
corresponding number 1 to 16.
As you select the register doctor details in option, message to enter doctors
required information such as doctor name, contact number etc. will appear.
Enter the required information and it will get save to HOSPITAL
MANAGEMENT database doctor’s data
As you select the List doctor record option, the entire doctor details data saved
in the table will get displayed
As you select the register patient details in option, message to enter patient’s
required information such as patient name, contact number etc. will appear.
Enter the required patient information and it will get saved to HOSPITAL
MANAGEMENT database as patient’s data.
As you select the List patient records option, the whole patient data saved in the
table will get displayed.
2
Register Workers Details:
As you select the register workers details option, message to enter worker’s
required information such as workers name, work name, age, contact number
etc. will appear, Enter the required workers information and it will get saved to
HOSPITAL MANAGEMNT database as worker’s data.
As you select the List workers record option, the whole workers data saved in
the table will get displayed.
As you select search doctor details function, the function will ask for required
information such as doctor id then it will display complete information of
doctor.
As you select search patient details function, the function will ask for required
information such as patient id then it will display complete information of
patient.
As you select search worker details function, the function will ask for required
information such as workers id then it will display complete information of
worker.
Using this function user can update the contact detail of doctor by entering
doctor’s id.
3
Update Patient Detail:
Using this function user can update the contact detail of patient by entering
patient’s id.
Using this function user can update the contact detail of worker by entering
worker’s id.
Charges of Patient:
The function will ask to enter charges of patient in bill, id of patient, patient
name, age, fees of doctor visit, and cost of medicine and room charges.
Total Bill:
This function displays total bill of patient after entering patient id.
Exit program:
As you select the exit program option, the program will exit.
4
SOFTWARE
SPECIFICATION
5
SOFTWARE SPECIFICATION
6
TABLES
TABLES
7
8
9
SOURCE CODE
SOURCE CODE
10
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',passwd='mypass',database='hospit
al')
if conn.is_connected():
print('successfully connected')
def menu():
print('---------------------------')
print('---------------------------')
11
print('15.Total Bill of patien')
def insert_doctor_details():
d_id=int(input('enter id of doctor:'))
d_age=int(input('enter age:'))
data=(d_id,d_name,d_age,d_department,d_phono)
c=conn.cursor()
c.execute(sql,data)
conn.commit()
def show_record_doctor_details():
cursor=conn.cursor()
cursor.execute("select*from doctor_details")
data=cursor.fetchall()
12
print (row)
def insert_patient_details():
p_id=int(input('enter id of patient:'))
p_age=int(input('enter age:'))
data=(p_id,p_name,p_age,p_problem,p_phone)
c=conn.cursor()
c.execute(sql,data)
conn.commit()
def show_record_patient_details():
cursor=conn.cursor()
cursor.execute("select*from desc_patient_details1")
data=cursor.fetchall()
13
for row in data:
print (row)
def insert_workers_detail():
w_id=int(input('enter id of worker:'))
w_age=int(input('enter age:'))
data=(w_id,w_name,w_age,w_workname,w_phone)
c=conn.cursor()
c.execute(sql,data)
conn.commit()
print("successfully registeed")
def show_record_workers_detail():
cursor=conn.cursor()
cursor.execute("select*from workers_detail1")
data=cursor.fetchall()
14
for row in data:
print (row)
menu()
def search_doctor_details():
cursor=conn.cursor()
data=cursor.fetchone()
print(row)
def search_patient_details():
cursor=conn.cursor()
data=cursor.fetchone()
print(row)
menu()
15
def search_workers_detail():
cursor=conn.cursor()
data=cursor.fetchone()
print(row)
def insert_bill_details():
data=(p_id,p_name,p_age,drvisit,medicine,room)
c=conn.cursor()
c.execute(sql,data)
conn.commit()
16
print("successfully Updated")
def show_record_bill():
print('Bill Record')
cursor=conn.cursor()
cursor.execute("select*from bill1")
data=cursor.fetchall()
print (row)
menu()
def total_bill():
print()
cursor=conn.cursor()
data=cursor.fetchall()
print (row)
data=cursor.fetchone()
17
for row in data:
def update_patient_details():
cursor=conn.cursor()
conn.commit()
cursor.execute("select*from desc_patient_details1")
data=cursor.fetchall()
print (row)
def update_doctor_details():
cursor=conn.cursor()
18
cursor.execute("update doctor_details set d_phone=%s where d_id=%s;"%
(d_phone,d_id,))
conn.commit()
cursor.execute("select*from doctor_details")
data=cursor.fetchall()
print (row)
def update_workers_detail():
cursor=conn.cursor()
conn.commit()
cursor.execute("select*from workers_detail1")
data=cursor.fetchall()
print (row)
19
while True:
menu()
print(">..................................................................<")
if opt=='1':
insert_doctor_details()
elif opt=='2':
show_record_doctor_details()
elif opt=='3':
insert_patient_details()
elif opt=='4':
show_record_patient_details()
elif opt=='5':
insert_workers_detail()
elif opt=='6':
show_record_workers_detail()
elif opt=='7':
search_doctor_details()
elif opt=='8':
search_patient_details()
elif opt=='9':
search_workers_detail()
elif opt=='10':
20
update_doctor_details()
elif opt=='11':
update_patient_details()
elif opt=='12':
update_workers_detail()
elif opt=='13':
insert_bill_details()
elif opt=='14':
show_record_bill()
elif opt=='15':
total_bill()
elif opt=='16':
exit()
else:
print("Invalid Choice")
if opt!='0':
break
21
INPUT/OUTPUT
SCREEN
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
CONCLUSION
38
CONCLUSION
ADVANTAGES
39