Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

Declaration

The project submitted herewith is a result of my own


efforts in totality and in every aspect of the project works.
All information that has been obtained from other sources
had been fully acknowledged. I understand that any
plagiarism, cheating or collusion or any sorts constitutes a
breach of project rules and regulations and would be
subjected to disciplinary actions.

I hereby declare that we are five members and we have


done our project with our full-and-equal efforts.
INDEX

S.No TOPIC

1. Bonafide Certificate

2. Declaration

3. Acknowledgement

4. Introduction to SQL

5. Introduction to Project

6. Data model

7 Queries

8 Bibliography
Certificate

The project entitled, “SCHOLARSHIP MANAGEMENT” submitted


by S. K. Karen Christina of Class XII Informatics Practices for the
C.B.S.E Senior Secondary Examination class XII of Informatics
Practical at ROSE MARY PUBLIC SCHOOL has been examined.

This report is the result of her effort endeavors. This report is


found worthy of acceptance as final project report for class XII.

SIGNATURE SIGNATURE
OF EXAMINER OF TEACHER
Acknowledgement

I would like to express my special thanks of gratitude to my


computer teacher Mrs. BENITA JASMINE as well as our principal
Mrs. D. JUDY PRIYADARSHINI SHANTHI who gave me the golden
opportunity to do this wonderful project on the topic “HOSPITAL
MANAGEMENT”, which also helped me in doing a lot of research
and I came to know about so many new things I am really
thankful to them.

Secondly, I would also like to thank my parents and friends who


helped me a lot in finalizing this project within the limited time
frame.
Introduction to SQL

One has to write applications programs to access data in case of


file system. However, for database management systems there
are special kind of programming languages called query language
that can be used to access data from the database. The
Structured Query Language (SQL) is the most popular query
language used by major relational database management
systems such as MySQL, ORACLE, SQL Server, etc.

SQL is easy to learn as the statements comprise of descriptive


English words and are not case sensitive. We can create and
interact with a database using SQL in an efficient and easy way.
The benefit with SQL is that we don’t have to specify how to get
the data from the database.

Rather, we simply specify what is to be retrieved, and SQL does


the rest. Although, called a query language, SQL can do much
besides querying. SQL provides statements for defining the
structure of the data, manipulating data in the database, declare
constraints and retrieve data from the database in various ways,
and depending on our requirements.
Introduction to Project

Hospital Database Management system design is ad atabase


design use for managing hospital functions and events. It
includes registration of patients, storing their disease details into
the system.
It is computer or web based system that facilities managing the
functioning of a hospital or any medical set up.
This system will help in making the whole functioning paperless.
The hospital database includes all the necessary patient data.
The disease history, test results, prescribed treatment can be
accessed by doctors without much delay in order to make an
accurate diagnosis and monitor the patient's health.
It will also contain doctor’s information and will digitalize the
whole billing system.
It has the facility to give a unique id for every patient and stores
the details of every patient and staff automatically.
It includes a search facility to know the current status of each
room.
User can search availability of a doctor and the details of a
patient using the id.
It enables lower risks of mistakes.
And the whole process conducted by Administrator.
Any of the staff members, doctor & admin isable to add, view,
edit, update or delete data.

Purpose of Hospital Database Management


System:
The purpose of the Hospital Management System database
Design is to make a secure and easy way of storing information of
the patient, doctors, inpatient, outpatient, Rooms, and Bill
payment.

Features of the Hospital Database Management


System:
There are 13 common features of Hospital Management System
Database Design such as Managing Staff, Doctors, laboratory,
Inpatient, Outpatient, Rooms, and Hospital Bills information.

1. Staff - This table of Hospital Management System will be used


for storing and managing the Staff details of the hospital.
2. Doctor - This table will be used for storing and managing the
Doctor information.
3. Laboratory - This table will be used for storing and managing
the Laboratory transaction.
4. Inpatient - This table will be used for storing and managing
the inpatient information and diagnosis.
5. Outpatient - This table will be used for storing and managing
the inpatient information and diagnosis.
6. Room - This table will be used for storing and managing the
room information and assigning of patient in every room.
7. Bills - The billing table will be used for managing the
statement of accounts per patient and for the collection of
bills.
8. Staff - This table will be used for storing and managing the
Staff information.
9. Pharmacy – This table will be used for storing and managing
the details of the pharmacies in the hospital.
10. Equipment – This table will be will be used for storing and
managing the details of the equipments in every sector of the
hospital.
11. Water and Electricity - This table will be used for storing and
managing the Water and Electricity information of the
hospital.
12. Specialist – This table will be used for storing and managing
the details of the specialists, be it doctors, nurses or lab
technicians for different sectors in the hospital.
13. Diagnosis - This table will be used for storing and managing
the Water and Electricity information of the hospital.
BIBLIOGRAPHY
 Online SQL Editor - Online SQL Scripting - Practice SQL
