0% found this document useful (0 votes)
14 views39 pages

Hospital Management

Hospital management project for computer science with python class 12th CBSE.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

Hospital Management

Hospital management project for computer science with python class 12th CBSE.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

INTRODUCTION

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.

Register Doctors Details:

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

Display Doctor Details:

As you select the List doctor record option, the entire doctor details data saved
in the table will get displayed

Register patient details:

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.

Display patient details:

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.

Display Workers Details:

As you select the List workers record option, the whole workers data saved in
the table will get displayed.

Search Doctor Detail:

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.

Search Patient Detail:

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.

Search Worker Detail:

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.

Update Doctor Detail:

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.

Update Worker Detail:

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.

Show Record of Bill:

This function displays all records of patient with 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

The frontend of the program is python.

The backend of the program is SQL.

The version of python i.e. 3.7.0.

Latest version of SQL.

Operating system windows 8.

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("HOSPITAL MANAGEMENT SYSTEM")

print('---------------------------')

print('1.Register Doctor details')

print('2.ALL Doctor details')

print('3.Register patient details')

print('4.ALL patient details')

print('5.Register workers detail')

print('6.All workers detail')

print('7.Search Doctor details')

print('8.Search Patient details')

print('9.Search workers detail')

print('10.Update Doctor details')

print('11.Update Patient details')

print('12.Update Workers detail')

print('13.ENTER CHARGES of PATIENT for Bills_details')

print('14. Show records of Bill')

11
print('15.Total Bill of patien')

def insert_doctor_details():

print('enter details of new doctor')

d_id=int(input('enter id of doctor:'))

d_name=input('enter doctor name:')

d_age=int(input('enter age:'))

d_department=input('enter the department:')

d_phono=int(input('enter phone number:'))

data=(d_id,d_name,d_age,d_department,d_phono)

sql='insert into doctor_details values(%s,%s,%s,%s,%s)'

c=conn.cursor()

c.execute(sql,data)

conn.commit()

print("Data Entered Successfully")

def show_record_doctor_details():

print('all records of doctors')

cursor=conn.cursor()

cursor.execute("select*from doctor_details")

data=cursor.fetchall()

for row in data:

12
print (row)

def insert_patient_details():

print('enter new patient information')

p_id=int(input('enter id of patient:'))

p_name=input('enter patient name:')

p_age=int(input('enter age:'))

p_problem=input('enter the problems:')

p_phone=int(input('enter phone number:'))

data=(p_id,p_name,p_age,p_problem,p_phone)

sql='insert into desc_patient_details1 values (%s,%s,%s,%s,%s)'

c=conn.cursor()

c.execute(sql,data)

conn.commit()

print("data enter successfully")

def show_record_patient_details():

print('all records of doctors')

cursor=conn.cursor()

cursor.execute("select*from desc_patient_details1")

data=cursor.fetchall()

13
for row in data:

print (row)

def insert_workers_detail():

print('enter new worker information')

w_id=int(input('enter id of worker:'))

w_name=input('enter worker name:')

w_age=int(input('enter age:'))

w_workname=input('enter the workname:')

w_phone=int(input('enter phone number:'))

data=(w_id,w_name,w_age,w_workname,w_phone)

sql='insert into workers_detail1 values (%s,%s,%s,%s,%s)'

c=conn.cursor()

c.execute(sql,data)

conn.commit()

print("successfully registeed")

def show_record_workers_detail():

print('all records of workers')

cursor=conn.cursor()

cursor.execute("select*from workers_detail1")

data=cursor.fetchall()

14
for row in data:

print (row)

menu()

def search_doctor_details():

print('search doctor record by entering id')

exp=int(input("enter doctor id:"))

cursor=conn.cursor()

cursor.execute("select*from doctor_details where d_id=%s;"%(exp,))

data=cursor.fetchone()

for row in data:

print(row)

def search_patient_details():

print('search patient record by entering id')

exp=int(input("enter patient id:"))

cursor=conn.cursor()

cursor.execute("select*from desc_patient_details1 where p_id=%s;"%(exp,))

data=cursor.fetchone()

for row in data:

print(row)

menu()

15
def search_workers_detail():

print('search worker record by entering id')

exp=int(input("enter worker id:"))

cursor=conn.cursor()

cursor.execute("select*from workers_detail1 where w_id=%s;"%(exp,))

data=cursor.fetchone()

for row in data:

print(row)

def insert_bill_details():

print("Enter chargs of patient in bill")

p_id=int(input("Enter ID of patient: "))

p_name=input("Enter patient name: ")

p_age=int(input("Enter age: "))

drvisit=int(input("Enter fee of Dr. visit : "))

medicine=int(input("Enter the cost of medicine: "))

room=int(input("Enter room charges: "))

data=(p_id,p_name,p_age,drvisit,medicine,room)

sql='insert into bill1 values (%s,%s,%s,%s,%s,%s)'

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()

for row in data:

print (row)

menu()

def total_bill():

print("Record of charges without total")

print()

p_id=int(input("Enter ID of patient: "))

cursor=conn.cursor()

cursor.execute("select*from bill1 where p_id=%s;"%(p_id,))

data=cursor.fetchall()

for row in data:

print (row)

cursor.execute("select sum(drvisit+medicine+room) from bill1 where p_id=


%s;"%(p_id,))

data=cursor.fetchone()

17
for row in data:

print ("Total Bill : ",row)

def update_patient_details():

print('change phone number of patient ')

p_id=int(input("Enter ID of patient: "))

p_phone=int(input("Enter new phone number : "))

cursor=conn.cursor()

cursor.execute("update desc_patient_details1 set p_phone=%s where p_id=


%s;"%(p_phone,p_id,))

print("phone number updated")

conn.commit()

cursor.execute("select*from desc_patient_details1")

data=cursor.fetchall()

for row in data:

print (row)

def update_doctor_details():

print('change phone number of doctor ')

d_id=int(input("Enter ID of doctor: "))

d_phone=int(input("Enter new phone number : "))

cursor=conn.cursor()

18
cursor.execute("update doctor_details set d_phone=%s where d_id=%s;"%
(d_phone,d_id,))

print("phone number updated")

conn.commit()

cursor.execute("select*from doctor_details")

data=cursor.fetchall()

for row in data:

print (row)

def update_workers_detail():

print('change phone number of worker ')

w_id=int(input("Enter ID of worker: "))

w_phone=int(input("Enter new phone number : "))

cursor=conn.cursor()

cursor.execute("update workers_detail1 set w_phone=%s where w_id=%s;"%


(w_phone,w_id,))

print("phone number updated")

conn.commit()

cursor.execute("select*from workers_detail1")

data=cursor.fetchall()

for row in data:

print (row)

19
while True:

menu()

opt=input("Enter Your Choice:")

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")

opt=input("Print 0 to continue... any other key to exit...:")

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

The HOSPITALMANAGEMENT system is a great improvement over the


manual system using case fields and paper. The computerization of the system
has speed up the process. In the current system, the front office managing is
very slow. The hospital managing system was thoroughly checked and tested
with dummy data and thus is found to be very reliable.

ADVANTAGES

 It is fast and reliable.


 Avoids data redundancy and inconsistency.
 Very user-friendly
 Easy accessibility of data.
 Number of personnel required is considerably less.
 Provides more security and integrity to data.

39

You might also like