Hosptial Management System
Hosptial Management System
Hosptial Management System
HOSPITAL
MANAGEMENT
20__-__
Group members:
1) _____________
2) _____________
3) _____________
1
BACKGROUND OF THE
PROJECT
2
Preface
hospitals quite often when someone is ill or any other health issue. Previous
I have observed they are doing the work manually using register.
This thought creates an idea to make this project for my practical evaluation
and I talk to my group members and they all agreed to do so. Then I talked
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
3) age
4) gender
5) phone no.
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
Objectives of the project
Main objectives of a Hospital Management System are:
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.
5
FUNCTIONS AND MODULES
MODULES
mysql.connecter:
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
FLOW OF THE PROJECT
Our project is based on HOSPITAL MANAGEMENT. The project consists of
3 modules :
1. PATIENT
2. DOCTOR
3. EXIT
In the PATIENT MODULE, you can have 5 options i.e.
I. REGISTER YOURSELF:
In this option, the patient can register himself/herself by entering
their AADHAR NO., PATIENT NAME, AGE, GENDER, and PHONE NO.
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
7
V. TO MODIFY DATA:
In the last and final module i.e. EXIT MODULE, user can end the
program.
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.
8
USE OF TECHNOLOGY
MySQL
WHAT IS MySQL?
MySQL is a relational DBMS that can run virtually all platforms, including
Linux, Unix and Windows.
9
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.
10
HARDWARE AND SOFTWARE REQUIREMENT
SYSTEM:
Language: English
DISPLAY DEVICE:
Name:-Intel(R) HD Graphics
Co., Ltd
DAC Type:-Internal
(32 Bit)(60Hz)
11
Database Dictionary
1. Doctors
2. Nurses
3. Patients
12
4. Users
5. Workers
13
SOURCE CODE
##hospital management software @tutorialaicsip
print("""
================================
================================
""")
tables
import mysql.connector as ms
cn=ms.connect(host="localhost",user="root",passwd="root")
cur=cn.cursor()
cur.execute("use krishna_hospital")
mobile varchar(10),\
age int(3),\
city varchar(50),\
doc_rec varchar(30))")
14
cur.execute("create table if not exists doctors\
department varchar(40),\
age int(2),\
city varchar(30),\
mobile varchar(15),\
fees int(10),\
salary int(10))")
age int(2),\
city varchar(30),\
mobile varchar(15),\
salary int(10))")
age int(2),\
city varchar(30),\
mobile varchar(15),\
salary int(10))")
#creating table for storing the username and password of the new user
15
password varchar(30) default'000')")
def sign_up():
print("""
============================================
============================================
""")
cn.commit()
print("""
=============================================
=============================================
""")
def login():
print("""
=============================================
=============================================
16
""")
un=input("Username!!:")
ps=input("Password!!:")
pid=0
username='"+un+"'")
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
17
3. Delete existing member
4. Exit
""")
if b==1:
print("""
1. Doctors
2. Nurses
3. Workers
""")
if c==1:
rec=cur.fetchall()
for i in rec:
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])
18
print()
elif c==2:
rec=cur.fetchall()
for i in rec:
v=list(i)
k=["NAME","AGE","CITY","MOBILE","SALARY"]
d=dict(zip(k,v))
for i in d:
print(i,":",d[i])
print()
elif c==3:
rec=cur.fetchall()
for i in rec:
v=list(i)
k=["NAME","AGE","CITY","MOBILE","SALARY"]
d=dict(zip(k,v))
for i in d:
print(i,":",d[i])
print()
19
elif b==2:
print("""
1. Doctor
2. Nurse
3. Worker
""")
if c==1:
dep=input("Enter department:")
age=input("Enter age:")
fees=input("Enter fees:")
values('"+name+"','"+dep+"','"+age+"','"+city+"','"+mno+"','"+fees+"','
"+sal+"')")
cn.commit()
successfully. ")
20
#New nurse details
elif c==2:
age=input("Enter age:")
sal=int(input("Enter salary:"))
values('"+name+"','"+age+"','"+city+"','"+mno+"','"+str(sal)+"')")
cn.commit()
successfully.")
elif c==3:
age=input("Enter Age:")
city=input("Enter city:")
ms=input("Enter Salary:")
21
cur.execute("insert into workers
values('"+name+"','"+age+"','"+city+"','"+mno+"','"+ms+"')")
cn.commit()
print("SUCCESSFULLY ADDED")
elif b==3:
print("""
1. Doctors
2. Nurses
3. Workers
""")
if c==1:
name='"+name+"'")
rec=cur.fetchall()
print(rec)
(y/n):")
if p=="y":
name='"+name+"'")
22
cn.commit()
else:
print("Error in deletion....")
elif c==2:
name='"+name+"'")
rec=cur.fetchall()
print(rec)
(y/n):")
if p=="y":
name='"+name+"'")
mysql.commit()
else:
print("Error in deletion")
elif c==3:
23
cur.execute("select * from workers where
name='"+name+"'")
rec=cur.fetchall()
print(rec)
(y/n):")
if p=="y":
name='"+name+"'")
cn.commit()
else:
print("Error in deletion.")
elif b==4:
break
elif a==2:
print("""
3. Discharge Patient
4. Exit
24
""")
if b==1:
rec=cur.fetchall()
for i in rec:
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])
elif b==2:
pid=pid+1
rec=cur.fetchall()
25
print(rec)
dr=str(input("Enter doctorname to be
recommended:"))
values('"+str(pid)+"','"+str(name)+"','"+str(mn)+"','"+str(age)+"','"+str(
city)+"','"+str(dr)+"')")
cn.commit()
print("""
====================================
====================================
""")
#dischare a patient
elif b==3:
discharge:")
name='"+name+"'")
rec=cur.fetchall()
print(rec)
if bill=="y":
like'%"+name+"%'")
26
cn.commit()
elif bill=="n":
discahrge patient.")
else:
elif b==4:
break
###SIGN OUT
elif a==3:
break
def change_pass():
rec=cur.fetchall()
for i in rec:
v=list(i)
k=["USERNAME"]
d=dict(zip(k,v))
print(d)
if u in d.values():
27
if pd==pd1:
username='"+u+"'")
cn.commit()
else:
else:
28
Output
1. Main Menu
2. Sign Up
29
3. Log In
4. Change password
5. Admin Task
30
6. Show details & Doctor Details
31
8. Delete Doctor
32
10. Admit a patient
33
12. Discharge Patient
34
BIBLIOGRAPHY
35