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

HOSPITAL MANAGEMENT SYSTEM

REVIEW REPORT
Submitted by

YASHWANTH (19BCI0022)
MARUTHI (19BCE0128)
BHARATH VISWATH (19BCE0453)

Prepared For

DATABASE MANAGEMENT SYSTEM (CSE2004)


PROJECT COMPONENT

Submitted To
Dr. Nithya S
Associate Professor

School of Computer Science and Engineering


Abstract
Hospital Management System (HMS) or Hospital Management Information
System (HMIS) is an element of medical informatics solutions that focuses
mainly on the administration needs of hospitals. An HMS is a computer or web-
based application that manages the functioning of an entire hospital. This
customizable integrated system is designed to manage all the operations of the
hospital, such as administration, patient details, medical history of the
patient, appointment booking, inventory management, billing, bed
management, drug management, revenue management, Electronic Medical
record (EMR) and so on.

Hospital Management Systems of multiple branches of the same hospital have


to be integrated so that if a patient consults a doctor in a different branch, their
medical history can be retrieved easily. HMS should provide secure storage of
data and a cloud-based solution to access it from anywhere at any time.

HMS is essential for all healthcare establishments, be it hospitals, nursing


homes, health clinics, rehabilitation centres , dispensaries, or clinics. The main
goal is to computerized all the details regarding the patient and the hospital.
The installation of this healthcare software results in improvement in
administrative functions and hence better patient care, which is the prime focus
of any healthcare unit.

The hospital management system organizes the stable functioning of daily tasks
and interactions. This is a special tool to support the smooth operating of the
software components that are vital for the clinic administration. The hospital
records management software keeps track of all the operations, stores the users’
data, performs its analysis and generates the reports. The medical institution is
given the opportunity to collect its information in one place. It includes the
patient and doctors’ records as well as the data concerning financial affairs,
supply management, etc. Furthermore, it is only processed, classified and
accessible for authorized users. The hospital database management system
provides users with data security due to all regulations. Implementation of
different functions empowers smooth and clear functionality.
TABLE OF CONTENTS

1. Introduction
1.1 Background
1.2 Motivation
1.3 Objective

2. Project Resource Requirements


2.1 Software Requirements
2.2 Hardware Requirements

3. Literature Survey

4. Design of the Project


4.1 ER Diagram
4.2 ER to Relational Mapping (Schema Diagram)
4.3 Tables and Constraints

5. Implementation
5.1 Introduction
5.2 Implementation

6. Snapshort

7. Conclusion and Future Work


7.1 Conclusion
7.2 Future Work
1)INTODUCTION
1.1)Background
The IT system has revolutionized the field of medicine. In this fast-paced world
of medicine, it is a daunting task to manage a multi-specialty hospital. A
hospital management system (HMS) is a computer or web based system that
facilitates managing the functioning of the hospital or any medical set up1. This
system or software will help in making the whole functioning paperless. It
integrates all the information regarding patients, doctors, staff, hospital
administrative details etc. into one software4. It has sections for various
professionals that make up a hospital.

1.2) Motivation
Often we encounter situations in emergency services where things get
delayed due to hefty paperwork. On visiting a government hospital due to
personal reasons, I encountered that a lot of time is wasted in transferring of
papers and finding out details from files. While on the other hand Private
(Corporate based) Nursing homes/Hospitals save a lot of time doing these works
in a digitalized format. Here we understood the need for web based database
systems in daily life and planned of undertaking this project.

1.3)Objective
The main objective of this project integrates all the information regarding
patients, doctors, staff, hospital administrative details etc. into one software.
It has sections for various professionals that helps us to get a total over view
about it
● Appointment booking
Helps patients cut the long queue and saves their time. It is equipped with features like
automated email.
● Role-Based Access Control
Allows employees to access only the necessary information to effectively perform their
job duties increases data security and integrity
● Overall cost reduction
Cuts down paper costs as all the data are computerized. No separate costs for setting up
physical servers
● Data accuracy
Removes human errors.
● Data security
Helps to keep patients records private. Restricts access through role-based access
control
● Revenue management
Makes daily auditing simple. Helps with statistics and other financial aspects
2. Project Resource Requirements

2.1) Software Resource Requirements