Online (jdoodle.com)
 https://www.w3schools.com/sql
 https://www.visual-paradigm.com
 https://www.visual-paradigm.com
 Informatics Practices with Python-Preeti Arora
 (PDF) Hospital Database Management System(sql
project report) | Faysal sarder - Academia.edu

HOSPITAL MANAGEMENT - 1
# 1 – TABLE NAME : PATIENT_DETAILS

FILE NAME - patient_details1_csv.py

CODE:
import pandas as pd

patient = {

's_no' : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],

'id' : [1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012,

1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020],

'first_name' : ['KATHERINE', 'WILLIAM', 'ANGIE', 'LISA', 'JOHN', 'SELINA', 'JELIN',

'JULIE', 'ALFIE', 'ARTHUR', 'LANA', 'RONNIE', 'JENNIFER', 'JAMES',

'JOBERT', 'MICHAEL', 'LEONARD', 'LIAM', 'HARRY', 'ETHAN'],

'last_name' : ['VALDES', 'NORMANN', 'MARTIN', 'CORBETT', 'MILAN', 'GARRY', 'FREDRIK',

'GRIFFIN', 'HOPE', 'WILLIAMSON', 'MARK', 'KARL', 'LEX', 'ROBERT',

'WOODS', 'THOMAS', 'LUCAS', 'MATEO', 'LUNAS', 'JASON'],

'gender' : ['F', 'M', 'F', 'F', 'M', 'F', 'F', 'F', 'M', 'M', 'F', 'M', 'F', 'M',

'M', 'M', 'M', 'M', 'M', 'M'],

'age' : [34, 78, 45, 24, 23, 56, 22, 16, 14, 37, 88, 79, 66, 45, 18, 47, 26, 24, 28, 51],

'date_of_birth' : ['22-02-1988', '16-06-1944', '25-07-1977', '31-01-1998', '12-12-1999',

'24-05-1966', '18-05-2000', '31-03-2006', '14-07-2008', '07-06-19985',

'10-04-81', '19-03-85', '15-03-95', '16-08-87', '29-10-04', '31-10-81',

'22-08-96', '30-11-98', '18-05-94', '14-03-77'],

'phone_no' : [8878788777, 8988987867, 8987787878, 9798989898, 7868687987, 6868878879,


6565756768,

4567856976, 2236548534, 3597606745, 5875454957, 4354676998, 6955796888, 9907576576,

5698678689, 3854545454, 2865655877, 4537454567, 1241434535, 7537357757],

'address' : ['no.6, walker street, india', 'no.9, baker street, india', 'no.8, cross street, india',
'no.5, lake street, india', 'no.4, leeway street, india', 'no.3, kohlin street, india',

'no.1, john street, india', 'no.34, alex street, india', 'no.56, king street, india',

'no.89, james street, india', 'no.70, smith street, india', 'no.46, summer street, india',

'no.25, burns street, india', 'no.98, spring street, india', 'no.08, bayberry street, india',

'no.35, east high street, india', 'no.67, oak street, india', 'no.86, devon street, india',

'no.06, ridge avenue, india', 'no.23, myrtle street, india']}

df = pd.DataFrame(patient)

df.to_csv("C:\\Users\\user\\.spyder-py3\\patient_details1_csv.py")

print("\t \t \t**********************************")

print("\t \t \t \t Hospital Management")

print("\t \t \t**********************************")

print("\t \t \t \t Patient Details Report")

print("\t \t \t \t --------------------")

print(df)

print("\t \t \t**********************************")

OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:


TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd

data = pd.read_csv(“C:\\Users\\user\\.spyder-py3\\patient_details.csv”)

print(data)

OUTPUT:
# 2 TABLE NAME – APPOINTMENTS
FILE – appointments_csv.py
CODE:
import pandas as pd

a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ,13, 14, 15]

b = [1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030,

1031, 1032, 1033, 1034, 1035]

c = ['ZAYN','LAUREN','CHRISTINA','KAREN','OLIVER','NOAH','LACHLAN',

'JACKSON','AVA','STEPHANYA','AIYLA','VICKY','KAREN','NICHOLAS','LUIS']

