JASPAL KAUR PUBLIC SCHOOL
COMPUTER SCIENCE
Project FILE
Hospital Management System
ACADEMIC YEAR – 2024 -25
SUBMITTED BY :
NAME – Saurish Seth
CLASS – 12 A
BOARD ROLL NO. –
SUBJECT – COMPUTER SCIENCE
SUBMITTED TO : Ms. Pooja Nemani(PGT Computer)
CERTIFICATE
This is to certify that Saurish Seth , student of
class XII-A has successfully completed the
project titled “Hospital Management System”
under my supervision, during the academic year
2024-2025. He has taken interest and has shown
sincerity in completion of this project.
I certify that this project is up to my expectation
and is as per guidelines issued by CBSE, NEW
DELHI.
______________ _____________
Internal Examiner External Examiner
Acknowledgment
It is with pleasure that I acknowledge my sincere
gratitude to our teacher, Mrs. Pooja Nemani taught
and undertook the responsibility of teaching the
subject computer science. I have greatly benefited
from her classes.
I am especially indebted to our Principal
Mrs. Asha Saran Srivastava who has always been a
source of encouragement and support and without
whose inspiration this project would not have been
successful. I would like to place on record, heartfelt
thanks to her.
Finally, I would like to express my appreciation for
my parents and friends who helped me a lot in
finishing this project and supporting me.
INDEX
1. Introduction and Objective
2. Advantages
3. Disadvantages
[Link]
5. FUNCTIONS
6. Hardware And Software
Requirement
7. Source Code
8. Output
9. Conclusion
10. Bibliography
Introduction
This Software is used to maintain the records of the Doctors,
details of patients with their history of medication and other staffs
working in the hospital.
Objective
The objective of this project is to design, develop,
and implement a software solution that efficiently
manages various hospital operations, enhancing
patient care, streamlining processes, and improving
overall organizational efficiency.
ADVANTAGES
Our project has a large scope in the future as it is easy to use it, understand
it
and modify it.
In this age of evolving technologies, our software aims to modernize
Data Storing which were not able to stand the test of time, either because
of superior competition or due to heavy storing of data in the system.
Our software helps the management department to manage and maintain
the records of doctors, patients and the other staff workers of the hospital
much easier and effective method from virtually anywhere in the world.
Our software is a paperless software which makes it easy to sustain and
aids the environment.
Our software increases the precision and efficiently by eliminating the human
chance of error.
Our software is laidback and can be accessed by employees and users.
DISADVANTAGES OF EXISTING
SYSTEM USED
The present software are obsolete, sluggish, unorganised and are
only accessible by either the staffs or the customers.
Most of the work is done manually which increases the chances of human
error.
The Proposed System
It’s an age of computers and automating of such an organisation gives the
better look.
The work becomes fully automated and any information regarding the
organisation can be obtained by clicking the button.
MODULES
import [Link]
• By importing this we can establish connection between database and mysql.
FUNCTIONS
connect():
This function establishes connection between
Python and MySQL
cursor():
It is a special control structure that facilitates the
row-by- row processing of records in the result set.
execute():
This function is used to execute the sql query and
retrieve records using python.
def():
A function is a block of code which only runs when
it is called.
commit():
This function ensures that the change made by
mysql in the database .
Input/Output Requirement
HARDWARE REQUIREMENTS
Operating System: - Windows 10 or above
Processor: - Pentium (Any) or AMD Athlon
(3800+ - 4200 + Dual Core)
RAM: - 512 MB+
Hard Disk: - SATA 40GB Or Above
Motherboard: - 1.845 Or 915,995 For Pentium or MSI K9MM-V VIA
K8M800+8237R Plus Chipset for AMD Athlon
Software Requirements
Windows OS
Python Programming Language
MySQL Database Management System
Source Code
##hospital management software ##PRINTING WELCOME NOTE
print("""
====================================================
=============================
WELCOME TO SP HOSPITALS PVT. LTD.
====================================================
============================= """)
##creating database connectivity
import [Link]
passwd=str(input("ENTER THE DATABASE PASSWORD;"))
mysql=[Link](host="localhost",user=
"root",passwd="1234")
mycursor=[Link]() #creating database
#creating table for storing the username and password
of the user
[Link]("USE sp_hospitals")
#pr
print("""
1. SIGN IN (LOGIN)
2. SIGN UP (REGISTER) """)
r=int(input("enter your choice:"))
#IF USER WANTS TO REGISTER
if r==2:
print("""
====================================================
=============================
!!!!!!!!!!!!!!!!!!!!!!!!PLEASE REGISTER
YOURSELF!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================
=============================
""")
u=input("ENTER YOUR PREFERRED USERNAME!!:")
p=input("ENTER YOUR PREFERRED PASSWORD
(PASSWORD SHOULD BE STRONG!!!:")
#ENTERING THE ENTERED VALUE TO THE
USER_DATA TABLE
[Link]("insert into user_data
values('"+u+"','"+p+"')")
[Link]()
print("""
====================================================
=============================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================
=============================
""")
x=input("enter any key to continue:") #IF USER WANTS
TO LOGIN
if r==1:
#PRINTING THE SING IN OPTION AGAIN TO THE USER AFTER
REGISTRATION
print("""
====================================================
=============================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {{SIGN
IN }}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================
=============================
""")
un=input("ENTER THE USERNAME!!:")
ps=input("ENTER THE PASSWORD!!:")
[Link]("select password from user_data
where username='"+un+"'")
row=[Link]()
for i in row:
a=list(i)
if a[0]==str(ps):
while True:
print("""
1. ADMINISTRATION
2. PATIENT (ADMISSION AND DISCHARGE
PROCESS)
3. SIGN OUT
""")
a=int(input("ENTER YOUR"))
#if user wants to enter
if a==1:
print("""
1. SHOW DETAILS
2. ADD NEW MEMBER
3. DELETE EXISTING ONE
4. EXIT
""")
b=int(input("ENTER choice"))#showing the
if b==1:
print("""
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS """)
c=int(input("ENTER YOUR CHOICE:"))
#ASKING USER'S if user wants
if c==1:
[Link]("select * from
doctor_details")
row=[Link]()
print("NAME","SPECIALISATION","AGE","ADDRESS","CONTACT
","FEES","MONTHLY_SALARY")
for i in row:
print(i,end=',')
elif c==2:
[Link]("select * from
nurse_details")
row=[Link]()
print("NAME","AGE","ADDRESS","CONTACT","MONTHLY_SALARY
")
for i in row:
print(i,end=',')
elif c==3:
[Link]("select * from
other_workers_details")
row=[Link]()
print("NAME","AGE","ADDRESS","CONTACT
NO","MONTHLY_SALARY")
for i in row:
print(i,end=',')
elif b==2:
print("""
[Link] DETAILS
[Link] DETAILS
[Link] WORKERS """)
c=int(input("ENTER YOUR CHOICE:"))
#FOR ENTERING
if c==1:
name=input("ENTER DR. NAME:")
spe=input("ENTER SPECIALISATION:")
age=int(input("ENTER AGE:"))
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
fees=int(input("ENTER FEES:"))
ms=int(input("ENTER
MONTHLY_SALARY:"))
[Link]("insert into
doctor_details values('%s','%s',%s,'%s','%s',%s,%s)"%
(name,spe,age,add,cont,fees,ms))
[Link]()
print("SUCCESSFULLY ADDED")
#for entering
elif c==2: #ASKING THE
name=input("ENTER NURSE NAME:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
ms=int(input("ENTER
MONTHLY_SALARY:"))
[Link]("insert into
nurse_details
values('"+name+"','"+age+"','"+add+"','"+cont+"','"+
str(ms)+"')")
[Link]()
print("SUCCESSFULLY ADDED")
elif c==3:
name=input("ENTER WORKER NAME:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
ms=input("ENTER MONTHLY_SALARY:")
[Link]("insert into
other_workers_details
values('"+name+"','"+age+"','"+add+"','"+cont+"','"+
ms+"')")
[Link]()
print("SUCCESSFULLY ADDED")
elif b==3:
print("""
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS """)
c=int(input("ENTER YOUR CHOICE:"))
if c==1:
name=input("ENTER DOCTOR'S NAME:")
[Link]("select * from
doctor_details where name=='"+name+"'")
row=[Link]()
print(row)
p=input(("really wanna delete this data?
(y/n):"))
if p=="y":
[Link]("delete from
doctor_details where name='"+name+"'")
[Link]()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif c==2:
name=input("ENTER NURSE NAME:")
[Link]("select *
nurse_details where name=='"+name+"'")
row=[Link]()
print(row)
p=input(("really wanna delete this
data? (y/n):"))
if p=="y":
[Link]("delete from
doctor_details where name='"+name+"'")
[Link]()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif c==3:
name=input("ENTER THE WORKER NAME:")
[Link]("select * from
workers_details where name=='"+name+"'")
row=[Link]()
print(row)
p=input(("really wanna delete this
data? (y/n):"))
if p=="y":
[Link]("delete from
doctor_details where name='"+name+"'")
[Link]()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
if b==4:
break
print("thank you")
#entering the patient
elif a==2:
print("""
[Link] PATIENT DETAILS
[Link] NEW PATIENT
[Link] PATIENT
[Link]
""")
b=int(input("ENTER choice"))
if b==1:
[Link]("select * from
patient_details")
row=[Link]()
print("NAME","GENDER","AGE","ADDRESS","CONTACT")
for i in row:
print(i,end="")
elif b==2:
name=str(input("ENTER NAME: "))
age=str(input("ENTER AGE: "))
address=str(input("ADDRESS: "))
doc_r=str(input("iSSUE OF THE PATIENT: "))
[Link]("insert into
patient_details
values('"+name+"','"+age+"','"+address+"','"+doc_r+"
')")
[Link]()
print("""
====================================================
=============================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================
=============================
""")
elif b==3:
name=input("ENTER THE PATIENT NAME:")
[Link]("select * from
patient_details where name='"+name+"'")
row=[Link]()
bill=input("HAS HE PAID ALL THE BILLS ?
(y/n):")
print(row)
if bill=="y":
[Link]("delete from
patient_details where name='"+name+"'")
[Link]()
exit
if b==4:
break
if a==3:
break
#IF THE USERNAME AND PASSWORD IS NOT IN THE DATABASE
else:
print("The Entered Username and Password does
not match with the accounts stored in the Database")
Output
When option 2 (sign up) is selected:
when option 1(login) is selected and wrong
c
password is used:
When user signs in and selects to add
details of doctor in administration:
When user selects to show details of
doctor:
When user selects to go to patients section
and then add details and then sees it:
CONCLUSION
The development of a hospital management system using Python
and SQL demonstrates how technology can streamline critical
healthcare processes, making patient and resource management
more efficient and accessible. This project highlights the potential of
relational databases in organizing and retrieving large volumes of
sensitive data securely, a fundamental need in the healthcare
industry. By integrating Python with SQL, we created a system that
not only manages patient records, doctor schedules, and billing
information but also minimizes manual work and reduces the risk of
human error.
In summary, this project underscores the importance of robust data
management solutions in hospital settings, contributing to better
patient care, more effective resource allocation, and an overall
improvement in hospital administration. Future enhancements could
include implementing advanced security measures, automating data
analysis for operational insights, and expanding functionality to
meet evolving healthcare needs. This project offers a
foundational framework on which further features can be
built to enhance the hospital management process even
further.
BIBLIOGRAPHY
1. COMPUTER SCIENCE WITH PYTHON
CLASS XII BY PREETI ARORA
2. [Link]
3. [Link]
4. [Link]
5. [Link]
6. [Link]