- mysql
- HTML 5
- JavaScript
-

3) Literature Survey

This paper is to computerize the Front Office Management of


Hospital to develop software which is user friendly simple,
fast, and cost – effective. It deals with the collection of
patient’s information, diagnosis details, etc. Traditionally, it
was done manually. The main function of the system is
register and store patient details and doctor details and
retrieves these details as and when required, and also to
manipulate these details meaningfully. System input contains
patient details, diagnosis details, while system output is to get
these details on to the screen. The Hospital Management
System can be entered using a username and password. It is
accessible either by an administrator or receptionist. Only they
can add data into the database. The data can be retrieved
easily. The data are well protected for personal use and makes
the data processing very fast.
4)DESIGN OF PROJECT

4.1)ER DIAGRAM

4.2) ER to Relational Mapping (Schema Diagram)


4.3) Tables and Constraints

TABLE NAME - PATIENT


Attribute Domain Type Constraint
NAME VARCHAR(30) NOT NULL
PATIENT_ID NUMBER(10) PRIMARY KEY
AGE NUMBER(3) NOT NULL
GENDER CHAR EITHER M/F/O
DISEASE VARCHAR(50) NOT NULL
PHONE NUMBER(10) NOT NULL
NUMBER

TABLE NAME – DOCTOR

Attribute Domain Type Constraint

REG NO NUMBER(10) PRIMARY KEY

NAME VARCHAR(30) NOT NULL


AGE NUMBER(3) NOT NULL

GENDER CHAR EITHER M/F


SPECIALIZATION VARCHAR(50)

TIMINGS VARCHAR(50)

TABLE NAME - APPOINTMENT

Attribute Domain Type Constraint

APPT ID NUMBER(10) PRIMARY KEY

DOCTOR ID NUMBER(10) CANDIDATE KEY

PATIENT ID NUMBER(10) CANDIDATE KEY

USER NAME VARCHAR(30) NOT NULL

DATE DATE NOT NULL

TIME TIMESTAMP

FEES NUMBER(6,2) MAX VALUE = 9999.99

TABLE NAME – BILL


Attribute Domain Type Constraints

BILL_ID NUMBER(10) PRIMARY KEY

ADVANCE NUMBER(4)

AMMENITIES VARCHAR NOT NULL

MEDICLAIM VARCHAR

TOTAL NUMBER(6,2) MAX=9999.99

TABLE NAME – EMPLOYEE OR STAFF

Attribute Domain Type Constraints

EMP_ID NUMBER(10) PRIMARY KEY

NAME VARCHAR(20) CANDIDATE KEY

DEPARTMENT VARCHAR(30) CANDIDATE KEY

GENDER CHAR EITHER M/F

ADDRESS VARCHAR(50)

AGE NUMBER(3) NOT NULL

SALARY NUMBER(7,2) MAX=99999.99

TABLE NAME – MEDICAL RECORDS

Domain Type Constraints

NAME VARCHAR(30) NOT NULL

DISEASE VARCHAR(50) NOT NULL

DATE DATE NOT NULL

DRUGS VARCHAR(50) NOT NULL

REPORTS VARCHAR(50)

TABLE NAME- ROOM


Attribute Domain Type Constraints
NURSE VARCHAR(30) KEY
CHARGES NUMBER(7,2) MAX=50000.00
TYPE VARCHAR(15) NOT NULL
ROOM_NO VARCHAR(5) PRIMARY
KEY

TABLES WE EXECUTED

1)TABLE REALTED TO DOCTOR


2)TABLE RELATED TO EMPLOYEE OR STAFF
Create table Patient(
patid varchar(5) primary key check (length(patid)=5 and
(SUBSTR(patid,1,1)='P')),
patname varchar(20) not null,
dob date,
gender char(1) not null check (gender in ('M','F','T')),
Contact number(10) not null,
Address varchar(50) not null
);
Create table Inpatient(
patid varchar(5),
doa date,
bedno number not null,
endtime date,
starttime date,
foreign key(patid) references patient(patid),
constraint starttime check(doa < starttime and starttime < endtime)
);
Create table Appointment(
appid varchar(5) primary key check (length(appid)=5 and
(SUBSTR(appid,1,1)='A')),
patid varchar(5) not null,
docid varchar(5) not null,
nurseid varchar(5) not null,
consultroomno number,
adate date,
atime timestamp,
foreign key(patid) references patient(patid),
foreign key(docid) references doctor(docid),
foreign key(nurseid) references staff(staffid)
);