d = ['MALIK','CHRIS','SEN','JAS','JOHN','JACK','OLIVE','WILLIAM','LOMOV',

'PAUL','DANIEL','JOHN','STAN','JOSE','BENTLEY']

e = ['M', 'F', 'F', 'F', 'M', 'M', 'M', 'M', 'F', 'F', 'F', 'F', 'F', 'M', 'M']

f = [22,31,16,16,32,24,21,35,67,55,24,17,16,95,52]

g = ['18-05-00','22-02-84','31-03-06','31-03-06','22-02-83','18-05-98',

'18-05-01','22-02-87','15-03-94','15-03-84','18-05-98','31-03-05',

'31-03-06','31-03-66','18-05-79']

h = [7686869879,7760686980,6060986088,8980698689,8976987879,9877098099,7097098090,

8770979079,9709789089,9709707097,8696986977,7695758756,5795750875,6876096868,7507850578]

i = ['16-04-22','16-04-22','16-04-22','16-04-22','16-04-22','16-04-22','16-04-22',

'16-04-22','17-04-22','17-04-22','17-04-22', '17-04-22', '17-04-22', '17-04-22', '17-04-22']

j = ['12:00 PM','12:30 PM','1:00 PM','8:45 PM','7:00 PM','8:00 AM','7:00 AM','2:00 PM','11:00 AM',

'4:00 PM','5:00 PM','4:30 PM','5:30 PM','6:00 PM','6:15 PM']

k = ['DR.SUNDAR','DR.SIMONE','DR.ANGELA','DR.ANTON','DR.LESLIE','DR.SANDY','DR.MUKHEN',

' DR.SWEETY','DR.SAMEER','DR.BETH','DR.AMELIA','DR.FRIDA','DR.IMMY','DR.MARYAM','DR.LARRY']

l = ['no.43, prospect avenue, india', 'no.77, forest drive, india', 'no.60, park avenue, india',

'no.95, parkinsons street, india', 'no.47, layla street, india', 'no.91, jacobs street, india',

'no.03, betley street, india', 'no.50, hutchinson street, india', 'no.82, hutchkins street, india',

'no.04, kendor street, india', 'no.88, maylin street, india', 'no.73, swey street, india',
'no.44, sancta street, india', 'no.86, samuel street, india', 'no.99, sann street, india']

m = ['RS.500','RS.600','RS.750','RS.420','RS,200','RS.280','RS.590','RS.800','RS.1500','RS.3000',

'RS.550','RS.710','RS.500','RS.1900','RS.400']

dict2 = {'s_no':a,'id':b,'first_name':c,'last_name':d,'gender':e,'age':f,'date_of_birth':g, 'phone_no' :h,

'appointment_date':i, 'appointment_timing' :j, 'doctor_name' :k, 'address' :l, 'payment' :m}

df = pd.DataFrame(dict2)

df.to_csv('C:\\Users\\user\\.spyder-py3\\appointments_csv.py')
print("\t \t \t**********************************")

print("\t \t \t \t Hospital Management")

print("\t \t \t**********************************")

print("\t \t \t \t Appointments Report")

print("\t \t \t \t --------------------")

print(df)

print("\t \t \t**********************************")

OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:


TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd

