Sie sind auf Seite 1von 28

A Project Report

on

Hospital management
system

Submitted By:
Name:RASHMI KUMARI
Class: XII B
Roll NO:14699645

Under the Guidance of


Mrs. Kusum Latha
PGT (informatics practices)
KendriyaVidyalaya No.1, new delhi
CERTIFICATE
This is to certify that Rashmi Kumari of class XII B, has
prepared the report on the project entitled
‘HOSPITAL MANAGEMENT SYSTEM’. The
report is the result of his effort and endeavors.
The report is found worthy of acceptance as
final project report for the subject of
INFORMATICS PRACTICES of class XII under
the CBSE curriculum 2019-20. He has
prepared the report under my guidance.

Kusum Latha
PGT(infromatics
parctices)
K. V. No-1,new delhi

EXTERNAL EXAMINER TEACHER IN CHARGE


Declaration

I hereby declare that the project work entitled ‘hospital


management System’ submitted to Department of
informatics practices, KV No-1 sadar bazaar, is
prepared by me. All the coding and Project report is
result of my personal effort.

Name: Rashmi Kumari


Class: XII-B
Roll No:14699645
Acknowledgement

I would like to express a deep sense of thanks &gratitude to


myproject guide Mrs. Kusum latha ma’am, for guiding me
immensely through thecourse of the project. He always evinced
keen interest in my work. Hisconstructive advice &constant
motivation have been responsible for thesuccessful completion
of this project.
My sincere thanks go to Mr. P.Naidu ,Our principal Sir,
for hisco-ordination in extending every possible support and IT
infrastructure for the completion ofthis project.
Ialso thanks to my parents for their motivation &support.
Imustthanks to my classmates for their timely help &support for
compilationof this project.
Last but not the least, I would like to thank all those who
hadhelped directly or indirectly towards the completion of this
project.

Name:rashmi kumari
Class:XII-B
General Overview of the Problem

A hospital is a health care institution


providing patient treatment with specialized medical
and nursing staff and medical equipment.[1] The
best-known type of hospital is the general hospital,
which typically has an emergency department to
treat urgent health problems ranging from fire and
accident victims to a sudden illness. A district
hospital typically is the major health care facility in
its region, with many beds for intensive care and
additional beds for patients who need long-term care.
Specialized hospitals include trauma
centers, rehabilitation hospitals, children's hospitals,
seniors' (geriatric) hospitals, and hospitals for
dealing with specific medical needs such
as psychiatric treatment (see psychiatric hospital)
and certain disease categories. Specialized hospitals
can help reduce health care costs compared to
general hospitals.[2] Hospitals are classified as
general, specialty, or government depending on the
sources of income received.
As the generation is becoming more advanced
everything is being done on technological level and
therefore the need for hospitals online is increasing
and doing things in advanced should become easy
for patients as there are problems comes within while
waiting in line and making normal appointment
OBJECTIVE OF PROJECT
The project that we have undertaken aims to develop a
hospital managing system that is clean, user-friendly and multi-
functional. Development of this application includes a number
offields such that user feels comfortable and the systemappears
as dynamic to him.
The project "hospital management system" includes the
followingfunctionalities:
 Appointments can be fixed by filling only a single interface
page
 All appointment and updates are stored in database created
in mySQL.
 If patients want any updation or deletion it can be done and
stored
 Customer can register themselves online and can edit their
profile..
REQUIREMENT AND ANALYSIS

The application ‘hospital management system’ being a small,

portable and having good GUI, A computer system should

have the combination of following hardware and software-

1. Hardware Requirement:

 intel I3 Processor

 Minimum 2 GB RAM

 Atleast 500GB HDD

2. Software Requirement:

 Windows 7/8/10 OS

 Python 3.X IDLE

 Mysql

 Tkinter module
A Brief Introduction of Python

Python is a widely used general-purpose, high-level


programming language. It was initially designed by Guido van
Rossum in 1991 and developed by Python Software Foundation.
It was mainly developed for emphasis on code readability, and
its syntax allows programmers to express concepts in fewer lines
of code.
 Python laid its foundation in the late 1980s.
 The implementation of Python was started in the
December 1989 by Guido Van Rossum at CWI in
Netherland.
 In 1994, Python 1.0 was released with new features
like: lambda, map, filter, and reduce.
 Python 2.0 added new features like: list
comprehensions, garbage collection system.
 On December 3, 2008, Python 3.0 (also called
"Py3K") was released. It was designed to rectify
fundamental flaw of the language.
 ABC programming language is said to be the
predecessor of Python language which was capable of
Exception Handling and interfacing with Amoeba
Operating System.
 Python is influenced by following programming