Create table Prescription(


presid varchar(7) primary key check (length(presid)=7 and
(SUBSTR(presid,1,2)='PR')),
appid varchar(5) not null,
pdate date,
ptime timestamp,
diagnosisdetail varchar(50),
add foreign key(appid) references appointment(appid);
);
Create table Prescribedmedicines(
presid varchar(7),
medicinename varchar(20) not null,
dosage varchar(10),
brand varchar(20),
foreign key(presid) references prescription(presid)
);

Create table Inpatientprescription(


patid varchar(5),
presid varchar(7),
foreign key(patid) references patient(patid),
foreign key(presid) references prescription(presid)
);
Create table Hospitalbill( invno
varchar(5) unique, invdate date,
patid varchar(5) not null, billamount
number,
paymenttype varchar(20) not null, discount
varchar(10),
foreign key(patid) references patient(patid)
);
ALTER TABLE DOCTOR ADD DEPTNO VARCHAR(5);
UPDATE DOCTOR SET DEPTNO='DP100' WHERE
CONTACT='9000784804'; UPDATE DOCTOR SET DEPTNO='DP102'
WHERE CONTACT = '8300744804'; UPDATE DOCTOR SET
DEPTNO='DP140' WHERE CONTACT = '8300784804'; UPDATE DOCTOR
SET DEPTNO='DP180' WHERE CONTACT = '8450784454'; UPDATE
DOCTOR SET DEPTNO='DP190' WHERE CONTACT = '9200784804';
ALTER TABLE DOCTOR ADD FOREIGN KEY(DEPTNO) REFERENCES DEPARTMENT(DEPTNO);

DML QUERIES TO ACHIEVE THE FOLLOWING;


a)Find the details of all doctors.

SELECT*FROM DOCTOR;
b)Display all the hospital bill details.

SELECT*FROM HOSPITAL;

c)List the doctors who are specialized in ‘Cardiology’ and ‘Neurology’


SELECT*FROM DOCTOR WHERE SPECIALIST =’Cardiology’ OR
SPECIALIST=’Neurology’;
d)Display all the test types that have the values in the
range of 25 and 75 .
SELECT * FROM TESTYPES WHEERE LOWVALUE>25 AND
HIGHVALUE<75;

e)Find the diagnosis details of the patient with


prescription id ‘PR00012’.
SELECT * FROM PRESCRIPTION WHERE PRESID =’PR00012’;
f)Update the contact number of all staffs who are in the
category ‘Nurse’
UPDATE STAFF SET CONTACT=9999988888 WHERE CATEGORY=’Nurse’;
SELECT * FROM STAFF;

g)Delete the staff records that have designations ‘junior


attender’ or ‘technician’
and belongs to the department ‘D190’.
DELETE STAFF WHERE DESIGINATION=;Technician’ AND DEPTID=’DP190’; DELETE
STAFF WHERE DESIGINATION=;Junior attender’ AND DEPTID=’DP190’;
Select * from staff;
4.4)NORMALISATION
ormalization is a systematic approach of decomposing tables to
eliminate data redundancy(repetition) and undesirable characteristics like
Insertion, Update and Deletion Anomalies. It is a multi-step process that
puts data into tabular form, removing duplicated data from the relation
tables.

1)FIRST NORMAL FORM (1NF):-

For a table to be in the First Normal Form, It should only have


single(atomic) valued attributes/columns

2)SECOND NORMAL FORM(2NF):-


For a table to be in the Second Normal Form,

1. It should be in the First Normal form.


2. And, it should not have Partial Dependency.

3)Third Normal Form (3NF):-


A table is said to be in the Third Normal Form when,

1)It is in the Second Normal form.

2)And, it doesn't have Transitive Dependency

4)BOYCE AND CODD NORMAL FORM(BCNF):-

Boyce and Codd Normal Form is a higher version of the Third