data = pd.read_csv(“D'C:\\Users\\user\\.spyder-py3\\appointments.csv”)

print(data)

OUTPUT:
# 3 TABLE NAME : INPATIENT DETAILS
FILE : inpatient_details_csv.py
CODE:
import pandas as pd
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
b = [1001, 1003, 1006, 1007, 1008, 1013, 1015, 1016, 1017, 1019]
c = ['KATHERINE', 'ANGIE', 'SLINA', 'JELIN', 'JULIE', 'JENNIFER',
'JOBERT', 'MICHAEL', 'LEONARD', 'HARRY']
d = ['VALDES', 'MARTIN', 'GARRY', 'FREDRIK', 'GRIFFIN', 'ALEX',
'WOODS', 'THOMAS', 'LUCAS', 'LUNAS']
e = ['F', 'F', 'F', 'F', 'F', 'F', 'M', 'M', 'M', 'M']
f = [34, 45, 56, 22, 16, 66, 18, 47, 26, 28]
g = [' ACUTE APPENDICITIS', 'MULTIPLE SCLEROSIS', 'ARTHRITIS', 'CHICKEN POX',
'ULNA, RADIUS FRACTURE', 'LATE STAGE CANCER', 'CONJUNCTIVITIS (PINK EYE)',
'DIARRHEA', 'PSORIASIS', 'LUPUS ERYTHEMATOSUS']
h = ['PIPERACILLIN, CIPROFLOXACIN - FOR TREATING INFECTION', 'METHYLPREDNISOLONE,
COPAXONE', 'PHYSIOTHERAPY - KNEE EXERCISES, KNEE CAP, PAIN KILLERS', 'ACYCLOVIR,
ACITAMINOPHEN', 'VITAMIN SUPPLEMENTS', 'CHEMOTHERAPY', 'ANTIBIOTICS -
MOXIFLACIN, TRIMETHOPRIM', 'ORS, LOPERAMIDE', 'HYDROCORTISONE OR HUMIRA
(BASED ON RECOVERY)', 'ANIFROLUMAB (SAPHNELO)']
i = ['APPENDECTOMY', 'PLASMAPHERESIS', 'NIL', 'NIL', 'NIL', 'WILL DO IF REQUIRED', 'NIL',
'NIL', 'NIL', 'NIL']
j = ['NIL', 'NIL', 'NIL', 'NIL', 'NON-OPERATIVE CAST TREATMENT', 'NIL', 'NIL', 'NIL', 'NIL', 'NIL']
k = ['2 WEEKS', 'NO APPROXIMATION', '2 DAYS', '1-3 WEEKS', 'NO STAY - CAST OPERATION
FOR 4 - 6 WEEKS', 'UNTIL CHEMO GETS OVER', 'NO STAY', 'NO STAY', 'NO STAY', 'NO STAY']
dict3 = {'s_no' : a, 'id' : b, 'first_name' : c, "last_name" : d, "gender" : e, "age" : f,
"health_issues" : g, "medications" : h, "major_operations/surgeries" : i,
"minor_operations/surgeries" : j, 'period_of_stay' : k}
df = pd.DataFrame(dict3)
df.to_csv(“C:\\Users\\user\\.spyder-py3\\inpatient_details_csv.py”)
print("\t \t \t**********************************")
print("\t \t \t \t Hospital Management")
print("\t \t \t**********************************")
print("\t \t \t \t Inpatient Report")
print("\t \t \t \t --------------------")
print(df)
print("\t \t \t**********************************")

OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:

TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd

data = pd.read_csv(‘C:\\Users\\user\\.spyder-py3\\inpatient_details.csv’)

print(data)
OUTPUT:
# 4 TABLE NAME : HOSPITAL_ROOM_DETAILS
FILE : inpatient_details_csv.py
CODE:

Sample of table-hosp_rooms.csv file :

TABLE DATA:
RETRIEVING TO CSV:
import pandas as pd

data = pd.read_csv("C:\\Users\\user\\.spyder-py3\\table-hosp_rooms.csv")

df = pd.DataFrame(data)

print("\t \t \t**********************************")

print("\t \t \t \t Hospital Management")

print("\t \t \t**********************************")

print("\t \t \t \t Hospital Rooms Report")

print("\t \t \t \t --------------------")

print(df)

print("\t \t \t**********************************")

OUTPUT:
OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:

df.to_csv("C:\\Users\\user\\.spyder-py3\\hosp_rooms.py")
HOSPITAL MANAGEMENT - 2
#5 TABLE NAME : DOCTOR_DETAILS

FILE NAME – doctor_details_csv.py

CODE:
import pandas as pd
doctor = {
's_no' : [1,2,3,4,5,6,7,8,9,10],
'doc_id':[1000,1001,1003,1004,1005,1006,1007,1008,1009,1010],
'doc_name':['rahul','ragini','vijay','ashok','balaji','keshvi','arjun','sheela','tanuja','sejal'],
'gender':['M','F','M','M','M','F','M','F','F','F'],
'contact_no':[76585432198,8765432189,7689012345,9807654321,8769012345,789023456
1,8765432198,7890654362,5678901234,6789012345],
'email_id':['rahul@gmail.com','ragini@gmail.com','vijay@gmail.com','ashok@gmail.com','b
alaji@gmail.com','keshvi@gmail.com','arjun@gmail.com','sheela@gmail.com','tanuja@gma
il.com','sejal@gmail.com'],
'doc_charge':[700,600,500,800,1000,900,1500,2000,1000,2500],
'timings':['9am-2pm','9:30am-4pm','10am-1pm','10:30am-5pm','11am-3pm','8:30am-
12pm','11:30am-6pm','1pm-7pm','12pm-5:30pm','2pm-8pm']}
df1=pd.DataFrame(doctor)
df1.to_csv('C:/Users/user/.spyder-py3/doctor_details.py')
print("\t\t\t******************************")
print("\t\t\t\t Hospital Management")
print("\t\t\t*****************************")
print("\t\t\t\t Doctor Details Report")
print("\t\t\t\t----------------------------")
print(df1)
print("\t\t\t*******************************")
OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:

TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd

df = pd.read_csv('C:\\Users\\user\\.spyder-py3\\doc_details.csv')

print(df)
OUTPUT:
#6 TABLE NAME - WARD DETAILS
FILE – ward_csv.py
CODE:

import pandas as pd

ward={

'ward_id':[1221,1222,1223,1224,1225,1226,1227,1228,1229,1330],

'ward_name':['kidney','stomach','fever','surgical','kids','eye','ear','throat','nose','heart'],

'bed_id':[134,135,136,137,138,139,140,141,142,143],

'bed_no':[11,12,13,14,15,16,17,18,19,20],

'patient_id':[102,103,104,105,106,107,108,109,110,111],

'patient_name':['riya','ram','manan','vinodh','sanjushri','akshay','vishal','rutuja','rishabh','ra
hul'],

'nurse_name':['lakshmi','kamala','lata','lakshmi','meenal','lata','kamala','meenal','sheela','ro
ma'],

'ward_charge':[2000,3000,4000,5000,6000,8000,5000,3500,6500,5500]}

df =pd.DataFrame(ward)

df.to_csv('C:/Users/user/.spyder-py3/ward.py')

print("\t\t\t******************************")

print("\t\t\t\t Hospital Management")

print("\t\t\t*****************************")

print("\t\t\t\t Ward Details Report")

print("\t\t\t\t----------------------------")

print(df)

print("\t\t\t*******************************")
OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:

TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd
df = pd.read_csv('C:\\Users\\user\\.spyder-py3\\doc_details.csv')
print(df)
OUTPUT:
#7 TABLE NAME - PHARMACY DETAILS
FILE - pharmacy_details_csv.py
CODE:
import pandas as pd

pharmacy={'pharmacy_id':[1441,1442,1443,1444,1445,1446,1447,1448,1449,1450],

'pharmacist_name':['viraj','divum','meenaka','veena','sujata','rohit','raj','kapil',

'sanjana','vishwas'],

'medicine_name':['paracetamol','allegra','crocin','ascorilsyrup','azithraltablet','ambrodilsyru
p', 'alexsyrup','rosuvas10','calpoltablet','rantac150tablet'],

'medicine_id':[134,156,143,124,146,189,154,186,169,132],

'medicine_charge':[60,30,40,110,120,150,250,165,120,80],

'bill_id':[87,45,68,72,35,21,45,84,26,60],

'bill_date':['13-04-2022','22-02-2022','09-04-2022','02-05-2022','05-08-2022','07-05-
2022','09-06-2022', '08-09-2022','03-04-2022','06-01-2022'],

'patient_id':[102,103,104,105,106,107,108,109,110,111]}

df=pd.DataFrame(pharmacy)

df.to_csv('C:/Users/user/.spyder-py3/phar_det.py')

print("\t\t\t******************************")

print("\t\t\t\t Hospital Management")

print("\t\t\t*****************************")

print("\t\t\t\t Pharmacy Details Report")

print("\t\t\t\t----------------------------")

print(df)

print("\t\t\t*******************************")
OUTPUT OF CONVERTING PYTHON FILE TO CSV FILE:

TABLE DATA:

RETRIEVING TO CSV:
import pandas as pd

df = pd.read_csv('C:\\Users\\user\\.spyder-py3\\pharmacy_details.csv')

print(df)
OUTPUT:
QUERIES

#1 Table name: patient_details


Number of records: 20
Number of columns: 9
Primary Key: id
RESULT :
# 2 Table name: appointments
Number of records: 15
Number of columns: 13
Primary Key: id
RESULT :
# 3 Table name: inpatient_details
Number of records: 10
Number of columns: 11
Primary Key: id
RESULT :
# 4 Table name: hosp_rooms
Number of records: 13
Number of columns: 9
Primary Key: id
RESULT :
# 5 Table name:
Number of records: 10
Number of columns: 8
Primary Key: doc_id
RESULT :
# 6 Table name: ward_details
Number of records: 10
Number of columns: 8
Primary Key: ward_id
RESULT :
# 7 Table name: pharmacy_details
Number of records: 10
Number of columns: 8
Primary Key: pharmacy_id
RESULT :

You might also like