Professional Documents
Culture Documents
Hms Brahm
Hms Brahm
2 ‘B’ BLOCK
JANAKPURI NEW DELHI -58
A PROJECT REPORT ON
SUBMITTED BY:
NAME : BRAHM DEV TRIPATHI
CLASS : XII A
ROLL NO. :
UNDER THE GUIDANCE OF:
MR. GANESH MEENA SIR
PGT (COMPUTER SCIENCE)
1
CERTIFICATE
THIS IS TO CERTIFY THAT BRAHM DEV TRIPATHI OF
CLASS XII A, ROLL NO.:********** HAS PREPARED
THIS REPORT ON THE PROJECT ENTITLED“
HOSPITAL MANAGEMENT SYSTEM ” . THIS REPORT
IS THE RESULT OF HIS EFFORTS AND ENDEAVORS.
THE REPORT IS FOUND WORTHY OF ACCEPTANCE AS
FINAL REPORT FOR THE SUBJECT COMPUTER
SCIENCE OF CLASS XII SC. HE HAS PREPARED THE
REPORT UNDER MY GUIDANCE.
2
ACKNOWLEDGEMENT
I THANK MY COMPUTER SCIENCE TEACHER
MR. GANESH MEENA FOR GUIDANCE AND
SUPPORT. I WOULD ALSO LIKE TO THANK MY
PARENTS AND MY BROTHER FOR
ENCOURAGING ME DURING THE COURSE OF
THIS PROJECT. I WOULD LIKE TO THANK MY
FRIENDS MOHIT SHARMA AND
HIMANSHU KASOHTIYA FOR HELPING ME IN
MANY ASPECTS. FINALLY I WOULD LIKE TO
THANK CBSE FOR GIVING ME THIS
OPPORTUNITY TO UNDERTAKE THIS
PROJECT.
3
CONTENTS
• About Python ................................................................................ 05
• Requirements ............................................................................... 09
• Coding……………………………………………………………….…11
• Output………………………………………………………………….33
• Table Structure………………………………………………………..44
• Bibliography…………………………………………………………..46
4
ABOUT PYTHON
Python is an interpreter, high-level and
general-purpose programming
language. Python's design philosophy
emphasizes code readability with its notable
use of significant whitespace. Its language
constructs and object-oriented
approach aim to help
programmers write clear, logical code for
small and large-scale projects.
Python was created in the late 1980s, and first released in 1991, by Guido van Rossum as a
successor to the ABC programming language.
Python 2.0, released in 2000, introduced new
features, such as list comprehensions, and a
garbage collection system with
reference counting, and was discontinued
with version 2.7 in 2020.
Python uses dynamic typing and a combination of reference counting and a cycle- detecting garbage
collector for memory management. It also features dynamic name resolution (late binding), which
binds method and variable names during program execution.
5
FEATURES OF PYTHON
1. Easy to use: Due to simple syntax rule
2. Interpreted language: Code execution & interpretation line by line.
3. Cross-platform language: It can run on windows, Linux, Macintosh etc. equally
4. Expressive language: Less code to be written as itself express the purpose of the code.
5. Completeness: Support wide range of library.
6. Free & Open Source: Can be downloaded freely and source code can be modify for improvement.
SHORTCOMINGS OF PYTHON
1. Lesser libraries : as compared to other programming languages like c++, java, .net
3. Weak on Type-binding: It not pin point on use of a single variable for different data type.
6
ABOUT MYSQL
INTRODUCTION
MySQL is currently the most popular open source database software. It is a multi-user, multithreaded
database management system. MySQL is especially popular on the web. It is one of the parts of the
very popular LAMP platform. Linux, Apache, MySQL and PHP or WIMP platform Windows, Apache,
MySQL and PHP. MySQL AB was founded by Michael W idenius (Monty), David Axmark and Allan
7
FEATURES OF MYSQL:
OPEN SOURCE & FREE OF COST:
It is Open Source and available at free of cost.
• Portability: Small enough in size to install and run it on any types of Hardware and OS like Linux,
MS Windows or Mac etc.
• Connectivity: Various APIs are developed to connect it with many programming languages.
• Query Language: It supports SQL (Structured Query Language) for handling database.
8
REQUIREMENTS
HARDWARE REQUIREMENTS
• Computer, for coding and typing the required documents of the project.
• Printer, to print the required documents of the project.
• Compact drive.
• Processor : Pentium quad core
• Ram : 64 mb
• Hard disk : 20 gb
SOFTWARE REQUIREMENTS
• Operating system : windows 10 or 11
• Python 3 : for execution of program
• MySQL : for storing data in the database
• Python – MySQL connector : for database connectivity and
• MS word – For presetation of output
9
ABOUT THE PROJECT
My project on “HOSPITAL MANAGEMENT SYSTEM” give idea about the management in
hospital. The package gives all the information regarding the details of doctors, nurses,
10
CODING
##hospital management software
import sys
Registration():
print("""=====================================================================
=========================================================================""")
print("""====================================================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================""")
Administration():
ch=1
while ch!=5:
11
print("""===============================================================
==== !!!!!!!!!!!!!!!!!!!!!!!!!!! {( ADMINISTRATION )} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===========================================================================
1. SHOW DETAILS
2. ADD NEW MEMBER
3. DELETE EXISTING ONE
4. UPDATE RECORDS
5. EXIT
""")
if b==1:
ch=1
while ch!=4:
print("""==============================================================
====================================================================
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
4. UPDATE RECORDS
5. EXIT
""")
#ASKING USER'S CHOICE
if c==1:
row=mycursor.fetchall()
12
if len(row)>0:
for i in row:
b=0
v=list(i)
"MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
else:
elif c==2:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
k=["NRID","NAME","AGE","ADDRESS","CONTACT","MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
else:
elif c==3:
row=mycursor.fetchall()
13
if len(row)>0:
for i in row:
v=list(i)
k=["WRKID","NAME","AGE","ADDRESS","CONTACT","MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
else:
ch=c
elif b==2:
ch=1
while ch!=4:
print("""===============================================================
======================================================================
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
4. EXIT
""")
if c==1:
14
#ASKING THE DETAILS
name=input("ENTER DR. NAME:")
spe=input("ENTER YOUR SPECIALISATION:")
age=input("ENTER YOUR AGE:")
fees=input("ENTER FEES:")
ms=input("ENTER MONTHLY_SALARY:")
#INSERTING VALUES ENTERED INTO THE DOCTORS_TABLE
(name,specialisation,age,address,contact,fees,monthly_salary)
values('"+name.upper()+"','"+spe.upper()+"','"+age+"','"+add.upper()+"','"+cont+"','"+fees+"','"+ms+"')
")
mysql.commit()
ms=int(input("ENTER MONTHLY_SALARY:"))
values('"+name.upper()+"','"+age+"','"+add.upper()+"','"+cont+"','"+str(ms)+"')")
mysql.commit()
15
print(" SUCCESSFULLY ADDED!!")
elif c==3:
#ASKING THE DETAILS
ms=input("ENTER MONTHLY_SALARY:")
mycursor.execute("insert into
other_workers_details(name,age,address,contact,monthly_salary)
values('"+name.upper()+"','"+age+"','"+add.upper()+"','"+cont+"','"+ms+'
)")
mysql.commit()
ch=c
elif b==3:
ch=1
while ch!=4:
print("""================================================================
======================================================================
16
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
4. EXIT
""")
if c==1:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if p=="y":
mysql.commit()
else:
else:
elif c==2:
row=mycursor.fetchall()
17
if len(row)>0:
print(row)
if p=="y":
mysql.commit()
else:
else:
elif c==3:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if p=="y":
mysql.commit()
else:
print(" NOT DELETED!!")
else:
18
ch=c
elif b==4:
ch=1
while ch!=4:
print("""============================================================
====================================================================
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
4. EXIT """)
if c==1:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if p=="y":
19
fees=input("ENTER FEES:")
ms=input("ENTER MONTHLY_SALARY:")
name=UPPER('"+name+"'),specialisation=UPPER('"+spe+"'),age='"+age+"',address=UPPER('"+add
mysql.commit()
else:
else:
elif c==2:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if p=="y":
ms=int(input("ENTER MONTHLY_SALARY:"))
20
mycursor.execute("update nurse_details set
name=UPPER('"+name+"'),age='"+age+"',address=UPPER('"+add+"'),contact='"+cont+"',monthly_
mysql.commit()
else:
else:
elif c==3:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if p=="y":
ms=input("ENTER MONTHLY_SALARY:")
21
mycursor.execute("update other_workers_details set
name=UPPER('"+name+"'),age='"+age+"',address=UPPER('"+add+"'),contact='"+cont+"',monthly_
mysql.commit()
else:
else:
ch=c
elif b==5:
return
ch=b
#-----------------
----------------
Start Function
-------------------
----------
def Patient():
ex=1
while ex!=5:
print("""==================================================================
=====================================================================
22
3. DISCHARGE PATIENT
4. SEARCH PATIENT DETAILS
5. EXIT
""")
if b==1:
row=mycursor.fetchall()
for i in row:
b=0
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
'STATUS']
d=dict(zip(k,v))
print(d)
elif b==2:
23
age=str(input("ENTER PATIENT AGE: "))
PaidBill='N'
if con=='Y' or con=='y':
(name,sex,age,address,contact,doctor_recommended,PaidBill)
values('"+str(name.upper())+"','"+str(sex.upper())+"','"+str(age)+"','"+str(address.upper())+"','"+str(c
o ntact)+"','"+str(docRecmd.upper())+"','"+str(PaidBill)+"')")
mysql.commit()
print("""=============================================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================
""")
for i in mycursor:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
24
#dischare process
elif b==3:
row=mycursor.fetchall()
if len(row)>0:
print(row)
if bill=="y":
mysql.commit()
else:
#Search process
elif b==4:
ch=1
while ch!=7:
print("""========
=============
=============
=============
=============
25
!!!!!!!!!!!!!!!!!!!!!!!!!! {( SEARCH PATIENT DETAILS )} !!!!!!!!!!!!!!!!!!!!!!!!!
================================================================
1. PATIENT ID WISE
2. PATIENT NAME WISE
3. PATIENT SEX WISE
4. PATIENT AGE WISE
5. PATIENT CONTACT WISE
6. RECOMMENDED DOCTOR WISE
7. EXIT
""")
if c==1:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
26
elif c==2:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
elif c==3:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
27
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
elif c==4:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
28
elif c==5:
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
elif c==6:
='"+prdw+"'")
row=mycursor.fetchall()
if len(row)>0:
for i in row:
v=list(i)
if v[-1]=='N' or v[-1]=='n':
v[-1]='NOT DISCHARGE'
29
else:
v[-1]='DISCHARGED'
k=['PUID','NAME','SEX','AGE','ADDRESS','CONTACT','DOCTOR_RECOMMENDED','STATUS']
print(dict(zip(k,v)))
else:
print(" RECORD DOES NOT EXITS!!")
ch=c
ex=b
#elif b==5:
return
while(True):
print("""====================================================================
====================================================================== """)
import mysql.connector
#passwd=str(input("ENTER THE DATABASE PASSWORD;"))
mysql=mysql.connector.connect(host="localhost",user="root",passwd="admin@123")
mycursor=mysql.cursor()
mycursor.execute("use hospitals")
30
AUTO_INCREMENT primary key,name varchar(30) not null,sex varchar(10),age int(3),address
varchar(15),monthly_salary int(10))")
varchar(15),monthly_salary int(10))")
#creating table for storing the username and password of the user
#printing option
while(True):
print("""=================================================================
=======================================================================
1. SIGN IN (LOGIN)
2. SIGN UP (REGISTER)
""")
if r==0:
31
mycursor.close()
sys.exit()
elif r==2:
Registration();
elif r==1:
print("""==============================================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {{SIGN IN }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================""")
row=mycursor.fetchall()
for i in row:
a=list(i)
if a[0]==str(ps):
while(True):
can perform””
print("""===============
====================
====================
32
==============================================================
1.ADMINISTRATION
3.SIGN OUT
""")
if a==1:
Administration();
elif a==2:
Patient();
###SIGN OUT
elif a==3:
break
else:
break
else:
if len(row)==0:
OUTPUT
When open the program show first page.
33
Figure 1
Figure 2
If user enter choice number “1” then show following screen: Figure
Figure 4
If user enter choice number “3” then exit the menu and show following screen: Figure
34
If user enter choice number “1” then show following screen: Figure
If user enter choice number “1” then show following screen: Figure
In above men oned screen give three types to show the details. If user enter choice number “1” then show following
screen:
Figure 8
: Figure 9
35
If user enter choice number “3” then show following screen:
Figure 10
If user enter choice number 4 then come back on Figure 6. A er that if user enter choice number “2” then
show following screen:
Figure 11
If user enter choice number “1” then show following screen and wants following details of doctor. User entered
all require details and system give message “SUCCESSFULLY ADDED”.
Figure 12
If user enter choice number “2” then show following screen and wants following details of nurse. User entered
all require details and system give message “SUCCESSFULLY ADDED”. Figure 13
36
If user enter choice number “3” then show following screen and wants following details of other worker. User
entered all require details and system give message “SUCCESSFULLY ADDED”. Figure 14
If user enter choice number “4” then come back on Figure 6. A er that if user enter choice number “3” then show
following screen:
Figure 15
If user enter choice number “1” then show following screen and system ask to user doctor id for delete the
record, user enter doctor id, system will check the id and if record does not exists into system then show
following message:
Figure 16
If user enter choice number “1” then show following screen and system ask to user doctor id for delete the
record, user enter doctor id, system will check the id and if record does exists into system then show the
doctor’s details and ask to user delete the records. If user enter “N” then record does not delete and show
following screen:
Figure 17
37
A er select choice number “1” and enter doctor id for delete, if user enter “Y” then show following screen: Figure
18
If user enter choice number “2” then show following screen and system ask to user nurse id for delete the
record, user enter nurse id, system will check the id and if record does not exists into system then show
following message:
Figure 19
If user enter choice number “2” then show following screen and system ask to user nurse id for delete the
record, user enter nurse id, system will check the id and if record exists into system then show the nurse’s
details and ask to user delete the records. If user enter “N” then record does not delete and show following
screen:
Figure 20
A er select choice number “2” and enter nurse id for delete, if user enter “Y” then show following screen: Figure
21
38
If user enter choice number “3” then show following screen and system ask to user other worker id for delete
the record, user enter other worker id, system will check the id and if record does not exists into system then
show following message:
Figure 22
If user enter choice number “3” then show following screen and system ask to user other worker id for delete
the record, user enter other worker id, system will check the id and if record exists into system then show the
other worker’s details and ask to user delete the records. If user enter “N” then record does not delete and
show following screen:
Figure 23
A er select choice number “3” and enter other worker id for delete, if user enter “Y” then show following screen:
Figure 24
If user enter choice number “4” then come back on Figure 6. A er that if user enter choice number “4” then show
following screen:
Figure 25
If user enter choice number “1” then system ask to user doctor id and check into database, if record does not exists
then show following screen:
Figure 26
39
If record exists into database then show the exists details of doctor and ask to user for update, if user enter “N”
choice then show following screen:
Figure 27
If record exists into database then show the exists details of doctor and ask to user for update, if user enter “Y”
choice then system ask to user all details of doctor’s and user enter all details again with new changes: Figure
28
If user enter choice number “2” then system ask to user nurse id and check into database, if record does not exists
then show following screen:
Figure 29
If record exists into database then show the exists details of nurse and ask to user for update, if user enter “N”
choice then show following screen:
Figure 30
If record exists into database then show the exists details of nurse and ask to user for update, if user enter “Y”
choice then system ask to user all details of nurse’s and user enter all details again with new changes: Figure
31
40
If user enter choice number “3” then system ask to user other worker id and check into database, if record
does not exists then show following screen: Figure 32
If record exists into database then show the exists details of other worker and ask to user for update, if user
enter “N” choice then show following screen: Figure 33
If record exists into database then show the exists details of other worker and ask to user for update, if user
enter “Y” choice then system ask to user all details of other worker’s and user enter all details again with new
changes:
Figure 34
If user enter choice number “4” then come back on Figure 6 and user enter choice number “5” then come back
on Figure 3. A er that user enter choice number “2” then show following screen: Figure 35
41
If user enter choice number “1” then show following screen:
Figure 36
Figure 37
Figure 38
Figure 39
42
If user enter choice number “1” then show following screen: Figure
40
If user enter choice number “2” then show following screen: Figure
41
If user enter choice number “3” then show following screen: Figure
42
If user enter choice number “4” then show following screen: Figure
43
If user enter choice number “5” then show following screen: Figure
44
43
If user enter choice number “6” then show following screen: Figure
45
If user enter choice number “7” then Figure 35. If user enter choice number “5” then show Figure 4.
TABLE STRUCTURE
Table 1
Table 2
44
Table 3
Table 4
Table 5
45
BIBLIOGRAPHY
• COMPUTER SCIENCE IN PYTHON BY PREETI
ARORA.
………………………………………………………………………………………………
>>>>>>>>>>>>>>>>>>>>>>>>>>THE END <<<<<<<<<<<<<<<<<<<<<<<
………………………………………………………………………………………………
46