Sei sulla pagina 1di 17

HOSPITAL MANAGEMENT SYSTEM

J COMPONENT PROJECT REPORT


Review – III

Submitted by

Aditya Bist (18BCE2303)


Kumar Vibhash(18BCE0730)
Shaurya Mangal (18BCI0139)

In the partial fulfillment for the award of the degree of

B. Tech

in

Computer Science and Engineering

Under the guidance of

Prof. R.Sathyaraj

School of Computer Science and Engineering

October, 2019
Contents

Title – Hospital Management System

Abstract

This Hospital management system was created considering 3 different users. They include
the Doctor, Patient and the ADMIN. During creation of a user the user will enter his/her role
and according to the role user will get connected to the required database.The patient will be
able to book appointments on this database. The doctor can view his schedule and see his
appointments. Moreover, the doctor can provide the medicines and give the solution to the
problem. The ADMIN will be in charge of appointing the patients to the respective doctors
depending upon symptoms and doctor department. The ADMIN can also remove the data or
edit it. A database for patient-doctor appointment will be created which will contain all the
appointments of different patients and doctors and each user will have specific permission
and visibility to view this database.

Introduction

Booking an appointment in a hospital is a tedious and tiring process.Often the patients either
has to call the hospital or physically go to the hospital to get a appointment.The ADMIN will
have to comb through schedules to see if a doctor is free and available on that time. Even
doctors need to know their patients and also about the medicines in the hospital.To reduce all
of this workload a simple Hospital Management System has been created. It will have a simple
interface where the patient can book appointment, the receptionist can assign doctors and the
doctor can see his/her schedule and help the patient. It is easy to manage the database and all
the records will be stored in a virtual environment thus saving paper and money.

Background Study

The following links provide a brief explanation and insight on Hospital Management System-

https://ieeexplore.ieee.org/document/7020594

https://doctors.practo.com/hospital-management-system/

https://ieeexplore.ieee.org/document/5564121
Methodology and Tools

ER Diagram
Front End – Python 3.7 with Tkinter
Python 3.7 was used as a frontend tool with Tkinter being used to give it GUI (Graphical
User Interface).

Tkinter is a GUI tool used to make applications with python.


A client-connector was downloaded to connect python with the MySQL server and database.
The connector is named as mysql-connector-python.

Database - MySQL

One of the most popular SQL databases which is open source. A browser for viewing the
database MySQL Workbench was also used. This was to facilitate easier Viewability
of the database schema and table

Explanation of Module:-Patient logins after registering and books an appointment.The


Admin then logins and assigns the doctor.Now,the doctor will login and update the issue.
After all this,The patient logins and check his result.Since the issue is finshed the admin can
Login and delete the issue.

Experiment and Result

Sample Source Code

CODE FOR LOGIN PAGE:

class LoginPage(tk.Frame):
def __init__(self,master):
tk.Frame.__init__(self, master)
self.heading = tk.Label(self, text="Hospital Management System",height = 7,
font=('Algerian 40 bold'), fg='black', bg='lightblue').pack()
self.email = tk.Label(self, text="Email Id", font=('arial 18 bold'), fg='black',
bg='lightgreen').pack()
self.email_ent = tk.Entry(self,fg='lightgreen', width=30)
self.email_ent.pack()
self.password = tk.Label(self, text="Password", font=('arial 18 bold'), fg='black',
bg='lightgreen').pack()
self.password_ent = tk.Entry(self,show="*" ,width=30)
self.password_ent.pack()
self.submit = tk.Button(self, text="Login", width=20, height=2, bg='lightgreen',
command = lambda : self.genric(master)).pack()
self.register = tk.Button(self, text="Register", width=20, height=2, bg='lightgreen',
command = lambda : master.switch_frame(UserRegistration)).pack()

def genric(self,master):
email = self.email_ent.get();
password = self.password_ent.get();
if(email == "" or password == ""):
tk.messagebox.showinfo("Warning", "Please Fill Up All Boxes")
return
c.execute("""Select email_id,password,role,first_name from user""")
results = c.fetchall()
global NAME
flag = 0;
for row in results:
email1 = row[0]
password1 = row[1]
role1 = row[2]
fname1 = row[3]
if(email1==email and password1 == password and role1 == "Doctor"):
NAME = fname1
tk.messagebox.showinfo("Congrats", "Successful!!")
master.switch_frame(DoctorPage)
flag=1
return
if(email1==email and password1 == password and role1 == "Patient"):
NAME = fname1
tk.messagebox.showinfo("Congrats", "Successful!!")
master.switch_frame(PatientPage)
flag=1
return
if(email1==email and password1 == password and role1 == "ADMIN"):
NAME = fname1
tk.messagebox.showinfo("Congrats", "Successful!!")
master.switch_frame(ReceptionPage)
flag=1
return
if(flag == 0):
tk.messagebox.showinfo("Warning", "Login Unsuccessful!!")
return

CODE FOR PATIENT PAGE:

class PatientPage(tk.Frame):
def __init__(self, master):
global NAME
tk.Frame.__init__(self, master)
self.master = master
self.heading=tk.Label(self, text="Welcome " + NAME,width = 20,height = 5,
font=('Algerian 18 bold'), fg='black', bg='lightblue').pack()
self.appointment = tk.Button(self,text = "Book an appointment",font = ('arial 18
bold'),command = lambda : master.switch_frame(addAppointment)).pack()
self.result = tk.Button(self,text = "Results",font = ('arial 18 bold'),command = lambda :
master.switch_frame(Results)).pack()
self.logout = tk.Button(self,text = "Logout",font = ('arial 18 bold'),command = lambda :
master.switch_frame(LoginPage)).pack()
CODE FOR DOCTOR PAGE:

class DoctorPage(tk.Frame):
def __init__(self,master):
global NAME
tk.Frame.__init__(self,master)
self.master = master
self.heading=tk.Label(self,text = "Welcome " + NAME,bg = "lightblue",font = ('Algerian
20 bold'),width = 30, height = 10).pack();
self.id = tk.Label(self,text = "Enter Appointment Id",font = ('arial 18 bold'),bg =
'lightgreen').pack()
self.id_ent = tk.Entry(self,width = 10)
self.id_ent.pack()
self.Update= tk.Button(self, text="Update Appointment", bg='purple',width =10,
command = lambda: self.generic5(master)).pack(fill="both")
self.Logout= tk.Button(self, text="Logout", bg='red',width =10, command = lambda:
master.switch_frame(LoginPage)).pack(fill="both")
def generic5(self,master):
global a_id,name,id2,issue,dname;
global NAME;
a_id = self.id_ent.get();
if(a_id == ""):
tk.messagebox.showinfo("Warning","Please Enter Appointment Id")
return
c.execute("""Select id,p_name,p_id,issue,d_name from record""")
results = c.fetchall();
flag = 0
for row in results:
if(row[0] == int(a_id)):
flag =1
name = row[1]
id2=row[2]
issue = row[3]
dname = row[4]
break
if(flag==0):
tk.messagebox.showinfo("Warning","Id Not Found!!")
return
if(dname!=NAME):
tk.messagebox.showinfo("Warning","Not Assigned to this patient")
return
master.switch_frame(UpdateIssue)
CODE FOR ADMIN:

class ReceptionPage(tk.Frame):
def __init__(self,master):
tk.Frame.__init__(self,master)
self.master = master
self.heading=tk.Label(self, text="Welcome Admin " ,width = 20,height = 10,
font=('Algerian 20 bold'), fg='black', bg='lightblue').pack()
self.id = tk.Label(self,text = "Enter Appointment Id",font = ('arial 18 bold'),bg =
'lightgreen').pack()
self.id_ent = tk.Entry(self,width = 10)
self.id_ent.pack()
self.Update= tk.Button(self, text="Update Appointment", bg='steelblue',width =10,
command = lambda: self.generic3(master)).pack(fill="both")
self.Remove= tk.Button(self, text="Delete Appointment", bg='steelblue',width =10,
command = lambda: self.generic4(master)).pack(fill="both")
self.Logout= tk.Button(self, text="Logout", bg='steelblue',width =10, command =
lambda: master.switch_frame(LoginPage)).pack(fill="both")

def generic3(self,master):
global a_id,name,id2,issue;
a_id = self.id_ent.get();
if(a_id == ""):
tk.messagebox.showinfo("Warning","Please Enter Appointment Id")
return
c.execute("""Select id,p_name,p_id,issue from record""")
results = c.fetchall();
flag = 0
for row in results:
if(row[0] == int(a_id)):
flag =1
name = row[1]
id2=row[2]
issue = row[3]
break
if(flag==0):
tk.messagebox.showinfo("Warning","Id Not Found!!")
return
master.switch_frame(UpdateAppointment);
def generic4(self,master):
global a_id;
a_id = self.id_ent.get();
c.execute("""Select id,p_name,p_id,issue from record""")
results = c.fetchall();
flag = 0
for row in results:
if(row[0] == int(a_id)):
flag =1
name = row[1]
id2=row[2]
issue = row[3]
break
if(flag==0):
tk.messagebox.showinfo("Warning","Id Not Found!!")
return
sql = """delete from record where id = %s"""
c.execute(sql,(a_id,))
db.commit()
tk.messagebox.showinfo("Congrats","Id Deleted")

We illustrate this process with a complete appointment being booked. We register a user as a
patient and then book an appointment, the receptionist assigns the doctor and the doctor gives
the solution to the issue of the patient. The patient can then view his/her results.

This is the login screen, the home screen


Now we register as a patient Rahul
This is the database where the value of the table user has been updated.
We have logged in successfully

Now we book an appointment


Then,

Below we see the record table getting updated


Now we login as the ADMIN and assign a doctor to the patient
Assigning a Doctor to the patient

Now we login as the doctor


Update the appointment

Now we login back as the patient,and look at the results and and enter the id
Now since the results have come, we can delete the appointment. This can be done by the ADMIN.
And Delete it
After deletion,

Thus we illustrated the operation of Insertion by the patient, Updating by the doctor and the
receptionist, Selection by the patient and Deletion by the ADMIN.

Conclusion

This is a simple hospital management system which can be used instantly. However, this is
still a prototype and other additional functionalities can be added to make it more useful like
a billing system, laboratories, even other hospitals. We can also model it better to the real
world demands. We could use other databases to reduce the access time and also make it
more interactive. Moreover we can always extend this to multiple hospitals and make a
website for the people to access it.

References

http://effbot.org/tkinterbook/pack.htm

https://wiki.python.org/moin/TkInter

Fundamentals of Database Systems (Sixth Edition) - Ramez Elmasri and Shamkant B.


Navathe

Potrebbero piacerti anche