Hosptial Management System 5678453
Hosptial Management System 5678453
HOSPITAL
MANAGEMENT
Session: 2024-25
1
BACKGROUND OF THE
PROJECT
2
Preface
In this era of technology many systems are going to be automated
visiting hospitals quite often when someone is ill or any other health issue.
admitted. There I have observed they are doing the work manually using
register.
evaluation and I talk to my group members and they all agreed to do so.
3
Introduction to Hospital Management
In today’s world, all the things have become computerized. Generally, the
To register patient information, there is need of a lot paper work. So, this
software is useful for doing hospital work easy. It registers the patient’s
1) aadhar no.
2) patient name
6) blood group.
receptionist of the hospital. By using this software, you can easily take the
appointment to the consultant doctor with date and time and appointment
Hence, this software makes easy work for both patient and hospital
management.
4
Design a system for better patient care.
Reduce hospital operating costs.
Provide MIS (Management Information System) report on demand to
management for better decision making.
Better co-ordination among the different departments.
Provide top management a single point of control.
mysql.connecter:
5
By importing this package, we are able to establish the connection
between SQL and Python. datetime:
This package provides basic functions for display date related values in
the program. random:
This package has functionality to generate random numbers and select
numbers within a range.
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.
The syntax is:
<cursor object>=<connection object>.cursor() execute():
This function is use to execute the sql query and retrieve records using
python.
The syntax is:
<cursor object>.execute(<sql query string>) def():
This function is a block of code which only runs when it is called.
fetchall():
This function will return all the rows from the result set in the form of a
tuple containing the records. commit():
This function provides changes in the database physically.
6
And BLOOD GROUP.
II. APPOINTMENT:
In this option, the patient can take appointment by entering
AADHAR NO.
After entering it, you will get list of doctor i.e. CARDIOLOGIST,
RHEUMATOLOGIST, PSYCHITRIST, NEUROLOGIST,
OTOLARYNGONOLOGIST and MI ROOM.
III. LIST OF DOCTORS:
In this option, you will get the LIST OF DOCTORS with their
SPECIALITY and ROOM NO.
IV. SERVICES AVAILABLE:
In this option, you will get the list of services available in our
hospital such as:
• X-RAY
• MRI
• CT SCAN
• ENDOSCOPY
• DIALYSIS
• ULTRASOUND
• EEG
• ENMG
• ECG
V. TO MODIFY DATA:
In the last and final module i.e. EXIT MODULE, user can end the
program.
7
At last, program will display THANK YOU with giving a positive message
i.e. ”STAY SAFE, STAY HEALTHY.” and “HEALTH IS WEALTH.” It will also
display the names of developers.
USE OF TECHNOLOGY
MySQL
WHAT IS MySQL?
MySQL is a relational DBMS that can run virtually all platforms, including
Linux, Unix and Windows.
8
WHAT IS PYTHON?
The Python interpreter and the extensive standard library are available in
source or binary form without charge for all major platforms, and can be
freely distributed.
9
HARDWARE AND SOFTWARE REQUIREMENT
SYSTEM:
Language: English
DISPLAY DEVICE:
Name:-Intel(R) HD Graphics
Co., Ltd
DAC Type:-Internal
(32 Bit)(60Hz)
10
Database Dictionary
1. Doctors
2. Nurses
3. Patients
11
4. Users
5. Workers
12
SOURCE CODE
##hospital management software @tutorialaicsip
print("""
================================
================================
""")
Password:"))
cn=ms.connect(host="localhost",user="root",passwd="root")
cur=cn.cursor()
patients\
doc_rec varchar(30))")
13
varchar(40),\ age int(2),\
int(10))")
#creating table for storing the username and password of the new user
sign_up():
print("""
============================================
===========================================
=
""")
14
u=input("Enter New User Name!!:") p=input("Enter password
cn.commit()
print("""
============================================
=
============================================
=
""")
def login():
print("""
============================================
=
============================================
=
""")
un=input("Username!!:")
ps=input("Password!!:") pid=0
username='"+un+"'")
15
rec=cur.fetchall()
for i in rec:
a=list(i) if
a[0]==str(ps):
while(True):
print("""
1.Admin Tasks
3.Sign Out
""")
#Admin tasks
if a==1:
print("""
1. Show Details
4. Exit
""")
if b==1: print("""
1. Doctors
16
2. Nurses
3. Workers
""")
if c==1:
b=0
v=list(i)
k=["NAME","DEPARTEMNT","AGE","CITY","MOBILE","FEES","SALARY"]
d=dict(zip(k,v))
for i in d:
print(i,":",d[i])
print()
elif c==2:
v=list(i)
k=["NAME","AGE","CITY","MOBILE","SALARY"]
d=dict(zip(k,v)) for i in d:
print(i,":",d[i]) print()
17
#See the details of workers
elif c==3:
v=list(i)
k=["NAME","AGE","CITY","MOBILE","SALARY"]
d=dict(zip(k,v)) for i in d:
print(i,":",d[i]) print()
print("""
1. Doctor
2. Nurse
3. Worker
""")
if c==1:
dep=input("Enter department:")
18
#Insert values into doctors table
values('"+name+"','"+dep+"','"+age+"','"+city+"','"+mno+"','"+fees+"','
"+sal+"')")
elif c==2:
values('"+name+"','"+age+"','"+city+"','"+mno+"','"+str(sal)+"')")
cn.commit()
successfully.")
elif c==3:
19
city:") mno=input("Enter mobile no:")
ms=input("Enter Salary:")
values('"+name+"','"+age+"','"+city+"','"+mno+"','"+ms+"')")
cn.commit()
print("SUCCESSFULLY ADDED")
1. Doctors
2. Nurses
3. Workers
""")
if c==1:
name='"+name+"'")
rec=cur.fetchall()
print(rec)
(y/n):")
if p=="y":
20
cur.execute("delete from doctors where
name='"+name+"'")
cn.commit()
else:
print("Error in deletion....")
elif c==2:
rec=cur.fetchall() print(rec)
(y/n):")
if p=="y":
name='"+name+"'")
mysql.commit()
print("Error in deletion")
c==3:
name='"+name+"'")
21
rec=cur.fetchall() print(rec)
(y/n):")
if p=="y":
name='"+name+"'")
cn.commit()
print("Error in deletion.")
elif b==4:
break
3. Discharge Patient
4. Exit
""")
if b==1:
22
cur.execute("select * from patients")
b=0 v=list(i)
k=["NAME","GENDER","AGE","CITY","MOBILE NO"]
d=dict(zip(k,v))
for i in d:
print(i,":",d[i]) #Admit
rec=cur.fetchall()
print(rec)
dr=str(input("Enter doctorname to be
values('"+str(pid)+"','"+str(name)+"','"+str(mn)+"','"+str(age)
print("""
====================================
====================================
23
""")
b==3:
name='"+name+"'")
rec=cur.fetchall()
(y/n):") if bill=="y":
like'%"+name+"%'")
cn.commit()
elif bill=="n":
discahrge patient.")
else:
###SIGN OUT
elif a==3:
break
24
k=["USERNAME"] d=dict(zip(k,v)) print(d)
if u in d.values():
pd==pd1:
username='"+u+"'")
cn.commit() print("Password
Changed Successfully.")
match...") else:
25
login()
elif r==3:
change_pass() elif r==4: print("Thank you for using Krishna
Hospital App, Have a nice day!") break
Output
1. Main Menu
2. Sign Up
3. Log In
26
4. Change password
5. Admin Task
27
7. Add New member
8. Delete Doctor
28
9. Show Patient details
29
11. Show patient record
30
13. Sign Out
BIBLIOGRAPHY
31
To develop this project many references were used:
2. NCERT Textbook
3. https://www.google.com
4. https://www.python.org.in
5. https://www.mysql.org
6. https://www.tutorialaicsip.com
32