Informatics Practices Project
Informatics Practices Project
AIM
Page No.
1
2
1.
2.
3.
4.
5.
6.
OVERVIEW OF PYTHON
SYNOPSIS
3
REQUIREMENTS
SOURCE CODE
OUTPUT
4
5-11
12-17
18
CONCLUSION
BIBLIOGRAPHY
7.
19
8.
AIM
To design a program that will result in a efficient
hospital management system. For the convenience of
doctors and nurses, the application also has features
specifically designed for them. With the aid of a
dataframe, we can also add and modify data. We also
want the user to be able to read and understand the
application even if they don't know the language.
Page 1
OVERVIEW OF PYTHON
Python is a general-purpose, interpreted programming
language. Python, which was developed by Guido van
Rossum and first made available in 1991,Python's design
philosophy emphasizes code readability with its notable
use of significant whitespace.Its language constructs and
object oriented approach aim to help programmers write
clear,logical code for small and large scale projects.
Python supports multiple programming paradigms,
including structured, object oriented and function
programming.
There are Python interpreters available for a variety of os.
The free and open source reference implementation
CPython is created and maintained by a large community
of programmers worldwide. The Python Software
Foundation, a nonprofit, manages and allocates resources
towards the development of Python and CPython.
Page 2
SYNOPSIS
Hospital Management System is a software system where
the management of the entire hospital is computerized.
The hospital management system is designed using
Python. In this project, the details are maintained for
faculty and patients.
The staff can modify the data for patients like describing
the patient’s ailment, prescribing medication and
discharging the patients. Patients can register themselves
without the help of a nurse and rate the service provided
by the hospital. This system will be interactive, faster and
user-friendly for the end users.
Built-in modules like Pandas and Matplotlib are used.
Pandas is used to create DataFrame to store all the
patients’, doctors’ and nurses’ data in the form of a table.
Matplotlib is used to create charts in Python with a given
set of data so that we can view the data in a structured
manner.
Page 3
REQUIREMENTS
We have used Spyder version 3.8 and 5
Modules used:
pandas - DataFrame
matplotlib.pyplot
json
Functions used:
while
for
if (elif)
input
list functions
dataframe functions
dictionary functions
plot
Page 4
SOURCE CODE
Pre Installed Data:
#Libraries
import pandas as pd
import matplotlib.pyplot as plt
exp=[]
while True:
d={}
#Dataframe for doctors
'DUserID':['O123','GM234','PD345','GP456'],'DPassword':['1234','hfsdf','sfvfb','efaedf']}
Dfd=pd.DataFrame(dd,index=['Arjun K','Radika V','Jose P','John S'])
#Dataframe for nurse
dn={'NDepartment':['Orthopedics','General Medicine','Paediatrics','General Practionior'],
'NUserID':['O100','GM230','PD335','GP356'],'Password':['eee12','whfbv','guffte','fvefve']}
Dfn=pd.DataFrame(dn,index=['Jack C','Rose J','Jain V','Merin B'])
#Dataframe for Patients
dp={'PDepartment':['Orthopedics','General Medicine','Paediatrics','General Practionior'],
'PHeight':[173,183,179,180],'PWeight':[63.5,73,81.05,59.7]}
Dfp=pd.DataFrame(dp,index=['Kashinath A','Abdul M','Rais M','Mohammed R'])
#Starting page
print('\t\t\t\t\t\t\t\t\tWelcome to Hospital')
print('\t\t\t\t\t\t\tIf you are staff, please use "doctor" or "nurse"')
print('\t\t\t\t\t\t\tUse "rp" if you are a new patient')
print('\t\t\t\t\t\t\tUse "rd" if you are a new doctor')
print('\t\t\t\t\t\t\tUse "rn" if you are a new nurse')
print('\t\t\t\t\t\tUse "rating" to rate your hospital experience')
print()
function=input("Enter the services you want: ")
Home
#Starting Page
print('\t\t\t\t\t\t\t\t\tWelcome to Hospital')
print('\t\t\t\t\t\t\tIf you are staff, please use "doctor" or "nurse"')
print('\t\t\t\t\t\t\tUse "rp" if you are a new patient')
print('\t\t\t\t\t\t\tUse "rd" if you are a new doctor')
print('\t\t\t\t\t\t\tUse "rn" if you are a new nurse')
print('\t\t\t\t\t\tUse "rating" to rate your hospital experience')
print()
function=input("Enter the services you want: ")
Page 5
Doctor
if function=="doctor":
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
user_name=input("Enter your UserID: ")
paswd=input("Enter your Password: ")
if user_name in Dfd.values:
if paswd in Dfd.values:
print("You have succesfully logged in Dr.")
con1=True
while con1:
option_d=int(input("Enter the services you want to provide\n1.Diagnosis
\n2.Medicines to be given to patient \n3.Discharge \n4. Exit doctor interface \nEnter just the
number: "))
if option_d==1:
print("You have chosen to give the diagnosis of the patient")
pa=input('Enter the patient name: ')
if pa in Dfp.index:
diag=input("Enter the diagnosed disease/ailment of the patient: ")
Dfp.loc[pa,'Ailment']=diag
print('Updated in dataframe')
print(Dfp.loc[pa,:])
else:
print('Patient',pa,'not found in the database')
elif option_d==2:
print("You have chosen to give the Medicines of the patient")
pa=input('Enter the patient name: ')
if pa in Dfp.index:
medi=input("Enter the name of medicines you have prescribed for the
patient: ")
Dfp.loc[pa,'Medicine']=medi
print('Updated in dataframe')
print(Dfp.loc[pa,:])
else:
print('Patient',pa,'not found in the database')
Page 6
elif option_d==3:
print("You have chosen to discharge a patient")
pa=input('Enter the patient name: ')
if pa in Dfp.index:
print('Removing patient',pa)
deleted=Dfp.drop(pa)
print('Updated in dataframe')
print(deleted)
else:
print('Patient',pa,'not found in the database')
elif option_d==4:
print('Thank you')
con1=False
else:
print('The password entered does not match the one in our database')
else:
print('The UserID entered is not found in our database')
if q=="q":
print("You have exited doctor interface")
print()
print()
Nurse
if function=='nurse':
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
user_name=input("Enter your UserID: ")
paswd=input("Enter your Password: ")
if user_name in Dfn.values:
if paswd in Dfn.values:
print("You have succesfully logged in")
con2=True
while con2:
option_n=int(input("Enter the services you want to provide\n1.Triage\n2.Height and
Weight\n3. Exit Nurse interface \nEnter just the number: "))
if option_n==1:
print("You have chosen to give severity of the patient")
pa_n=input('Enter the patient name: ')
if pa_n in Dfp.index:
triage=input("Enter the severity of the patient: ")
Dfp.loc[pa_n,'Severity']=triage
print('Updated in dataframe')
print(Dfp.loc[pa_n:])
else:
print('Patient',pa_n,'not found in the database')
Page 7
elif option_n==2:
print("You have chosen to give Height and weight of the patient")
pa=input('Enter the patient name: ')
if pa in Dfp.index:
height=float(input("Enter the height of the patient in cm: "))
weight=float(input("Enter the weight of the patient in kg: "))
Dfp.loc[pa,'Height']=height
Dfp.loc[pa,'Weight']=weight
print('Updated in dataframe')
print(Dfp.loc[pa,:])
else:
print('Patient',pa,'not found in the database')
elif option_n==3:
print('Thank you')
con2=False
else:
print('The password entered does not match the one in our database')
else:
print('The UserID entered is not found in our database')
elif q=="q":
print("You have exited nurse interface")
print()
print()
Register doctor
if function=="rd":
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
print("Good Morning Doctor, Please enter your information correctly")
dname=input("Please enter your name: ")
dusername=input("Please enter your username: ")
dpass=input("Please enter your password: ")
ddepartment=input("Please enter your department: ")
dd["DName"]=dname
dd["Dusername"]=dusername
dd["Dpass"]=dpass
dd["Ddepartment"]=ddepartment
print()
print("You have entered your name as",dname)
print("You have entered your username as",dusername)
print("You have entered your password as",dpass)
print("You have entered your department as",ddepartment)
print()
print("Thank you for registering",dname)
print()
elif q=="q":
print("You have exited 'new doctor' interface")
print()
print()
Page 8
Patient
if function=="rp":
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
print("Welcome to the form. Please fill it carefully with all the right information.")
name=input("Enter full name of patient: ")
d['name']=name
EID=input("Emirates ID number: ")
d['EID']=EID
age=input("Enter patient's age: ")
d["age"]=age
gender=input("Enter your gender:")
if age<"18":
father_name=input("Name of father: ")
mother_name=input("Name of mother: ")
d['mother\'s name']=mother_name
d["father's name"]=father_name
contact=input("Enter mobile number(with country code): ")
d["contact"]=contact
DOB=input("Date of Birth(ex:12 December 20xx): ")
d["DOB"]=DOB
contact2=input("Enter contact of relative: ")
insur=input("Do you have insurance(Y for yes,N for no): ")
if insur=='y' or insur=='Y':
insurance_company=input("Name of insurance company: ")
d['insurance_company']=insurance_company
insurance_plan=input("Insurance plan: ")
d['insurance_plan']=insurance_plan
insurance_id=input("Your insurance number: ")
d["insurance_id"]=insurance_id
validity=input("Validity of insurance: ")
d["validity"]=validity
allergies=[]
allergy=input("Does the patient have any allergies?Y for yes,N for no: ")
if allergy=='y' or allergy=='Y':
allno=int(input("How many allergies do you have?: "))
for i in range(allno):
all=input("Enter the allergy: ")
allergies.append(all)
d["allergies"]=allergies
print('Thank you for filling out the registration form. Please confirm if the entered
information is correct')
print()
print(json.dumps(d,indent=2))
print()
print("This form is successfully filled and is stored in our database")
elif q=="q":
print("You have exited patient interface")
print()
print()
Page 9
Register nurse
if function=="rn":
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
print("Good Morning Nurse, Please enter your information correctly")
nname=input("Please enter your name: ")
nusername=input("Please enter your username: ")
npass=input("Please enter your password: ")
ndepartment=input("Please enter your department: ")
d["nname"]=nname
d["nusername"]=nusername
d["npass"]=npass
d["ndepartment"]=ndepartment
print()
print("You have entered your name as",nname)
print("You have entered your username as",nusername)
print("You have entered your password as",npass)
print("You have entered your department as",ndepartment)
print()
print("Thank you for registering",nname)
print()
elif q=="q":
print("You have exited 'new nurse' interface")
print()
print()
Rating
if function=="rating":
q=input('If you want to continue type "c" or "q" if you want to quit: ')
if q=="c":
rating=int(input("Please rate your experience of the hospital on scale of 1-5(5 being
the highest and 1 being the lowest: "))
if rating>3:
print("Thank your for your rating. We hope you will be back")
else:
feedback=input("Please let us know your feedback on what went wrong with your
experience: ")
print()
print("Thank you for your feedback we will take it into consideration")
exp.append(rating)
exp.sort()
c5=exp.count(5)
c4=exp.count(4)
c3=exp.count(3)
c2=exp.count(2)
c1=exp.count(1)
sortd=[c1,c2,c3,c4,c5]
Page 10
plt.bar([1,2,3,4,5],sortd,color=["Maroon","Red","Orange","Yellow","Green"])
plt.xlabel("Rating")
plt.ylabel("No. Of Reviews")
plt.title('Hospital Rating')
plt.show()
elif q=="q":
print("You have exited rating interface")
print()
print()
Home
print()
print()
print('\t\t\t\t\t\t\t\t\tWelcome to Hospital')
print('\t\t\t\t\t\t\tIf you are staff, please use "doctor" or "nurse"')
print('\t\t\t\t\t\t\tUse "rp" if you are a new patient')
print('\t\t\t\t\t\t\tUse "rd" if you are a new doctor')
print('\t\t\t\t\t\t\tUse "rn" if you are a new nurse')
print('\t\t\t\t\t\tUse "rating" to rate your hospital experience')
Page 11
OUTPUT
Home
Welcome to Hospital
If you are staff, please use "doctor" or "nurse"
Use "rp" if you are a new patient
Use "rd" if you are a new doctor
Use "rn" if you are a new nurse
Use "rating" to rate your hospital experience
Enter the services you want:
Doctor
Enter the services you want: doctor
If you want to continue type "c" or "q" if you want to quit: c
Enter your UserID: GM234
Enter your Password: hfsdf
You have succesfully logged in Dr.
Enter the services you want to provide
1.Diagnosis
2.Medicines to be given to patient
3.Discharge
4. Exit doctor interface
Enter just the number: 1
You have chosen to give the diagnosis of the patient
Enter the patient name: Kashinath A
Enter the diagnosed disease/ailment of the patient: Cancer
Updated in dataframe
PDepartment Orthopedics
PHeight
PWeight
Ailment
173
63.5
Cancer
Name: Kashinath A, dtype: object
Page 12
Enter the services you want to provide
1.Diagnosis
2.Medicines to be given to patient
3.Discharge
4. Exit doctor interface
enter just the number: 2
You have chosen to give the Medicines of the patient
Enter the patient name: Kashinath A
Enter the name of medicines you have prescribed for the patient: Paracetomol
Updated in dataframe
PDepartment Orthopedics
PHeight
PWeight
Ailment
Medicine
173
63.5
Cancer
Paracetomol
Name: Kashinath A, dtype: object
Enter the services you want to provide
1.Diagnosis
2.Medicines to be given to patient
3.Discharge
4. Exit doctor interface
Enter just the number: 3
You have chosen to discharge a patient
Enter the patient name: Kashinath A
Removing patient Kashinath A
Updated in dataframe
Page 13
Nurse
Enter the services you want: nurse
If you want to continue type "c" or "q" if you want to quit: c
Enter your UserID: O100
Enter your Password: eee12
You have succesfully logged in
Enter the services you want to provide
1.Triage
2.Height and Weight
3. Exit Nurse interface
Enter just the number: 1
You have chosen to give severity of the patient
Enter the patient name: Kashinath A
Enter the severity of the patient: 5
Updated in dataframe
PDepartment PHeight PWeight Severity
Kashinath A
Abdul M
Rais M
Orthopedics
General Medicine
Paediatrics
173 63.50
183 73.00
5
NaN
179 81.05
NaN
Mohammed R General Practionior
180 59.70
NaN
Enter just the number: 2
You have chosen to give Height and weight of the patient
Enter the patient name: Kashinath A
Enter the height of the patient in cm: 180
Enter the weight of the patient in kg: 80
Updated in dataframe
PDepartment Orthopedics
PHeight
PWeight
Height
173
63.5
180.0
80.0
Weight
Name: Kashinath A, dtype: object
Page 14
Register Patient
Enter the services you want: rp
If you want to continue type "c" or "q" if you want to quit: c
Welcome to the form. Please fill it carefully with all the right information.
Enter full name of patient: Roger
Emirates ID number: 102323321392
Enter patient's age: 15
Enter your gender: M
Name of father: Rodger
Name of mother: Ruth
Enter mobile number(with country code): +971 05602303434
Date of Birth(ex:12 December 20xx): 20 December 2007
Enter contact of relative: +971 1230344323
Do you have insurance(Y for yes,N for no): Y
Name of insurance company: Emaar
Insurance plan: Platinum
Your insurance number: 0123024352341
Validity of insurance: 11/24
Does the patient have any allergies?Y for yes,N for no: Y
How many allergies do you have?: 2
Enter the allergy: Nuts
Enter the allergy: Milk
Thank you for filling out the registration form. Please confirm if the entered information is
correct
{
"name": "Roger",
"EID": "102323321392",
"age": "15",
"mother's name": "Ruth",
"father's name": "Rodger",
"contact": "+971 05602303434",
"DOB": "20 December 2007",
"insurance_company": "Emaar",
"insurance_plan": "Platinum",
"insurance_id": "0123024352341",
"validity": "11/24",
"allergies": [
"Nuts",
"Milk"
]
}
This form is successfully filled and is stored in our database
Page 15
Register Patient
Please enter your name: Jason
Please enter your username: D2435
Please enter your password: Arnabikan7
Please enter your department: Orthopedics
Thank you for registering Jason
Register Doctor
Enter the services you want: rd
If you want to continue type "c" or "q" if you want to quit: c
Good Morning Doctor, Please enter your information correctly
Please enter your name: Jason
Please enter your username: 1233
Please enter your password: Arbika
Please enter your department: Orthopedics
You have entered your name as Jason
You have entered your username as 1233
You have entered your password as Arbika
You have entered your department as Orthopedics
Thank you for registering Jason
Register Nurse
Enter the services you want: rn
If you want to continue type "c" or "q" if you want to quit: c
Good Morning Nurse, Please enter your information correctly
Please enter your name: James
Please enter your username: Do23
Please enter your password: omlasod
Please enter your department: Radiology
You have entered your name as James
You have entered your username as Do23
You have entered your password as omlasod
You have entered your department as Radiology
Thank you for registering James
Page 16
Rating
Enter the services you want: rating
If you want to continue type "c" or "q" if you want to quit: c
Please rate your experience of the hospital on scale of 1-5(5 being the highest and 1 being
the lowest: 3
Please let us know your feedback on what went wrong with your experience: Long Queue
Times
Thank you for your feedback we will take it into consideration
Page 17
CONCLUSION
This program discusses how we can manage the data of a hospital and how we can register
doctors, nurses and patients and get their feedbacks.
By writing this program, we have learnt some of the many beautiful aspects of Python and
the fact is that it is so easy to write and interpret, even by inexperienced programmers. We
were able to review what we already knew while learning some new commands and
functions.
Having completed this program, we are able to
1. Define computer programs
2. List and describe the components of a program
3. Use Pandas and Matplotlib libraries of Python
4. Describe what happens when the computer program is executed
5. Search and debug and program for possible errors
6. Read and interpret the program
Page 18
BIBLIOGRAPHY
https://www.python.org/
Informatics Practices A Text Book for Class 12 By Sumita Arora
Page 19