languages:
 ABC language.
 Modula-3
A Brief Introduction of MySQL

MySQL was created by a Swedish company, MySQL AB, founded by


David Axmark, Allan Larsson and Michael "Monty" Widenius in 1995.
MySQL Features:

o Relational Database Management System (RDBMS): MySQL is a


relational database management system.
o Easy to use: MySQL is easy to use. You have to get only the basic
knowledge of SQL. You can build and interact with MySQL with only
a few simple SQL statements.
o It is secure: MySQL consist of a solid data security layer that
protects sensitive data from intruders. Passwords are encrypted in
MySQL.
o Client/ Server Architecture: MySQL follows a client /server
architecture. There is a database server (MySQL) and arbitrarily
many clients (application programs), which communicate with the
server; that is, they query data, save changes, etc.
o Free to download: MySQL is free to use and you can download it
from MySQL official website.
o It is scalable: MySQL can handle almost any amount of data, up to
as much as 50 million rows or more. The default file size limit is about
4 GB. However, you can increase this number to a theoretical limit of
8 TB of data.
o Compatible on many operating systems: MySQL is compatible to
run on many operating systems, like Novell NetWare, Windows*
Linux*, many varieties of UNIX* (such as Sun* Solaris*, AIX, and
DEC* UNIX), OS/2, FreeBSD*, and others. MySQL also provides a
facility that the clients can run on the same computer as the server or
on another computer (communication via a local network or the
Internet).
o Allows roll-back: MySQL allows transactions to be rolled back,
commit and crash recovery.
o High Performance: MySQL is faster, more reliable and cheaper
because of its unique storage engine architecture.
o High Flexibility: MySQL supports a large number of embedded
applications which makes MySQL very flexible.
o High Productivity: MySQL uses Triggers, Stored procedures and
views which allows the developer to give a higher productivity.
A Brief Introduction tkinter module

Graphical User Interface (GUI) is nothing but a desktop application which


helps you to interact with the computers. They are used to perform different
tasks in the desktops, laptops and other electronic devices.

 GUI apps like Text-Editors are used to create, read, update and
delete different types of files.

 GUI apps like Sudoku, Chess and Solitaire are games which you can
play.

 GUI apps like Google Chrome, Firefox and Microsoft Edge are
used to browse through the Internet.

They are some different types of GUI apps which we daily use on the
laptops or desktops.

Python has a plethora of libraries and these 4 stands out mainly when it
comes to GUI. There are as follows:

 Kivy
 Python QT
 wxPython
 Tkinter
 Pyttsx3

Tkinter is actually an inbuilt Python module used to create


simple GUI apps. It is the most commonly used module for GUI apps in
the Python.
Python Coding
DISPLAY

from tkinter import *


import sqlite3
import tkinter.messagebox
# connect to the databse.
conn = sqlite3.connect('database.db')
# cursor to move around the databse
c = conn.cursor()

# empty list to later append the ids from the database


ids = []

# tkinter window
class Application:
def __init__(self, master):
self.master = master

# creating the frames in the master


self.left = Frame(master, width=800, height=720, bg='lightgreen')
self.left.pack(side=LEFT)

self.right = Frame(master, width=400, height=720, bg='steelblue')


self.right.pack(side=RIGHT)

# labels for the window


self.heading = Label(self.left, text="ABC Hospital Appointments",
font=('arial 40 bold'), fg='black', bg='lightgreen')
self.heading.place(x=0, y=0)
# patients name
self.name = Label(self.left, text="Patient's Name", font=('arial 18 bold'),
fg='black', bg='lightgreen')
self.name.place(x=0, y=100)
# age
self.age = Label(self.left, text="Age", font=('arial 18 bold'), fg='black',
bg='lightgreen')
self.age.place(x=0, y=140)
# gender
self.gender = Label(self.left, text="Gender", font=('arial 18 bold'),
fg='black', bg='lightgreen')
self.gender.place(x=0, y=180)

# location
self.location = Label(self.left, text="Location", font=('arial 18 bold'),
fg='black', bg='lightgreen')
self.location.place(x=0, y=220)