Normal form. This form deals with certain type of anomaly
that is not handled by 3NF. A 3NF table which does not
have multiple overlapping candidate keys is said to be in
BCNF. For a table to be in BCNF, following conditions must
be satisfied:
 R must be in 3rd Normal Form
 and, for each functional dependency ( X → Y ), X should
be a super Key.
NORMALISATION OF :-
1)PATIENT TABLE:-
2)DOCTOR TABLE:-
3)EMPLOYEE TABLE:-
4)MEDICAL REPORT TABLE:-
5)ROOM TABLE:-
5.3)SQL Queries:-
1)JOIN
SELECT Department.HOD,Doctor.Doc_Name FROM Department
INNER JOIN Doctor ON Department.Dept_No=Doctor.Dept_No WHERE
Doc_Name='Raghavan’;

2)Prescribed_Medicines.Medi_Name,In_Patient_Prescription.Pat_ID
FROM Prescribed_Medicines
INNER JOIN In_Patient_Prescription ON
In_Patient_Prescription.Pres_ID=Prescribed_Medicines.Pres_ID
WHERE Pat_ID='P101';
3) SELECT Patient.Pat_Name,Test_Results.Result FROM Lab_Tests
INNER JOIN Patient ON Lab_Tests.Pat_ID=Patient.Pat_ID INNER
JOIN Test_Results ON Lab_Tests.Test_ID=Test_Results.Test_ID
WHERE Pat_Name='Mani';

4)SELECT Hospital_Bill.Bill_Amount,Patient.Pat_Name FROM


Hospital_Bill
INNER JOIN Patient ON Hospital_Bill.Pat_ID=Patient.Pat_ID WHERE
Bill_Amount>10000 AND Pat_Name='Steve';
NESTED:
1)SELECT HOD FROM department WHERE Dept_No = (SELECT
Dept_No FROM doctor WHERE Doc_Name = 'Raghavan');

2)SELECT * FROM patient WHERE Pat_ID = (SELECT Pat_ID FROM


in_patient WHERE Bed_No = 101);
3)SELECT * FROM prescribed_medicines WHERE Pres_ID IN
(SELECT Pres_ID FROM in_patient_prescription WHERE Pat_ID =
'P101');

4)SELECT * FROM test_results WHERE Test_ID = ( SELECT Test_ID


FROM lab_tests WHERE Pat_ID = ( SELECT Pat_ID FROM patient
WHERE pat_name = 'Mani'));
5.4)PL/SQL QUARIES :-
1)Write a PL/SQL program to practice reading the record from a table into
local variables using different data types and %TYPE and display the same
using locally declared variables.

CODE:-
DECLARE
p_id patient.PAT_ID%type := 'P101';
p_name patient.PAT_NAME%type;
p_addr patient.P_ADDRESS%type;
BEGIN
SELECT PAT_NAME, P_ADDRESS INTO p_name, p_addr
FROM patient
WHERE PAT_ID = p_id;
dbms_output.put_line
('Patient ' ||p_name || ' from ' || p_addr);
END;

INPUT:- OUTPUT:-
2)Write a PL/SQL program to find the number of doctors in a given department with
a given qualification (read values for department and qualification from user during
runtime). If number is more than the number of doctors in that department with
other qualifications then display ‘Well qualified’ else ‘Qualified’.

Code
Declare
DT_NAME varchar2(12):=&DT_NAME;
Qual varchar2(12):=&Qual;
QUAL_DOCT_CNT number; NON_QUAL_DOCT_CNT number;
begin
SELECT COUNT(1) INTO QUAL_DOCT_CNT FROM DOCTOR DR
INNER JOIN DEPARTMENT DT ON DR.D_DEPT_NO=DT.DEPT_NO
WHERE DT.DEPT_NAME=DT_NAME AND QUALIFICATION=Qual;

SELECT COUNT(1) INTO NON_QUAL_DOCT_CNT FROM DOCTOR DR


INNER JOIN DEPARTMENT DT ON DR.D_DEPT_NO=DT.DEPT_NO
WHERE DT.DEPT_NAME=DT_NAME AND QUALIFICATION<>Qual;

IF QUAL_DOCT_CNT>NON_QUAL_DOCT_CNT THEN
dbms_output.put_line('Well Qualified');
ELSE
dbms_output.put_line('Qualified'); END IF;
end;
3)Write a PL/SQL program to insert records into any of the tables in your database.
Code

