VELAMMAL VIDHYASHRAM
GUDUVANCHERY
COMPUTER SCIENCE
PATIENT INFORMATION
ACADEMIC YEAR 2024 - 25
Done By:
SHREEYAN KUMAR K S
XII D
BONAFIDE CERTIFICATE
This is to certify that this COMPUTER SCIENCE project on the topic
PATIENT INFORMATION has been successfully completed by
SHREEYAN KUMAR K S of class XII Roll.no……………………... at
Velammal Vidhyashram, Guduvanchery, for the partial fulfilment
of this project as a part of All India Senior School Certificate
Examination- CBSE, New Delhi for the academic Year 2024 - 2025.
Date: ……………………..
Signature of Principal Signature of the Guide
Signature of the Signature of the
Internal Examiner External Examiner
ACKNOWLEDGEMENT
I wish to express my deep gratitude and sincere thanks to the
Senior Principal, Velammal Vidhyashram, Guduvanchery for
the encouragement given to me and for all the facilities that she
provided for this project work.
I sincerely appreciate this magnanimity by taking me into his
fold for which I shall remain indebted to him.
I extend my hearty thanks to Ms PADMA POORANI M
Computer Science Teacher, who guided me to successfully
complete this project.
I take this opportunity to express my deep gratitude for her
valuable guidance, constant encouragement, and immense
motivation, which sustained my efforts at all stages of this
project work.
I would like to thank my lab assistant, a lab in charge, and
technical staff for providing correct information which makes the
completion of this project work in an excellent way.
I cannot forget to offer my sincere thanks to my parents, and,
also to my classmates who helped me to carry out this project
work successfully and for their valuable advice and support,
which received from them from time to time.
TABLE OF CONTENT
1. ABSTRACT
2. INTRODUCTION
3. FEATURES
4. SYSTEM COVERS FOLLOWING THINGS
PYTHON
MYSQL
5. SOURCE CODE - PATIENT DATABASE
6. OUTPUT (SCREENSHOT)
7. SYSTEM REQUIREMENT
8. CONCLUSION
9. BIBLIOGRAPHY
ABSTRACT
New technologies have improved the ability of electronically
storing, transferring and sharing medical data also changed. At the
same time, they also create serious questions about who has access to
this information and how they are protected. The aim of PIS is to store the
detailed information about the Patient like treatment details, date of joining
and allocated doctor. The major modules in this system are allocating the
bed, allocating the doctor to the patient.
INTRODUCTION
This software can be used to keep track of the patients registering in a
hospital or clinic also, this system supports accessing the previous visit
histories of any patient, search for patients by name and other properties
etc. This system involves three people's patient, doctor and receptionist. It is
useful to know the details of consulted doctor details and status of patient
who is undergoing treatment under this doctor. To know the treatment
details provided by the doctor.
Patient has registered with the system automatically admitted into the
hospital. After login we can know the patient details by patient id. Then they
come to know the patient status by doctor and bed.
And third and most important member in this system is Receptionist. He is
the administrator of the system. He/she can add or delete the doctor and
bed. He allocates the bed and doctor to the patient. And also he edits and
updates the details of the doctor and bed in the system
FEATURES
This is totally intranet based system. It maintains the records of patients
from starting.
Knowing the patient details and patient status.
To know the type of treatment he/she undergoing.
To know the consulted doctor details, his/her visiting hours.
To know the information about the doctors included and deleted.
It allows adding/editing patient registration.
To know the total list of beds available.
To view the case sheet of patient and details of doctor and bed.
Knowing the previous histories of patients.
To know the patient status by doctor and bed.
To know the details doctors are in the floor.
Allocation details of doctors and beds
SYSTEM COVERS FOLLOWING THINGS
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 back
ported 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, mac OS, 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:
A Database Management System (DBMS) is a software application that
interacts with the user, applications and the database itself to capture and
analyze data. The data stored in the database can be modified, retrieved and
deleted, and can be of any type like strings, numbers, images etc.
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.
Structured Query Language (SQL)
SQL is the core of a relational database which is used for accessing and
managing the database. By using SQL, you can add, update or delete rows of
data, retrieve subsets of information, modify databases and perform many
actions. The different subsets of SQL are as follows:
● DDL (Data Definition Language) –It allows you to perform various
operations on the database such as CREATE, ALTER and DELETE
objects.
● DML (Data Manipulation Language) – It allows you to access and
manipulate data. It helps you to insert, update, delete and retrieve data
from the database.
● DCL (Data Control Language)– It allows you to control access to the
database. Example – Grant or Revoke access permissions.
● TCL(Transaction Control Language) – It allows you to deal with the
transaction of the database. Example – Commit, Rollback, Savepoint, Set
Transaction.
MySQL & its Features
MySQL is an open-source relational database management system that works
on many platforms. It provides multi-user access to supportmany storage
engines and is backed by Oracle. So,you can buy a commercial license version
from Oracle to get premium support services.
The features of MySQL are as follows:
Ease of Management –The software very easily gets downloaded and also
uses an event scheduler to schedule the tasks automatically.
● Robust Transactional Support –Holds the ACID (Atomicity,
Consistency, Isolation, Durability) property, and also allows distributed
multi-version support.
● Comprehensive Application Development –MySQL has plugin
libraries to embed the database into any application. It also supports
stored procedures, triggers, functions, views and many more for
application development. You can refer to the RDS Tutorial, to
understand Amazon’s RDBMS.
● High Performance –Provides fast load utilities with distinct memory
caches and table index partitioning.
● Low Total Cost Of Ownership –This reduces licensing costs and
hardware expenditures.
● Open Source & 24 * 7 Support –This RDBMS can be used on any
platform and offers 24*7 supports for open source and enterprise
edition. Secure Data Protection –MySQL supports powerful
mechanisms to ensure that only authorized users have access to the
databases.
● High Availability –MySQL can run high speed master/slave replication
configurations and it offers cluster servers.
● Scalability & Flexibility –With MySQL you can run deeply embedded
applications and create data warehouses holding a humongous amount
of data.
MySQL Data Types
● Numeric – This data type includes integers of various sizes, floating
point(real) of various precisions and formatted numbers.
● Character-string – These data types either have a fixed, or a varying
number of characters. This data type also has a variable-length string
called CHARACTER LARGE OBJECT (CLOB) which is used to specify
columns that have large text values.
● Bit-string – These data types are either of a fixed length or varying
length of bits. There is also a variable-length bit string data type called
BINARY LARGE OBJECT(BLOB), which is available to specify columns
that have large binary values, such as images.
● Boolean –This data type has TRUE or FALSE values. Since SQL, has
NULL values, a three-valued logic is used, which is UNKNOWN.
● Date & Time –The DATE data type has: YEAR, MONTH, and DAY in the
form YYYY-MM-DD. Similarly, the TIME data type has the components
HOUR, MINUTE, and SECOND in the form HH:MM: SS. These formats can
change based on the requirement.
● Timestamp & Interval –The TIMESTAMP data type includes a
minimum of six positions, for decimal fractions of seconds and an
optional WITH TIME ZONE qualifier in addition to the DATE and TIME
fields. The INTERVAL data type mentions a relative value that can be
used to increment or decrement an absolute value of a date, time, or
timestamp.
Python MySQL Database Connection:
Arguments required to connect MySQL from Python
You need to know the following detail of the MySQL server to perform the
connection from Python.
● Username – i.e., the username that you use to work with MySQL Server.
The default username for the MySQL database is a root
● Password – Password is given by the user at the time of installing the
MySQL database. If you are using root then you won’t need the
password.
● Host Name – is the server name or Ip address on which MySQL is
running. if you are running on localhost, then you can use localhost, or
it’s IP, i.e. 127.0.0.0
● Database Name – Database name to which you want to connect.
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
3. Python with required parameters to connect MySQL.
4. Use the connection object returned by a connect()method to create a
cursor object to perform Database Operations.
5. The cursor.execute()to execute SQL queries from Python.
6. Close the Cursor object using a cursor.close() and MySQL database
connection using connection.close() after your work completes.
7. Catch Exception if any that may occur during this process.
SOURCE CODE
import tkinter
import tkinter.ttk
import tkinter.messagebox
import sqlite3
import mysql.connector
class Database:
def __init__(self):
self.dbConnection = sqlite3.connect("dbFile.db")
self.dbCursor = self.dbConnection.cursor()
self.dbCursor.execute("CREATE TABLE IF NOT EXISTS patient_info
(id PRIMARYKEY text, fName text, lName text, dob text, mob text, yob
text, gender text, address text, phone text, email text, bloodGroup
text, history text, doctor text)")
def __del__(self):
self.dbCursor.close()
self.dbConnection.close()
def Insert(self, id, fName, lName, dob, mob, yob, gender, address, phone,
email, bloodGroup, history, doctor):
self.dbCursor.execute("INSERT INTO patient_info VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?)", (id, fName, lName, dob, mob, yob, gender, address, phone, email,
bloodGroup, history, doctor))
self.dbConnection.commit()
def Update(self, fName, lName, dob, mob, yob, gender, address, phone, email,
bloodGroup, history, doctor, id):
self.dbCursor.execute("UPDATE patient_info SET fName = ?, lName = ?, dob =
?, mob = ?, yob = ?, gender = ?, address = ?, phone = ?, email = ?, bloodGroup
= ?, history = ?, doctor = ? WHERE id = ?", (fName, lName, dob, mob, yob,
gender, address, phone, email, bloodGroup, history, doctor, id))
self.dbConnection.commit()
def Search(self, id):
self.dbCursor.execute("SELECT * FROM patient_info WHERE id =
?", (id, ))
searchResults = self.dbCursor.fetchall()
return searchResults
def Delete(self, id):
self.dbCursor.execute("DELETE FROM patient_info WHERE id = ?", (id, ))
self.dbConnection.commit()
def Display(self):
self.dbCursor.execute("SELECT * FROM patient_info") records =
self.dbCursor.fetchall()
return records
class Values:
def Validate(self, id, fName, lName, phone, email, history, doctor): if not
(id.isdigit() and (len(id) == 3)):
return "id"
elif not (fName.isalpha()):
return "fName"
elif not (lName.isalpha()):
return "lName"
elif not (phone.isdigit() and (len(phone) == 10)):
return "phone"
elif not (email.count("@") == 1 and email.count(".") > 0): return "email"
elif not (history.isalpha()):
return "history"
elif not (doctor.isalpha()):
return "doctor"
else:
return "SUCCESS"
class InsertWindow:
def __init__(self):
self.window = tkinter.Tk()
self.window.wm_title("Insert data")
# Initializing all the variables
self.id = tkinter.StringVar()
self.fName = tkinter.StringVar()
self.lName = tkinter.StringVar()
self.address = tkinter.StringVar()
self.phone = tkinter.StringVar()
self.email = tkinter.StringVar()
self.history = tkinter.StringVar()
self.doctor = tkinter.StringVar()
self.genderList = ["Male", "Female", "Transgender", "Other"] self.dateList =
list(range(1, 32))
self.monthList = ["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"]
self.yearList = list(range(1900, 2020))
self.bloodGroupList = ["A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"]
# Labels
tkinter.Label(self.window, text = "Patient ID", width = 25).grid(pady = 5,
column = 1, row = 1)
tkinter.Label(self.window, text = "First Name", width = 25).grid(pady = 5,
column = 1, row = 2)
tkinter.Label(self.window, text = "Last Name", width = 25).grid(pady = 5,
column = 1, row = 3)
tkinter.Label(self.window, text = "D.O.B", width = 25).grid(pady = 5, column
= 1, row = 4)
tkinter.Label(self.window, text = "M.O.B", width = 25).grid(pady = 5, column
= 1, row = 5)
tkinter.Label(self.window, text = "Y.O.B", width = 25).grid(pady = 5, column
= 1, row = 6)
tkinter.Label(self.window, text = "Gender", width = 25).grid(pady =
5, column = 1, row = 7)
tkinter.Label(self.window, text = "Home Address", width = 25).grid(pady = 5,
column = 1, row = 8)
tkinter.Label(self.window, text = "Phone Number", width = 25).grid(pady =
5, column = 1, row = 9)
tkinter.Label(self.window, text = "Email ID", width = 25).grid(pady =
5, column = 1, row = 10)
tkinter.Label(self.window, text = "Blood Group", width = 25).grid(pady = 5,
column = 1, row = 11)
tkinter.Label(self.window, text = "Patient History", width = 25).grid(pady =
5, column = 1, row = 12)
tkinter.Label(self.window, text = "Doctor", width = 25).grid(pady =
5, column = 1, row = 13)
# Fields
# Entry widgets
self.idEntry = tkinter.Entry(self.window, width = 25, textvariable = self.id)
self.fNameEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.fName)
self.lNameEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.lName)
self.addressEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.address)
self.phoneEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.phone)
self.emailEntry = tkinter.Entry(self.window, width = 25, textvariable
= self.email)
self.historyEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.history)
self.doctorEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.doctor)
self.idEntry.grid(pady = 5, column = 3, row = 1)
self.fNameEntry.grid(pady = 5, column = 3, row = 2)
self.lNameEntry.grid(pady = 5, column = 3, row = 3)
self.addressEntry.grid(pady = 5, column = 3, row = 8)
self.phoneEntry.grid(pady = 5, column = 3, row = 9)
self.emailEntry.grid(pady = 5, column = 3, row = 10)
self.historyEntry.grid(pady = 5, column = 3, row = 12)
self.doctorEntry.grid(pady = 5, column = 3, row = 13)
# Combobox widgets
self.dobBox = tkinter.ttk.Combobox(self.window, values =self.dateList, width
= 20)
self.mobBox = tkinter.ttk.Combobox(self.window, values = self.monthList,
width = 20)
self.yobBox = tkinter.ttk.Combobox(self.window, values =
self.yearList, width = 20)
self.genderBox = tkinter.ttk.Combobox(self.window, values = self.genderList,
width = 20)
self.bloodGroupBox = tkinter.ttk.Combobox(self.window, values
= self.bloodGroupList, width = 20)
self.dobBox.grid(pady = 5, column = 3, row = 4)
self.mobBox.grid(pady = 5, column = 3, row = 5)
self.yobBox.grid(pady = 5, column = 3, row = 6)
self.genderBox.grid(pady = 5, column = 3, row = 7)
self.bloodGroupBox.grid(pady = 5, column = 3, row = 11)
# Button widgets
tkinter.Button(self.window, width = 20, text = "Insert", command
= self.Insert).grid(pady = 15, padx = 5, column = 1, row = 14)
tkinter.Button(self.window, width = 20, text = "Reset", command
= self.Reset).grid(pady = 15, padx = 5, column = 2, row = 14)
self.window.mainloop()
def Insert(self):
self.values = Values()
self.database = Database()
self.test = self.values.Validate(self.idEntry.get(),
self.fNameEntry.get(), self.lNameEntry.get(), self.phoneEntry.get(),
self.emailEntry.get(), self.historyEntry.get(), self.doctorEntry.get())
if (self.test == "SUCCESS"):
self.database.Insert(self.idEntry.get(),
self.fNameEntry.get(), self.lNameEntry.get(), self.dobBox.get(),
self.mobBox.get(), self.yobBox.get(), self.genderBox.get(),
self.addressEntry.get(), self.phoneEntry.get(), self.emailEntry.get(),
self.bloodGroupBox.get(), self.historyEntry.get(), self.doctorEntry.get())
tkinter.messagebox.showinfo("Inserted data", "Successfully inserted the
above data in the database")
else:
self.valueErrorMessage = "Invalid input in field " + self.test
tkinter.messagebox.showerror("Value Error", self.valueErrorMessage)
def Reset(self):
self.idEntry.delete(0, tkinter.END)
self.fNameEntry.delete(0, tkinter.END)
self.lNameEntry.delete(0, tkinter.END)
self.dobBox.set("")
self.mobBox.set("")
self.yobBox.set("")
self.genderBox.set("")
self.addressEntry.delete(0, tkinter.END)
self.phoneEntry.delete(0, tkinter.END)
self.emailEntry.delete(0, tkinter.END)
self.bloodGroupBox.set("")
self.historyEntry.delete(0, tkinter.END)
self.doctorEntry.delete(0, tkinter.END)
class UpdateWindow:
def __init__(self, id):
self.window = tkinter.Tk()
self.window.wm_title("Update data")
# Initializing all the variables
self.id = id
self.fName = tkinter.StringVar()
self.lName = tkinter.StringVar()
self.address = tkinter.StringVar()
self.phone = tkinter.StringVar()
self.email = tkinter.StringVar()
self.history = tkinter.StringVar()
self.doctor = tkinter.StringVar()
self.genderList = ["Male", "Female", "Transgender", "Other"] self.dateList =
list(range(1, 32))
self.monthList = ["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"]
self.yearList = list(range(1900, 2020))
self.bloodGroupList = ["A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"]
# Labels
tkinter.Label(self.window, text = "Patient ID", width = 25).grid(pady = 5,
column = 1, row = 1)
tkinter.Label(self.window, text = id, width = 25).grid(pady = 5, column = 3,
row = 1)
tkinter.Label(self.window, text = "First Name", width = 25).grid(pady = 5,
column = 1, row = 2)
tkinter.Label(self.window, text = "Last Name", width = 25).grid(pady = 5,
column = 1, row = 3)
tkinter.Label(self.window, text = "D.O.B", width = 25).grid(pady = 5, column
= 1, row = 4)
tkinter.Label(self.window, text = "M.O.B", width = 25).grid(pady = 5, column
= 1, row = 5)
tkinter.Label(self.window, text = "Y.O.B", width = 25).grid(pady = 5, column
= 1, row = 6)
tkinter.Label(self.window, text = "Gender", width = 25).grid(pady =
5, column = 1, row = 7)
tkinter.Label(self.window, text = "Home Address", width = 25).grid(pady = 5,
column = 1, row = 8)
tkinter.Label(self.window, text = "Phone Number", width = 25).grid(pady =
5, column = 1, row = 9)
tkinter.Label(self.window, text = "Email ID", width = 25).grid(pady =
5, column = 1, row = 10)
tkinter.Label(self.window, text = "Blood Group", width = 25).grid(pady = 5,
column = 1, row = 11)
tkinter.Label(self.window, text = "Patient History", width = 25).grid(pady =
5, column = 1, row = 12)
tkinter.Label(self.window, text = "Doctor", width = 25).grid(pady =
5, column = 1, row = 13)
# Set previous values
self.database = Database()
self.searchResults = self.database.Search(id)
tkinter.Label(self.window, text = self.searchResults[0][1], width
= 25).grid(pady = 5, column = 2, row = 2)
tkinter.Label(self.window, text = self.searchResults[0][2], width
= 25).grid(pady = 5, column = 2, row = 3)
tkinter.Label(self.window, text = self.searchResults[0][3], width
= 25).grid(pady = 5, column = 2, row = 4)
tkinter.Label(self.window, text = self.searchResults[0][4], width
= 25).grid(pady = 5, column = 2, row = 5)
tkinter.Label(self.window, text = self.searchResults[0][5], width
= 25).grid(pady = 5, column = 2, row = 6)
tkinter.Label(self.window, text = self.searchResults[0][6], width
= 25).grid(pady = 5, column = 2, row = 7)
tkinter.Label(self.window, text = self.searchResults[0][7], width
= 25).grid(pady = 5, column = 2, row = 8)
tkinter.Label(self.window, text = self.searchResults[0][8], width
= 25).grid(pady = 5, column = 2, row = 9)
tkinter.Label(self.window, text = self.searchResults[0][9], width
= 25).grid(pady = 5, column = 2, row = 10)
tkinter.Label(self.window, text = self.searchResults[0][10], width
= 25).grid(pady = 5, column = 2, row = 11)
tkinter.Label(self.window, text = self.searchResults[0][11], width
= 25).grid(pady = 5, column = 2, row = 12)
tkinter.Label(self.window, text = self.searchResults[0][12], width
= 25).grid(pady = 5, column = 2, row = 13)
# Fields
# Entry widgets
self.fNameEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.fName)
self.lNameEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.lName)
self.addressEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.address)
self.phoneEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.phone)
self.emailEntry = tkinter.Entry(self.window, width = 25, textvariable
= self.email)
self.historyEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.history)
self.doctorEntry = tkinter.Entry(self.window, width = 25, textvariable =
self.doctor)
self.fNameEntry.grid(pady = 5, column = 3, row = 2)
self.lNameEntry.grid(pady = 5, column = 3, row = 3)
self.addressEntry.grid(pady = 5, column = 3, row = 8)
self.phoneEntry.grid(pady = 5, column = 3, row = 9)
self.emailEntry.grid(pady = 5, column = 3, row = 10)
self.historyEntry.grid(pady = 5, column = 3, row = 12)
self.doctorEntry.grid(pady = 5, column = 3, row = 13)
# Combobox widgets
self.dobBox = tkinter.ttk.Combobox(self.window, values =
self.dateList, width = 20)
self.mobBox = tkinter.ttk.Combobox(self.window, values = self.monthList,
width = 20)
self.yobBox = tkinter.ttk.Combobox(self.window, values =
self.yearList, width = 20)
self.genderBox = tkinter.ttk.Combobox(self.window, values = self.genderList,
width = 20)
self.bloodGroupBox = tkinter.ttk.Combobox(self.window, values
= self.bloodGroupList, width = 20)
self.dobBox.grid(pady = 5, column = 3, row = 4)
self.mobBox.grid(pady = 5, column = 3, row = 5)
self.yobBox.grid(pady = 5, column = 3, row = 6)
self.genderBox.grid(pady = 5, column = 3, row = 7)
self.bloodGroupBox.grid(pady = 5, column = 3, row = 11)
# Button widgets
tkinter.Button(self.window, width = 20, text = "Update", command
= self.Update).grid(pady = 15, padx = 5, column = 1, row = 14)
tkinter.Button(self.window, width = 20, text = "Reset", command
= self.Reset).grid(pady = 15, padx = 5, column = 2, row = 14)
tkinter.Button(self.window, width = 20, text = "Close", command
= self.window.destroy).grid(pady = 15, padx = 5, column = 3, row = 14)
self.window.mainloop()
def Update(self):
self.database = Database()
self.database.Update(self.fNameEntry.get(),
self.lNameEntry.get(), self.dobBox.get(), self.mobBox.get(),
self.yobBox.get(), self.genderBox.get(), self.addressEntry.get(),
self.phoneEntry.get(), self.emailEntry.get(), self.bloodGroupBox.get(),
self.historyEntry.get(), self.doctorEntry.get(), self.id)
tkinter.messagebox.showinfo("Updated data", "Successfully updated the
above data in the database")
def Reset(self):
self.fNameEntry.delete(0, tkinter.END)
self.lNameEntry.delete(0, tkinter.END)
self.dobBox.set("")
self.mobBox.set("")
self.yobBox.set("")
self.genderBox.set("")
self.addressEntry.delete(0, tkinter.END)
self.phoneEntry.delete(0, tkinter.END)
self.emailEntry.delete(0, tkinter.END)
self.bloodGroupBox.set("")
self.historyEntry.delete(0, tkinter.END)
self.doctorEntry.delete(0, tkinter.END)
class DatabaseView:
def __init__(self, data):
self.databaseViewWindow = tkinter.Tk()
self.databaseViewWindow.wm_title("Database View")
# Label widgets
tkinter.Label(self.databaseViewWindow, text = "Database View Window",
width = 25).grid(pady = 5, column = 1, row = 1)
self.databaseView=tkinter.ttk.Treeview(self.databaseViewWindow)
self.databaseView.grid(pady = 5, column = 1, row = 2)
self.databaseView["show"] = "headings"
self.databaseView["columns"] = ("id", "fName", "lName", "dob",
"mob", "yob", "gender", "address", "phone", "email", "bloodGroup",
"history", "doctor")
# Treeview column headings
self.databaseView.heading("id", text = "ID")
self.databaseView.heading("fName", text = "First Name")
self.databaseView.heading("lName", text = "Last Name")
self.databaseView.heading("dob", text = "D.O.B")
self.databaseView.heading("mob", text = "M.O.B")
self.databaseView.heading("yob", text = "Y.O.B")
self.databaseView.heading("gender", text = "Gender")
self.databaseView.heading("address", text = "Home Address")
self.databaseView.heading("phone", text = "Phone Number")
self.databaseView.heading("email", text = "Email ID")
self.databaseView.heading("bloodGroup", text = "Blood Group")
self.databaseView.heading("history", text = "History")
self.databaseView.heading("doctor", text = "Doctor")
# Treeview columns
self.databaseView.column("id", width = 40)
self.databaseView.column("fName", width = 100)
self.databaseView.column("lName", width = 100)
self.databaseView.column("dob", width = 60)
self.databaseView.column("mob", width = 60)
self.databaseView.column("yob", width = 60)
self.databaseView.column("gender", width = 60)
self.databaseView.column("address", width = 200)
self.databaseView.column("phone", width = 100)
self.databaseView.column("email", width = 200)
self.databaseView.column("bloodGroup", width = 100)
self.databaseView.column("history", width = 100)
self.databaseView.column("doctor", width = 100)
for record in data:
self.databaseView.insert('', 'end', values=(record))
self.databaseViewWindow.mainloop()
class SearchDeleteWindow:
def __init__(self, task):
window = tkinter.Tk()
window.wm_title(task + " data")
# Initializing all the variables
self.id = tkinter.StringVar()
self.fName = tkinter.StringVar()
self.lName = tkinter.StringVar()
self.heading = "Please enter Patient ID to " + task
# Labels
tkinter.Label(window, text = self.heading, width = 50).grid(pady = 20, row =
1)
tkinter.Label(window, text = "Patient ID", width = 10).grid(pady = 5, row =
2)
# Entry widgets
self.idEntry = tkinter.Entry(window, width = 5, textvariable = self.id)
self.idEntry.grid(pady = 5, row = 3)
# Button widgets
if (task == "Search"):
tkinter.Button(window, width = 20, text = task, command
= self.Search).grid(pady = 15, padx = 5, column = 1, row = 14)
elif (task == "Delete"):
tkinter.Button(window, width = 20, text = task, command
= self.Delete).grid(pady = 15, padx = 5, column = 1, row = 14)
def Search(self):
self.database = Database()
self.data = self.database.Search(self.idEntry.get())
self.databaseView = DatabaseView(self.data)
def Delete(self):
self.database = Database()
self.database.Delete(self.idEntry.get())
class HomePage:
def __init__(self):
self.homePageWindow = tkinter.Tk()
self.homePageWindow.wm_title("Patient Information System")
tkinter.Label(self.homePageWindow, text = "Home Page", width
= 100).grid(pady = 20, column = 1, row = 1)
tkinter.Button(self.homePageWindow, width = 20, text = "Insert", command
= self.Insert).grid(pady = 15, column = 1, row = 2)
tkinter.Button(self.homePageWindow, width = 20, text =
"Update", command = self.Update).grid(pady = 15, column = 1, row = 3)
tkinter.Button(self.homePageWindow, width = 20, text = "Search", command
= self.Search).grid(pady = 15, column = 1, row = 4)
tkinter.Button(self.homePageWindow, width = 20, text = "Delete", command
= self.Delete).grid(pady = 15, column = 1, row = 5)
tkinter.Button(self.homePageWindow, width = 20, text =
"Display", command = self.Display).grid(pady = 15, column = 1, row = 6)
tkinter.Button(self.homePageWindow, width = 20, text = "Exit", command =
self.homePageWindow.destroy).grid(pady = 15, column = 1, row = 7)
self.homePageWindow.mainloop()
def Insert(self):
self.insertWindow = InsertWindow()
def Update(self):
self.updateIDWindow = tkinter.Tk()
self.updateIDWindow.wm_title("Update data")
# Initializing all the variables
self.id = tkinter.StringVar()
# Label
tkinter.Label(self.updateIDWindow, text = "Enter the ID to update", width =
50).grid(pady = 20, row = 1)
# Entry widgets
self.idEntry = tkinter.Entry(self.updateIDWindow, width = 5, textvariable =
self.id)
self.idEntry.grid(pady = 10, row = 2)
# Button widgets
tkinter.Button(self.updateIDWindow, width = 20, text = "Update", command
= self.updateID).grid(pady = 10, row = 3)
self.updateIDWindow.mainloop()
def updateID(self):
self.updateWindow = UpdateWindow(self.idEntry.get())
self.updateIDWindow.destroy()
def Search(self):
self.searchWindow = SearchDeleteWindow("Search")
def Delete(self):
self.deleteWindow = SearchDeleteWindow("Delete")
def Display(self):
self.database = Database()
self.data = self.database.Display()
self.displayWindow = DatabaseView(self.data)
homePage = HomePage()
OUTPUT FOR THE HOME PAGE
OUTPUT FOR THE INSERTING INFO
OUTPUT FOR UPDATING DATABASE
OUTPUT FOR SEARCH IN DATABASE
OUTPUT FOR DELETE DATA
OUTPUT FOR DISPLAY DATA
SYSTEM REQUIREMENT
HARDWARE:
CPU: Intel Pentium P6200
Hard Disk: 500GB
RAM: 4GB
VDU: Video Display Adaptar
SOFTWARE:
Platform: Windows 7 and above
Programming Languages: Python, Mysql
CONCLUSION
It can be seen that deploying IT can help the medical profession
in improving its quality of service and thus automatically increasing
the preparedness and defensiveness. It is of vital importance that
the software must have the right type of modularity and openness so that it
is manageable, maintainable and upgradeable. The hardware should be
reliable, available and have the necessary performance capacity.
BIBLIOGRAPHY
1.TEXTBOOK
2. REFERENCE BOOK – Think Python
The complete reference - MySQL
3. ONLINE TUTORIALS- www.w3schools.com
www.tutorialspoints.com
www.python.org
4.ONLINE VISUAL REFERNCES- www.edureka.com
www.Udemy.com