# appointment time
self.time = Label(self.left, text="Appointment Time", font=('arial 18
bold'), fg='black', bg='lightgreen')
self.time.place(x=0, y=260)

# phone
self.phone = Label(self.left, text="Phone Number", font=('arial 18
bold'), fg='black', bg='lightgreen')
self.phone.place(x=0, y=300)

# Entries for all


labels==================================================
==========
self.name_ent = Entry(self.left, width=30)
self.name_ent.place(x=250, y=100)

self.age_ent = Entry(self.left, width=30)


self.age_ent.place(x=250, y=140)

self.gender_ent = Entry(self.left, width=30)


self.gender_ent.place(x=250, y=180)

self.location_ent = Entry(self.left, width=30)


self.location_ent.place(x=250, y=220)

self.time_ent = Entry(self.left, width=30)


self.time_ent.place(x=250, y=260)

self.phone_ent = Entry(self.left, width=30)


self.phone_ent.place(x=250, y=300)

# button to perform a command


self.submit = Button(self.left, text="Add Appointment", width=20,
height=2, bg='steelblue', command=self.add_appointment)
self.submit.place(x=300, y=340)

# getting the number of appointments fixed to view in the log


sql2 = "SELECT ID FROM appointments "
self.result = c.execute(sql2)
for self.row in self.result:
self.id = self.row[0]
ids.append(self.id)

# ordering the ids


self.new = sorted(ids)
self.final_id = self.new[len(ids)-1]
# displaying the logs in our right frame
self.logs = Label(self.right, text="Logs", font=('arial 28 bold'),
fg='white', bg='steelblue')
self.logs.place(x=0, y=0)

self.box = Text(self.right, width=50, height=40)


self.box.place(x=20, y=60)
self.box.insert(END, "Total Appointments till now : " +
str(self.final_id))
# funtion to call when the submit button is clicked
def add_appointment(self):
# getting the user inputs
self.val1 = self.name_ent.get()
self.val2 = self.age_ent.get()
self.val3 = self.gender_ent.get()
self.val4 = self.location_ent.get()
self.val5 = self.time_ent.get()
self.val6 = self.phone_ent.get()

# checking if the user input is empty


if self.val1 == '' or self.val2 == '' or self.val3 == '' or self.val4 == '' or
self.val5 == '':
tkinter.messagebox.showinfo("Warning", "Please Fill Up All Boxes")
else:
# now we add to the database
sql = "INSERT INTO 'appointments' (name, age, gender, location,
scheduled_time, phone) VALUES(?, ?, ?, ?, ?, ?)"
c.execute(sql, (self.val1, self.val2, self.val3, self.val4, self.val5,
self.val6))
conn.commit()
tkinter.messagebox.showinfo("Success", "Appointment for "
+str(self.val1) + " has been created" )

self.box.insert(END, 'Appointment fixed for ' + str(self.val1) + ' at ' +


str(self.val5))

# creating the object


root = Tk()
b = Application(root)

# resolution of the window


root.geometry("1200x720+0+0")

# preventing the resize feature


root.resizable(False, False)

# end the loop


root.mainloop()
APPOINTEMENT
from tkinter import *
import sqlite3

# connection to database
conn = sqlite3.connect('database.db')
c = conn.cursor()

# empty lists to append later


number = []
patients = []

sql = "SELECT * FROM appointments"


res = c.execute(sql)
for r in res:
ids = r[0]
name = r[1]
number.append(ids)
patients.append(name)

# window
class Application:
def __init__(self, master):
self.master = master

self.x = 0

# heading
self.heading = Label(master, text="Appointments", font=('arial 60
bold'), fg='green')
self.heading.place(x=350, y=0)

# button to change patients


self.change = Button(master, text="Next Patient", width=25, height=2,
bg='steelblue', command=self.func)
self.change.place(x=500, y=600)

# empty text labels to later config


self.n = Label(master, text="", font=('arial 200 bold'))
self.n.place(x=500, y=100)

self.pname = Label(master, text="", font=('arial 80 bold'))


self.pname.place(x=300, y=400)
# function to speak the text and update the text
def func(self):
self.n.config(text=str(number[self.x]))
self.pname.config(text=str(patients[self.x]))
engine = pyttsx3.init()
voices = engine.getProperty('voices')
rate = engine.getProperty('rate')
engine.setProperty('rate', rate-50)
engine.say('Patient number ' + str(number[self.x]) +
str(patients[self.x]))
engine.runAndWait()
self.x += 1
root = Tk()
b = Application(root)
root.geometry("1366x768+0+0")
root.resizable(False, False)
root.mainloop()
UPDATE

from tkinter import *


import tkinter.messagebox
import sqlite3

conn = sqlite3.connect('database.db')
c = conn.cursor()

class Application:
def __init__(self, master):
self.master = master
# heading label
self.heading = Label(master, text="Update Appointments",
fg='steelblue', font=('arial 40 bold'))
self.heading.place(x=150, y=0)

# search criteria -->name


self.name = Label(master, text="Enter Patient's Name", font=('arial 18
bold'))
self.name.place(x=0, y=60)

# entry for the name


self.namenet = Entry(master, width=30)
self.namenet.place(x=280, y=62)

# search button
self.search = Button(master, text="Search", width=12, height=1,
bg='steelblue', command=self.search_db)
self.search.place(x=350, y=102)
# function to search
def search_db(self):
self.input = self.namenet.get()
# execute sql

sql = "SELECT * FROM appointments WHERE name LIKE ?"


self.res = c.execute(sql, (self.input,))
for self.row in self.res:
self.name1 = self.row[1]
self.age = self.row[2]
self.gender = self.row[3]
self.location = self.row[4]
self.time = self.row[6]
self.phone = self.row[5]
# creating the update form
self.uname = Label(self.master, text="Patient's Name", font=('arial 18
bold'))
self.uname.place(x=0, y=140)

self.uage = Label(self.master, text="Age", font=('arial 18 bold'))


self.uage.place(x=0, y=180)

self.ugender = Label(self.master, text="Gender", font=('arial 18 bold'))


self.ugender.place(x=0, y=220)

self.ulocation = Label(self.master, text="Location", font=('arial 18


bold'))
self.ulocation.place(x=0, y=260)

self.utime = Label(self.master, text="Appointment Time", font=('arial


18 bold'))
self.utime.place(x=0, y=300)

self.uphone = Label(self.master, text="Phone Number", font=('arial 18


bold'))
self.uphone.place(x=0, y=340)

# entries for each


labels====================================================
======
# ===================filling the search result in the entry box to
update
self.ent1 = Entry(self.master, width=30)
self.ent1.place(x=300, y=140)
self.ent1.insert(END, str(self.name1))
self.ent2 = Entry(self.master, width=30)
self.ent2.place(x=300, y=180)
self.ent2.insert(END, str(self.age))

self.ent3 = Entry(self.master, width=30)


self.ent3.place(x=300, y=220)
self.ent3.insert(END, str(self.gender))

self.ent4 = Entry(self.master, width=30)


self.ent4.place(x=300, y=260)
self.ent4.insert(END, str(self.location))

self.ent5 = Entry(self.master, width=30)


self.ent5.place(x=300, y=300)
self.ent5.insert(END, str(self.time))

self.ent6 = Entry(self.master, width=30)


self.ent6.place(x=300, y=340)
self.ent6.insert(END, str(self.phone))

# button to execute update


self.update = Button(self.master, text="Update", width=20, height=2,
bg='lightblue', command=self.update_db)
self.update.place(x=400, y=380)

# button to delete
self.delete = Button(self.master, text="Delete", width=20, height=2,
bg='red', command=self.delete_db)
self.delete.place(x=150, y=380)
def update_db(self):
# declaring the variables to update
self.var1 = self.ent1.get() #updated name
self.var2 = self.ent2.get() #updated age
self.var3 = self.ent3.get() #updated gender
self.var4 = self.ent4.get() #updated location
self.var5 = self.ent5.get() #updated phone
self.var6 = self.ent6.get() #updated time
query = "UPDATE appointments SET name=?, age=?, gender=?,
location=?, phone=?, scheduled_time=? WHERE name LIKE ?"
c.execute(query, (self.var1, self.var2, self.var3, self.var4, self.var5,
self.var6, self.namenet.get(),))
conn.commit()
tkinter.messagebox.showinfo("Updated", "Successfully Updated.")
def delete_db(self):
# delete the appointment
sql2 = "DELETE FROM appointments WHERE name LIKE ?"
c.execute(sql2, (self.namenet.get(),))
conn.commit()
tkinter.messagebox.showinfo("Success", "Deleted Successfully")
self.ent1.destroy()
self.ent2.destroy()
self.ent3.destroy()
self.ent4.destroy()
self.ent5.destroy()
self.ent6.destroy()
# creating the object
root = Tk()
b = Application(root)
root.geometry("1200x720+0+0")
root.resizable(False, False)
root.mainloop()
OUTPUT SCREEN
Limitations of Project and Future implementation

Objective of the project was simple coding. Being a simple coding application has
some limitations-
LOGIN: as there will be no personal page for the patients for past details and
billing enquiry
EXTENSION OF MODULES: Due to small code limited modules has been
implemented. In future some more modules can be integrated like-
DEPARTMENTS: it is a small project and cannot provide every department
appointment or doctor information
SECURITY: security problems can occur in the absence of security function and
can result into the false results or error prone results
Bibliography

The following books and websites have been referred during project
development-

Text Book: Computer Science with python by Sumita Arora

Websites:

 https://www.w3schools.com

 https://infocode.org

 https:// https://github.com

Das könnte Ihnen auch gefallen