set serveroutput on;


DECLARE
dno department.dept_no%type;
dname department.dept_name%type;
droom department.room_no%type;
dfloor department.floor%type;
dhod department.hod%type;
destd department.estd_date%type;
BEGIN
dno:='&dno';
dname:='&dname';
droom:='&droom';
dfloor:='&dfloor';
dhod:='&dhod';
destd:='&destd';
insert into department values(dno,dname,droom,dfloor,dhod,destd);
commit;
END;
/
Output
4) Create a function DOC_COUNT to find the number of
doctors in the given department. Use the department
name as the input parameter for the function.

set serveroutput on;


create or replace function
DOC_COUNT(dname VARCHAR) return
INT is
a number;
began;
select count(doc_id) into a from doctor,department where
doctor.d_dept_no=department.dept_no and dept_name=dname;/
set serveroutput on; declare
a number;
dname
department.dept_n
ame%type; begin
dname:='&dn
ame';
a:=DOC_CO
UNT(dname
);
DBMS_OUTPUT.PUT_LINE('Total Doctors
in given Department is '||a); end;
/
Functions and Procedures:
1. Write a PL/SQL stored function COUNT_DOC to
count the number of doctors who have treated at
least 100 patients if given a doctor id as input
parameter.
2) Write a PL/SQL stored procedure to adjust the payment type of
hospital bills to CASH if the patient id and amount details given as
input.

Code
set serveroutput on;
create or replace procedure ptype(p_id char,amt
number) is a hospital_bill.payment_type%type;
begin
update hospital_bill set payment_type='Cash' where i_pat_id=p_id and
bill_amount=amt; select payment_type into a from hospital_bill where
i_pat_id=p_id and bill_amount=amt; DBMS_OUTPUT.PUT_LINE('New
Payment_Type= '||a);
end;
/
exec ptype('&p_id',&amt);
Cursors:

1. Write a CURSOR to give 5% additional discount to all senior


citizen patients.

Code:-

set serveroutput on;

DECLARE

cursor pat is select * from Patient;

p pat%rowtype;

age decimal(5,2); BEGIN

open pat; loop

fetch pat into p;

exit

when pat%notfound;

age:=months_between(sysdate,p.p_dob )/12;

if(age>=60) then

update hospital_bill set discount=discount+5 where


i_pat_id=p.pat_id;

end if;

end loop;

close pat; END;

/
Output
Triggers:
1. Add an attribute with patients table to store the age of the
patients. Write a Trigger to find and fill the age of a patient
whenever a patient record is inserted into patients table.
alter table patient add age integer;
create or replace trigger
age_trigger before insert on patient
for each row when(1=1) declare p_age integer;
begin
p_age:=
trunc(months_between(sysdate, :new.ptdob)/12);
:new.age:
=p_age;
dbms_output.put_line('age calculatiion triggered');
end;
/
6. Screenshot (front end-with explanation):-
USED XAMPP CONTROL PANEL v3.2.4

A)LOGIN PAGE
B)REGISTERING A NEW PATIENT NAME –”NAVEEN’

C)NAVEEN NAME IS ADDED IIN MY DATA BASE


D)ADDING AN APPOINTMENT FOR NAVEEN

E)NAVEEN APPOINTMENT ACCEPTED BY DOCTOR:-


F)APPOINTMENT ADDED IN MY DATA BASE

G)CHANGING PASSWORD FOR NAVEEN


H)NAVEEN PASSWORD HAS BEEN UPDATED

I)DOCTOR UPLOADING PATIENT TREATMENT DETAILS:-


J)TREATMENT DETAILS UPDATED IN MY DATA BASE

7)CONCLUSION AND FUTURE WORK

7.1)CONCLUSION:-

HMS is essential for all healthcare establishments, be it hospitals, nursing


homes, health clinics, rehabilitation centres , dispensaries, or clinics. The
main goal is to computerized all the details regarding the patient and the
hospital. The installation of this healthcare software results in improvement
in administrative functions and hence better patient care, which is the prime
focus of any healthcare unit in easy way.

7.2) FUTURE WORK:-

You might also like