Hospital Management System
Hospital Management System
MAMBAKKAM
COMPUTER SCIENCE
Topic: Hospital Management System
Done By:
M.Yuvalakshmi
XII-‘A’
BONAFIDE CERTIFICATE
This is to certify that this COMPUTER SCIENCE Project on the topic
Date: ……………………..
I would like to thank my lab assistant, lab in charge and technical staffs for providing
correct information which makes the completion of this project work in an excellent way.
I can’t forget to offer my sincere thanks to parents, and also to my classmates who helped
me to carry out this project work successful and for their valuable advice and support,
which received from them time to time.
TABLE OF CONTENT:
1. ABSTRACT
2. SYSTEM CONFIGURATION
3. INTRODUCTION
PYTHON
MYSQL
SYSTEM CONFIGURATION:
HARDWARE CONFIGURATION
Microsoft windows 7 professional/windows 8/windows 8.2:
Processor : Intel Core i5 or equivalent
Memory : 2 GB (32-bit), 4 GB (64-bit)
Disk space : 1.5 GB of free disk space
SOFTWARE REQUIREMENTS
1 GB RAM (2 GB+ recommended)
9-58 GB free hard disk space depending on edition and configuration, including
space required for temporary files
DVD-ROM drive (if installing from a Media Kit DVD)
Basic GPU – Any vendor DirectX 9.0 class or better (Pixel Shader Level 2)
Intel® Pentium® or compatible, 1.6 GHz minimum (2GHz+ recommended)
1024x768 or higher-resolution monitor
MOUSE OR OTHER POINTING DEVICE
INTRODUCTION:
PYTHON:
Python is a high-level, interpreted scripting language developed in the late 1980s by Guido van
Rossum at the National Research Institute for Mathematics and Computer Science in the
Netherlands. The initial version was published at the alt.sources newsgroup in 1991, and version
was released in 1994.
Python 2.0 was released in 2000, and the 2.x versions were the prevalent releases until December
2008. At that time, the development team made the decision to release version 3.0, which
contained a few relatively small but significant changes that were not backward compatible with
the 2.x versions. Python 2 and 3 are very similar, and some features of Python 3 have been
backported to Python 2. But in general, they remain not quite compatible.
Both Python 2 and 3 have continued to be maintained and developed, with periodic release
updates for both. As of this writing, the most recent versions available are 2.7.15 and 3.6.5.
However, an official End of life of January 1,2020 has been established for Python 2, after which
time it will no longer be maintained. If you are a newcomer to Python, it is recommended that you
focus on Python 3, as this tutorial will do.
Python is still maintained by a core development team at the Institute, and Guido is still in charge,
having been given the title of BDFL (Benevolent Dictator For Life) by the Python community.
The name Python, by the way, derives not from the snake, but from the British comedy troupe
Monty Python’s Flying Circus, of which Guido was, and presumably still is, a fan. It is common to
find references to Monty Python sketches and movies scattered throughout the Python
documentation.
Python is Popular
Python has been growing in popularity over the last few years. The 2018 Stack Overflow
Developer Survey ranked Python as the 7th most popular and the number one most wanted
technology of the year. World-class software development countries around the globe use Python
every single day.According to research by Dice Python is also one of the hottest skills to have and
the most popular programming language in the world based on the Popularity of programming
Language Index.
Python is Interpreted
Many languages are compiled, meaning the source code you create needs to be translated into
machine code, the language of your computer’s processor, before it can be run. Programs written
in an interpreted language are passed straight to an interpreter that runs them directly.
This makes for a quicker development cycle because you just type in your code and run it, without
the intermediate compilation step.
One potential downside to interpreted languages is execution speed. Programs that are compiled
into the native language of the computer processor tend to run more quickly than interpreted
programs. For some applications that are particularly computationally intensive, like graphics
processing or intense number crunching, this can be limiting.
In practice, however, for most programs, the difference in execution speed is measured in
milliseconds, or seconds at most, and not appreciably noticeable to a human user. The expediency
of coding in an interpreted language is typically worth it for most applications.
Python is Free
The Python interpreter is developed under an OSI-approved open-source license, making it free to
install, use, and distribute, even for commercial purposes.
A version of the interpreter is available for virtually any platform there is, including all flavors of
Unix, Windows, macOS, smartphones and tablets, and probably anything else you ever heard of.
A version even exists for the half dozen people remaining who use OS/2.
Python is Portable
Because Python code is interpreted and not compiled into native machine instructions, code
written for one platform will work on any other platform that has the Python interpreter installed.
(This is true of any interpreted language, not just Python.)
Python is Simple
As programming languages go, Python is relatively uncluttered, and the developers have
deliberately kept it that way.
A rough estimate of the complexity of a language can be gleaned from the number of keywords or
reserved words in the language. These are words that are reserved for special meaning by the
compiler or interpreter because they designate specific built-in functionality of the language.
Python 3 has 33 keywords, and Python 2 has 31. By contrast, C++ has 62, Java has 53, and Visual
Basic has more than 120, though these latter examples probably vary somewhat by
implementation or dialect.
MYSQL:
Database Management System & Types of DBMS:
Types of DBMS:
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and
Object-Oriented DBMS.
Hierarchical DBMS:As the name suggests, this type of DBMS has a style of predecessor-
successor type of relationship. So, it has a structure similar to that of a tree, wherein the
nodes represent records and the branches of the tree represent fields.
Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to
identify and access data in relation to another piece of data in the database.
Network DBMS: This type of DBMS supports many to many relations wherein multiple
member records can be linked.
Object-oriented DBMS: This type of DBMS uses small individual software called objects.
Each object contains a piece of data, and the instructions for the actions to be done with
the data.
READ Operation
READ Operation on any database means to fetch some useful information from the
database.
Once our database connection is established, you are ready to make a query into this
database. You can use either fetchone() method to fetch single record or fetchall()
method to fetech multiple values from a database table.
fetchone() − It fetches the next row of a query result set. A result set is an object
that is returned when a cursor object is used to query a table.
fetchall()
− It fetches all the rows in a result set. If some rows have already been
extracted from the result set, then it retrieves the remaining rows from the result
set.
DATABASE CONNECTIVITY:
Steps to connect MySQL database in Python using MySQL Connector
Python
1. Install MySQL Connector Python using pip.
2. Use the mysql.connector.connect()method of MySQL Connector Python with
required parameters to connect MySQL.
3. Use the connection object returned by a connect()method to create a cursor object
to perform Database Operations.
4. The cursor.execute()to execute SQL queries from Python.
5. Close the Cursor object using a cursor.close() and MySQL database connection
using connection.close() after your work completes.
6. Catch Exception if any that may occur during this process.
LIBRARIES AND FUNCTIONS USED:
1. TKINTER - Tkinter is the standard GUI library for Python. Python when
combined with Tkinter provides a fast and easy way to create GUI
applications. Tkinter provides a powerful object-oriented interface to the Tk
GUI toolkit.
FUNCTIONS USED:
4. show tables;
5. insert into patients_details values(50002,”devi”,”female”,”1996-04-16”,25,235354,
“pheumonia”,”amoxillin”,”BGF545”,”head ache”,300,300,0,600);
6. select * from patients_details;
7. select * from patients_details where Patient_Id=50002;
8. delete from patients_details where Patient_Id =50012;
SOURCE CODE:
from tkinter import *
from tkinter import ttk
import random
from tkinter import messagebox
import mysql.connector as m
from mysql.connector.errors import DatabaseError
root=Tk()
#===============================TEXTVARIABLES===================================
PatientId=StringVar()
PatientName=StringVar()
Gender=StringVar()
DateOfBirth=StringVar()
Age=StringVar()
NhsNumber=StringVar()
Problem=StringVar()
Medicine=StringVar()
ref=StringVar()
SideEffect=StringVar()
Doc_visit=StringVar()
Medi_fee=StringVar()
Room_fee=StringVar()
Total_bill=StringVar()
SearchPatientId=StringVar()
PatientIdBar=StringVar()
#=================================DEFINING CLASS==================================
class Hospital:
def __init__(self,root):
self.root = root
self.root.title("Hospital Management System")
self.img=PhotoImage(file='C:\\Users\\mail2\\OneDrive\\Desktop\\New folder (2)\\medical-
assistance.png')
self.root.iconphoto(False,self.img)
self.root.geometry("1360x700+0+0")
self.root.configure(background="#FFB0AB")
#=====================================FRAMES====================================
TitleFrames=Frame(MainFrame,bd=7,width=1320,height=100,relief=RIDGE)
TitleFrames.grid(row=0,column=0)
#==========================================================================
MidFrame=Frame(MainFrame,bd=5,width=1340,height=520,relief=RIDGE,bg="#FFB0AB")
MidFrame.grid(row=3,column=0)
DataFrame= Frame(MidFrame,bd=5,relief=RIDGE)
DataFrame.place(x=0,y=0,width=1330,height=300)
DataFrameLeft=LabelFrame(DataFrame,bd=5,relief=RIDGE,padx=10,font=("times new
roman",12,"bold"),
text="Patient Information")
DataFrameLeft.place(x=0,y=6,width=950,height=275)
DataFrameRight=LabelFrame(DataFrame,bd=5,relief=RIDGE,padx=10,font=("times new
roman",12,"bold"),
text="Prescription")
DataFrameRight.place(x=955,y=6,width=356,height=275)
#==============================================================================
Buttonframe=Frame(MidFrame,bd=7,relief=RIDGE)
Buttonframe.place(x=0,y=300,width=1330,height=50)
Treeviewframe=ttk.Frame(MidFrame,relief=RIDGE)
Treeviewframe.place(x=0,y=350,width=1330,height=160)
self.labeltitle=Label(TitleFrames,text=
" HOSPITAL MANAGEMENTSYSTEM",fg="black",bg="#FFB0AB", font=("Cambria",35,"bold"))
self.labeltitle.grid(row=0,column=0,padx=10)
self.labelAPPLE=Label(TitleFrames,font=('c39hrp36dltt',60),text="APPLE DOG",fg="black")
self.labelAPPLE.grid(row=0,column=1,padx=100)
#===============================EXIT FUNCTION===================================
def Exit():
Exit=messagebox.askyesno("Hospital Management System","Are you sure you wanna Exit?")
if Exit>0:
root.destroy()
return
#==============================ID BAR CODE FUNCTION=============================
def IdBar():
idpay=random.randint(50000,70000)
idbc=("patient id" + str(idpay))
PatientIdBar.set(idbc)
#==========================================================================
self.txtSearch=Entry(SearchFrame,font=("Cambria",16,"bold"),width=39,
textvariable=SearchPatientId,justify='right')
self.txtSearch.grid(row=0,column=2)
self.btnSearch=Button(SearchFrame,pady=1,padx=29,bd=4, font=("Cambria",12,"bold"),
width=13,height=1,bg="#FFB0AB",
fg="black", text="Search ID").grid(row=0,column=3,padx=1)
self.PatientId=Label(DataFrameLeft,font=("arial",12,"bold"),text="Patient Id:",bd=5)
self.PatientId.grid(row=0,column=0,sticky=W,padx=2)
self.PatientId=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=PatientId,width=30)
self.PatientId.grid(row=0,column=1)
self.PatientName=Label(DataFrameLeft,font=("arial",12,"bold"),text="Patient Name:",bd=5)
self.PatientName.grid(row=1,column=0,sticky=W,padx=2)
self.PatientName=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=PatientName,width=30)
self.PatientName.grid(row=1,column=1)
#================combo box===============================
self.Gender=Label(DataFrameLeft,font=("arial",12,"bold"),text="Gender:",bd=6)
self.Gender.grid(row=2,column=0,sticky=W,padx=2)
self.cboGender=ttk.Combobox(DataFrameLeft,font=("arial",12),textvariable=Gender,width=29,
state="readonly")
self.cboGender['values']=(" ","Female","Male")
self.cboGender.current(0)
self.cboGender.grid(row=2,column=1)
#========================================================
self.DateOfBirth=Label(DataFrameLeft,font=("arial",12,"bold"),text="Date of Birth:",bd=5)
self.DateOfBirth.grid(row=3,column=0,sticky=W,padx=2)
self.DateOfBirth=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=DateOfBirth,width=30)
self.DateOfBirth.grid(row=3,column=1)
self.Age=Label(DataFrameLeft,font=("arial",12,"bold"),text="Age:",bd=5)
self.Age.grid(row=4,column=0,sticky=W,padx=2)
self.Age=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Age,width=30)
self.Age.grid(row=4,column=1)
self.NhsNumber=Label(DataFrameLeft,font=("arial",12,"bold"),text="NHS Number:",bd=5)
self.NhsNumber.grid(row=5,column=0,sticky=W,padx=2)
self.NhsNumber=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=NhsNumber,width=30)
self.NhsNumber.grid(row=5,column=1)
self.Problem=Label(DataFrameLeft,font=("arial",12,"bold"),text="Problem:",bd=5)
self.Problem.grid(row=6,column=0,sticky=W,padx=2)
self.Problem=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Problem,width=30)
self.Problem.grid(row=6,column=1)
#================combo box===============================
self.Medicine=Label(DataFrameLeft,font=("arial",12,"bold"),text="Medicine:",bd=5)
self.Medicine.grid(row=0,column=2,sticky=W,padx=2)
self.cboMedicine=ttk.Combobox(DataFrameLeft,textvariable=Medicine,state="readonly",
font=("arial",12),width=33)
self.cboMedicine['value']=(" ","Beclomethasone","Primaquine","Amlodipine","Phenytoin",
"Amxicillin","Mesna","Metformin","Ibuprofen","Paraceptamol")
self.cboMedicine.current(0)
self.cboMedicine.grid(row=0,column=3)
#=========================================================
self.ref=Label(DataFrameLeft,font=("arial",12,"bold"),text="Ref No:",bd=5)
self.ref.grid(row=1,column=2,sticky=W,padx=2)
self.ref=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=ref,width=35)
self.ref.grid(row=1,column=3)
self.SideEffect=Label(DataFrameLeft,font=("arial",12,"bold"),text="Side Effect:",bd=5)
self.SideEffect.grid(row=2,column=2,sticky=W,padx=2)
self.SideEffect=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=SideEffect,width=35)
self.SideEffect.grid(row=2,column=3)
self.Doc_visit=Label(DataFrameLeft,font=("arial",12,"bold"),text="Doctor visit:",bd=5)
self.Doc_visit.grid(row=3,column=2,sticky=W,padx=2)
self.Doc_visit=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Doc_visit,width=35)
self.Doc_visit.grid(row=3,column=3)
self.Medi_fee=Label(DataFrameLeft,font=("arial",12,"bold"),text="Medicine Fee:",bd=5)
self.Medi_fee.grid(row=4,column=2,sticky=W,padx=2)
self.Medi_fee=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Medi_fee,width=35)
self.Medi_fee.grid(row=4,column=3)
self.Room_fee=Label(DataFrameLeft,font=("arial",12,"bold"),text="Room Fee:",bd=5)
self.Room_fee.grid(row=5,column=2,sticky=W,padx=2)
self.Room_fee=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Room_fee,width=35)
self.Room_fee.grid(row=5,column=3)
self.Total_bill=Label(DataFrameLeft,font=("arial",12,"bold"),text="Total bill:",bd=5)
self.Total_bill.grid(row=6,column=2,sticky=W,padx=2)
self.Total_bill=Entry(DataFrameLeft,font=("arial",12),bd=5,textvariable=Total_bill,width=35)
self.Total_bill.grid(row=6,column=3)
#============================DATA FRAME RIGHT FILLING============================
self.txtPrescription=Text(DataFrameRight,font=("arial",11,"bold"),width=40,height=12,
padx=2,pady=6)
self.txtPrescription.grid(row=0,column=0)
#=========================FUNCTIONALITY DEACLARATYION===========================
PatientId.get(),
PatientName.get(),
Gender.get(),
DateOfBirth.get(),
Age.get(),
NhsNumber.get(),
Problem.get(),
Medicine.get(),
ref.get(),
SideEffect.get(),
Doc_visit.get(),
Medi_fee.get(),
Room_fee.get(),
Total_bill.get()
))
conn.commit()
fetch_data()
IdBar()
conn.close()
messagebox.showinfo('Success!',"Redcord has been Inserted")
#=============================UPDATE ===========================
def update():
conn=m.connect(host="localhost",username="root",passwd="0912",database="hospital")
mc=conn.cursor()
mc.execute("Update patients_details set Patient_Name=%s,Gender=%s,Date_of_Birth=%s,Age=%s,
NHS_Number=%s,Problem=%s,Medicine=%s,Ref_No=%s,Side_Effect=%s,Doc_visit=%s,Medi_fee=%s,R
oom_fee=%s,
Total_bill=%s where Patient_Id=%s",(
PatientName.get(),
Gender.get(),
DateOfBirth.get(),
Age.get(),
NhsNumber.get(),
Problem.get(),
Medicine.get(),
ref.get(),
SideEffect.get(),
Doc_visit.get(),
Medi_fee.get(),
Room_fee.get(),
Total_bill.get(),
PatientId.get()
))
conn.commit()
fetch_data()
IdBar()
clear()
conn.close()
messagebox.showinfo("Data Entry Form","Record Successfully Updated!")
conn=m.connect(host="localhost",username="root",passwd="0912",database="hospital")
mc=conn.cursor()
mc.execute("select * from patients_details")
rs=mc.fetchall()
if len(rs)!=0:
self.hospital_table.delete(*self.hospital_table.get_children())
for i in rs:
self.hospital_table.insert("",END,values=i)
conn.commit()
conn.close()
def get_cursor(event=""):
cursor_row=self.hospital_table.focus()
content=self.hospital_table.item(cursor_row)
row=content['values']
PatientId.set(row[0])
PatientName.set(row[1])
Gender.set(row[2])
DateOfBirth.set(row[3])
Age.set(row[4])
NhsNumber.set(row[5])
Problem.set(row[6])
Medicine.set(row[7])
ref.set(row[8])
SideEffect.set(row[9])
Doc_visit.set(row[10])
Medi_fee.set(row[11])
Room_fee.set(row[12])
Total_bill.set(row[13])
IdBar()
#=========================PRESCRIPTION ==========================
def iPrescription():
self.txtPrescription.insert(END,"Patient Id\t\t\t: " +PatientId.get() +"\n")
self.txtPrescription.insert(END,"Patient Name\t\t\t: " +PatientName.get() +"\n")
self.txtPrescription.insert(END,"Gender\t\t\t: " +Gender.get() + "\n")
self.txtPrescription.insert(END,"Date Of Birth\t\t\t: " +DateOfBirth.get() +"\n")
self.txtPrescription.insert(END,"Age\t\t\t: " +Age.get() + "\n")
self.txtPrescription.insert(END,"NHS Number\t\t\t: " +NhsNumber.get() +"\n")
self.txtPrescription.insert(END,"Problem\t\t\t: " +Problem.get() +"\n")
self.txtPrescription.insert(END,"Medicine\t\t\t: " +Medicine.get() +"\n")
self.txtPrescription.insert(END,"ref\t\t\t: " +ref.get() + "\n")
self.txtPrescription.insert(END,"SideEffect\t\t\t: " +SideEffect.get() +"\n")
self.txtPrescription.insert(END,"Doc_visit\t\t\t: " +Doc_visit.get() +"\n")
self.txtPrescription.insert(END,"Medi_fee\t\t\t: " +Medi_fee.get() +"\n")
self.txtPrescription.insert(END,"Room_fee\t\t\t: " +Room_fee.get() +"\n")
self.txtPrescription.insert(END,"Total_bill\t\t\t: " +Total_bill.get() +"\n")
fetch_data()
#===========================DELETE =============================
def delete():
if PatientId.get()=="" or ref.get()=="":
messagebox.showerror("Error","First select the member")
else:
conn=m.connect(host="localhost",username="root",passwd="0912",
database="hospital")
mc=conn.cursor()
querry="delete from patients_details where Patient_Id=%s "
value=(PatientId.get(),)
mc.execute(querry,value)
conn.commit()
fetch_data()
clear()
conn.close()
def clear():
PatientId.set("")
PatientName.set("")
Gender.set("")
DateOfBirth.set("")
Age.set("")
NhsNumber.set("")
Problem.set("")
Medicine.set("")
ref.set("")
SideEffect.set("")
Doc_visit.set("")
Medi_fee.set("")
Room_fee.set("")
Total_bill.set("")
self.txtPrescription.delete("1.0",END)
SearchPatientId.set("")
PatientIdBar.set("")
#==========================SEARCH ID============================
def searchId():
try:
conn=m.connect(host="localhost",username="root",passwd="0912",
database="hospital")
mc=conn.cursor()
q="select * from Patients_details where Patient_Id=%s"
value=(SearchPatientId.get(),)
mc.execute(q,value)
row=mc.fetchone()
PatientId.set(row[0])
PatientName.set(row[1])
Gender.set(row[2])
DateOfBirth.set(row[3])
Age.set(row[4])
NhsNumber.set(row[5])
Problem.set(row[6])
Medicine.set(row[7])
ref.set(row[8])
SideEffect.set(row[9])
Doc_visit.set(row[10])
Medi_fee.set(row[11])
Room_fee.set(row[12])
Total_bill.set(row[13])
conn.commit()
except:
messagebox.showinfo("Data Entry Form","No such record found!")
conn.close()
IdBar()
fetch_data()
#=================================================================
self.txtSearch=Entry(SearchFrame,font=("Cambria",16,"bold"),width=39,
textvariable=SearchPatientId,justify='right')
self.txtSearch.grid(row=0,column=2)
self.btnSearch=Button(SearchFrame,pady=1,padx=29,bd=4, font=("Cambria",12,"bold"),
command=searchId,width=13,height=1,bg="#FFB0AB",fg="black",
text="Search ID").grid(row=0,column=3,padx=1)
self.btnPrescription=Button(Buttonframe,bd=2,text="Prescription",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=15,padx=29,command=iPrescription)
self.btnPrescription.grid(row=0,column=0,padx=1)
self.btnPrescriptionData=Button(Buttonframe,bd=2,text="Add Data",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=16,height=1,padx=29,command=Add_new_data)
self.btnPrescriptionData.grid(row=0,column=1,padx=2)
self.btnUpdate=Button(Buttonframe,bd=2,text="Update",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=14,padx=29,pady=1,command=update)
self.btnUpdate.grid(row=0,column=2,padx=2)
self.btnDelete=Button(Buttonframe,bd=2,text="Delete",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=15,height=1,padx=29,pady=1,command=delete)
self.btnDelete.grid(row=0,column=3,padx=2)
self.btnClear=Button(Buttonframe,bd=2,text="Clear",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=15,height=1,padx=29,pady=1,command=clear)
self.btnClear.grid(row=0,column=4,padx=2)
self.btnExit=Button(Buttonframe,bd=2,text="Exit",bg="#FFB0AB",fg="black",
font=("arial",13,"bold"),width=15,height=1,padx=29,pady=1,command=Exit)
self.btnExit.grid(row=0,column=5,padx=4)
scroll_x=Scrollbar(Treeviewframe,orient=HORIZONTAL)
scroll_y=Scrollbar(Treeviewframe,orient=VERTICAL)
self.hospital_table=ttk.Treeview(Treeviewframe,height=12,
column=("PatientId","PatientName","Gender","DateOfBirth","Age","NhsNumber",
"Problem","Medicine","ref","SideEffect","Doc_visit","Medi_fee","Room_fee","Total_bill"),
yscrollcommand=scroll_y.set,xscrollcommand=scroll_x.set)
scroll_x.pack(side=BOTTOM,fill=X)
scroll_y.pack(side=RIGHT,fill=Y)
scroll_x.config(command=self.hospital_table.xview)
scroll_y.config(command=self.hospital_table.yview)
self.hospital_table.heading("PatientId",text="Patient Id")
self.hospital_table.heading("PatientName",text="Patient Name")
self.hospital_table.heading("Gender",text="Gender")
self.hospital_table.heading("DateOfBirth",text="Date of Birth")
self.hospital_table.heading("Age",text="Age")
self.hospital_table.heading("NhsNumber",text="NHS Number")
self.hospital_table.heading("Problem",text="Problem")
self.hospital_table.heading("Medicine",text="Medicine")
self.hospital_table.heading("ref",text="Ref No")
self.hospital_table.heading("SideEffect",text="Side Effect")
self.hospital_table.heading("Room_fee",text="Room Fee")
self.hospital_table.heading("Total_bill",text="Total bill")
self.hospital_table.heading("Doc_visit",text="Doctor visit")
self.hospital_table.heading("Medi_fee",text="Medicine Fee")
self.hospital_table["show"]="headings"
self.hospital_table.column("PatientId",width=70,minwidth=150)
self.hospital_table.column("PatientName",width=140,minwidth=150)
self.hospital_table.column("Gender",width=85,minwidth=100)
self.hospital_table.column("DateOfBirth",width=105,minwidth=110)
self.hospital_table.column("Age",width=105,minwidth=110)
self.hospital_table.column("NhsNumber",width=105,minwidth=110)
self.hospital_table.column("Problem",width=150,minwidth=160)
self.hospital_table.column("Medicine",width=140,minwidth=150)
self.hospital_table.column("ref",width=100,minwidth=120)
self.hospital_table.column("SideEffect",width=90,minwidth=120)
self.hospital_table.column("Room_fee",width=80,minwidth=110)
self.hospital_table.column("Total_bill",width=80,minwidth=120)
self.hospital_table.column("Doc_visit",width=80,minwidth=100)
self.hospital_table.column("Medi_fee",width=60,minwidth=170)
self.hospital_table.pack(fill=BOTH,expand=1)
self.hospital_table.bind("<ButtonRelease-1>",get_cursor)
fetch_data()
if __name__=="__main__":
ob=Hospital(root)
root.mainloop()
OUTPUT:
In the above, the record got successfully inserted. You can see the record where arrow is
pointing .
Now the age 25 in record 20020, has now successfully updated as 50.
Now the record 50020 has got successfully deleted.
At last it asks whether u want to exit the program or not. If you click “no”, it wont get exit, if
you click ”yes”, it exits the program.
BACK END :
CONCLUSION:
Taking into account all the mentioned details, we can make the conclusion that
the hospital management system is the inevitable part of the lifecycle of the modern
medical institution.
It automates numerous daily operations and enables smooth interactions of the users.
Developing the hospital system software is a great opportunity to create the distinct,
efficient and fast delivering healthcare model.
Implementation of hospital management system project helps to store all the kinds of
records, provide coordination and user communication, implement policies, improve day-
to-day operations, arrange the supply chain, manage financial and human resources, and
market hospital services.
This beneficial decision covers the needs of the patients, staff and hospital authorities
and simplifies their interactions. It has become the usual approach to manage the
hospital. Many clinics have already experienced its advantages and continue developing
new hospital management system project modules.
The hospital system software is a great solution for any medical institution. It also saves
the time of the administrator.
This makes the system easy to handle and feasible for finding the omission with updating
at the same time.
If filed a query to search or update in a manual system, it will take a lot of time to process
the query and make a report which is a tedious job.
This computerized system store all the data in the database which makes it easy to fetch
and update whenever needed.
BIBILOGRAPHY:
Computer Science With Python by Sumita Arora for Class 11& 12
https://www.w3schools.com/PYTHON/PYTHON_MYSQL_
GETSTARTED.ASP – Python and MySQL Tutorial