You are on page 1of 18

1.

0 INTRODUCTION

Hospital is an institution that providing medical and surgical treatment and nursing care
for sick or injured people that includes a number of departments, rooms, doctors, nurses,
compounders, and other staff working in the hospital. Nowadays, due to the advanced
technology, hospital no longer use paperwork to store patients’ information. They will store all
the appointment information in the system so that information can be accessed more quickly
when patients register at the registration counter. If the hospital is running manually for
registration, storing and payment method, they will eventually decrease the hospital’s overall
performance as well as efficiency. Moreover, it is easy to meet unavoidable errors by using
paperwork and misunderstandings might happen.

To avoid this problem, we are going to design a hospital management system (HMS).
Hospital management system is the system which is developed to limit usage of pen paper work
at the hospitals. It is the system that is used in the hospitals to maintain the records of the
patients, doctors, nurses and other hospital staffs.

The Hospital Management System can be accessed by using a username and


password.which is only can be access by an administrator or receptionist.Only they can add
data into the database. The data can be retrieved easily and the interface is very user-friendly.
The data are well protected for personal use and makes the data processing very fast. Hospital
Management System is powerful, flexible, and easy to use and is designed and developed to
deliver real conceivable advantage to the hospitals. Hospital Management System is designed
for multispecialty hospitals, to cover a wide range of hospital administration and management
processes. It is an integrated end-to-end Hospital Management System that provides relevant
information across the hospital to support effective decision making for patient care, hospital
administration and critical financial accounting, in a seamless flow. Hospital Management
System is a software product suite designed to improve the quality and management of hospital
management in the areas of clinical process analysis and activity-based costing. Hospital
Management System empower you to create your organization and improve its effectiveness
and quality of work. Managing the key processes efficiently is critical to the success of the
hospital helps you manage your processes

1
2.0 BUSINESS RULES

There are 5 entities and 8 business rules in the Entity Relationship Diagram (ERD).

- Each doctor has one or more appointments. (1:M)

- Each appointment is scheduled to exactly one doctor. (1:1)

- Each patient can have one or more appointments. (1:M)

- Each appointment is scheduled to exactly one patient. (1:1)

- Each appointment can have one or more bills. (1:M)

- Each bill is attached to only one appointment. (1:1)

- Different appointments can have many types of prescriptions. (M:N)

- Different types of medicines can have many types of prescriptions. (M:N)

2
3.0 ENTITY RELATIONSHIP DIAGRAM (ERD)

3
4.0 DATA DICTONARY

TABLE NAME ATTRIBUTE NAME CONTENT DATA TYPE FORMAT RANGE REQUIRED? PK FK
(YES/NO) OR FK REFERENCE
TABLE

Patient_ID the unique code VARCHAR(20) PC001 N/A YES PK


of patient
PATIENT
Patient_Fname Patient’s first CHAR(20) XXXXXX… N/A YES
name

Patient_Lname Patient’s last CHAR(20) XXXXXX… N/A YES


name

Appointment Details of VARCHAR(30) XXXXXX… N/A YES


patients’
appointment

Company_ID The unique code VARCHAR(20) C100 N/A YES FK COMPANY


of company

APPOINTMENT APPOINTMENT_ID The unique code VARCHAR(20) PA001 N/A YES PK


of patient’s
appointment
details

TIME Time appointed NUMBER(2,2) ##,## N/A YES


for patient to
meet doctor

DATE Date appointed DATE(2,2) ##,## N/A YES


for patient to
meet doctor

DOCTOR_ID The unique code VARCHAR(20) D002 N/A YES FK DOCTOR


of doctor

PATIENT_ID The unique code VARCHAR(20) PC001 N/A YES FK PATIENT


of patient

DOCTOR Doctor_ID The unique code VARCHAR(20) DC002 N/A YES PK


of doctor

Doctor_Fname Doctor’s first VARCHAR(20) XXXXXX… N/A YES


name

4
Doctor_Lname Doctor’s last VARCHAR(20) XXXXXX… N/A YES
name

Room_No Doctor’s NUMBER(4,0) XXXXXX… 1-9999 YES


specified room
number

COMPANY Company_ID The unique code VARCHAR(20) C100 N/A YES PK


of company

Company_Name The name of VARCHAR(20) XXXXXX… N/A YES


company

Company_Address The address of VARCHAR(40) XXXXXX… N/A YES


company

TREATMENT Treatment_ID The unique code VARCHAR(20) TC100 N/A YES PK


of treatment

Doctor_ID The unique code VARCHAR(20) DC002 N/A YES FK DOCTOR


of doctor

Patient_ID the unique code VARCHAR(20) PC001 N/A YES FK PATIENT


of patient

Appointment_ID The unique code VARCHAR(20) PA001 N/A YES FK APPOINTM


of patient’s ENT
appointment
details

Treatment_Description Detailed VARCHAR(20) XXXXXX… N/A YES


description
about patient’s
treatment

Doctor_Consultation_F The amount of NUMBER(5,2) #####,## 0.00- YES


ee doctor’s 99999.
consultation fee 99

MEDICATION Medicationrecord_ID The unique code VARCHAR(20) MC100 N/A YES PK


RECORD of patient’s
medication
record

Treatment_ID The unique code VARCHAR(20) TC100 N/A YES PK, FK TREATMEN
of treatment T

5
Medicine_name The name of VARCHAR(20) XXXXXX… N/A YES
medicine

Dosage The dosage of VARCHAR(10) XXXXXX… N/A YES


medicine

Price_of_medicine The price of NUMBER (3,2) ###,## 0.00- YES


medicine 999.99

BILL Bill_ID The unique code VARCHAR(20) BC100 N/A YES PK


of the patient’s
bill

Company_ID The unique code VARCHAR(20) C100 N/A YES FK COMPANY


of company

Total_Amount The total NUMBER(5,2) #####,## 0- YES


amount need to 99999.
be paid for 99
medication

Date The specific date DATE(10) ##/##/## N/A YES


of the bill

6
5.0 DATA DEFINITION LANGUAGE (DDL)

Data Definition Language (DDL) can be defined as a computer language which are
used to create, modify and also drop the structure of a database object in a database. We use
DDL to help create a table by using certain languages, such as ‘CREATE’, ‘ALTER’, and
‘DROP’. These database objects also include views, schemas and many more. These DDL
statements can be used to create tables by using Structured Query Language (SQL) in a website
called Oracle. Oracle helps to create tables, insert data and also to produce SQL statements to
communicate with the data.

In this assignment, we created the tables based on our ERD diagrams that we had
designed earlier. The table below shows the SQL commands that had been typed to create
tables about hospital management. The tables that have been created are doctor, company,
patient, appointment, treatment, medication record and bill.

NO. SQL COMMANDS TO CREATE TABLES

1. CREATE TABLE DOCTOR

DOCTOR_ID VARCHAR2(20) PRIMARY KEY,

DOCTORFNAME VARCHAR2(20) NOT NULL,

DOCTOR_LNAME VARCHAR2(20) NOT NULL,

ROOM_NO VARCHAR2(10) NOT NULL

);

2. CREATE TABLE COMPANY

COMPANY_ID VARCHAR2(20) PRIMARY KEY,

COMPANY_NAME VARCHAR2(20) NOT NULL,

7
COMPANY_ADDRESS VARCHAR2(50) NOT NULL

);

3. CREATE TABLE PATIENT

PATIENT_ID VARCHAR2(20) PRIMARY KEY,

PATIENT_FNAME VARCHAR2(30) NOT NULL,

PATIENT_LNAME VARCHAR2(30) NOT NULL,

APPOINTMENT_DATE DATE NOT NULL,

COMPANY_ID REFERENCES COMPANY(COMPANY_ID)

);

4. CREATE TABLE APPOINTMENT

APPOINTMENT_ID VARCHAR2(10) PRIMARY KEY,

APPOINTMENT_TIME TIMESTAMP(6) NOT NULL,

DOCTOR_ID REFERENCES DOCTOR(DOCTOR_ID)

PATIENT_ID REFERENCES PATIENT(PATIENT_ID)

);

5. CREATE TABLE TREATMENT

TREATMENT_ID VARCHAR2(10) PRIMARY KEY,

TREATMENT_DESCRIPTION VARCHAR2(30) NOT NULL,

DOCTOR_CONSULTATION_FEE NUMBER(10,0) NOT NULL,

8
DOCTOR_ID REFERENCES DOCTOR(DOCTOR_ID),

PATIENT_ID REFERENES PATIENT(PATIENT_ID),

APPOINTMENT_ID REFERENCES APPOINTMENT(APPOINTMENT_ID)

);

6. CREATE TABLE MEDICATION_RECORD

MEDICATION_RECORD_ID VARCHAR2(20) PRIMARY KEY,

MEDICINE_NAME VARCHAR2(20) NOT NULL,

DOSAGE VARCHAR2(10) NOT NULL,

PRICE_OF_MEDICINE NUMBER(20,0) NOT NULL,

TREATMENT_ID REFERENCES TREATMENT(TREATMENT_ID)

);

7. CREATE TABLE BILL

BILL_ID VARCHAR2(20) PRIMARY KEY,

TOTAL_AMOUNT NUMBER(20,0) NOT NULL,

BILL_DATE DATE NOT NULL,

COMPANY_ID REFERENCES COMPANY(COMPANY_ID)

);

9
6.0 DATA MANIPULATION LANGUAGE (DML)

1. DATA FOR TABLE DOCTOR


Script name: InsertDataDoctor

Row No. Data

1 insert into doctor values ('DC001','CHE AHMAD ANWAR','CHE


HUSAIN','A100');

2 insert into doctor values ('DC002','NORHAZIRAH','AHMAD


ZABIDI','A110');

3 insert into doctor values ('DC003','NURSYAKIRAH','KHARUL


PATTAH','A120');

RESULT:

DOCTOR ID DOCTOR FNAME DOCTOR LNAME ROOM NO.

DC001 CHE AHMAD ANWAR CHE HUSAIN A100

DC002 NORHAZIRAH AHMAD ZABIDI A110

DC003 NURSYAKIRAH KHARUL PATTAH A120

10
2. DATA FOR TABLE COMPANY
Script name: InsertDataCompany

Row No. Data

1 insert into company values ('CP001','CITY COMPANY','NO 98 JALAN


CEMPAKA, BATU BERENDAM');

2 insert into company values ('CP002','TOWN COMPANY','N0 12 JALAN


MELUR, AYER KEROH');

3 insert into company values ('CP003','SUPER COMPANY','NO 20 JALAN


MAHSURI, LANGKAWI');

4 insert into company values ('CP004','VILLAGE COMPANY','NO 58 JALAN


PANGLIMA, KLEBANG');

RESULT:

COMPANY ID COMPANY NAME COMPANY ADDRESS

CP001 CITY COMPANY N0 98 JALAN CEMPAKA,BATU BERENDAM

CP002 TOWN COMPANY NO 12 JALAN MELUR,AYER KEROH

CP003 SUPER COMPANY NO 20 JALAN MAHSURI,LANGKAWI

CP004 VILLAGE COMPANY NO 58 JALAN PANGLIMA,KLEBANG

11
3. DATA FOR TABLE PATIENT
Script name: InsertDataPatient

Row No. Data

1 insert into patient values ('PA001','HAYATI','ZAINUDDIN','01/28/2019','CP002');

2 insert into patient values ('PA002','DABBE','WICK','02/03/2019','CP004');

3 insert into patient values ('PA003','AHMED','ALBAB','03/16/2019','CP001');

4 insert into patient values ('PA004','JESSICA','LEE','04/15/2019','CP002');

5 insert into patient values ('PA005','KUMAR','SELVAN','05/10/2019','CP002');

RESULT:

PATIENT ID PATIENT PATIENT LNAME APPOINTMENT COMPANY_ID


FNAME DATE

PA001 HAYATI ZAINUDDIN 01/28/2019 CP002

PA002 DABBE WICK 02/03/2019 CP004

PA003 AHMED ALBAB 03/16/2019 CP001

PA004 JESSICA LEE 04/15/2019 CP003

PA005 KUMAR SELVAN 05/10/2019 CP002

12
4. DATA FOR TABLE APPOINTMENT
Script name: InsertDataAppointment

Row No. Data

1 insert into appointment values ('AP001','26/JAN/2019 10:01:12','DC001','PA001');

2 insert into appointment values ('AP002','02/FEB/2019 10:30:04','DC002','PA002');

3 insert into appointment values ('AP003','16/MAR/2019 12:25:56','DC003','PA003');

4 insert into appointment values ('AP004','15/APR/2019 11:10:34','DC002','PA004');

5 insert into appointment values ('AP005','05/MAY/2019 11:50:52','DC001','PA005');

RESULT:

APPOINTMENT TIME DATE DOCTOR ID PATIENT ID


ID

AP001 10:01 AM 01/28/2019 DC001 PA001

AP002 10:30 AM 02/03/2019 DC002 PA002

AP003 12:25 PM 03/16/2019 DC003 PA003

AP004 11:10 AM 04/15/2019 DC002 PA004

AP005 11:50 AM 05/20/2019 DC001 PA005

13
5. DATA FOR TABLE TREATMENT
Script name: InsertDataTreatment

Row No. Data

1 insert into treatment values ('TR001','HEADACHE',30.00,'DC001','PA001','AP001');

2 insert into treatment values ('TR002','COUGH',40.00,'DC002','PA002','AP002');

3 insert into treatment values ('TR003','STOMACH ACHE',25.00,'DC003','PA003','AP003');

4 insert into treatment values ('TR004','FLU',35.00,'DC002','PA004','AP004');

5 insert into treatment values ('TR005','DIARRHEA',42.00,'DC001','PA005','AP005');

RESULT:

TREATMENT TREATMENT DOCTOR DOCTOR PATIENT APPOINTMENT


ID DESCRIPTION CONSULTATION ID ID ID
FEE

TR001 HEADACHE 30.00 DC001 PA001 AP001

TR002 COUGH 40.00 DC002 PA002 AP002

TR003 STOMACH 25.00 DC003 PA003 AP003


ACHE

TR004 FLU 35.00 DC002 PA004 AP004

TR005 DIARRHEA 42.00 DC001 PA005 AP005

14
6. DATA FOR TABLE MEDICATION RECORD
Script name: InsertDataMedication_Record

Row No. Data

1 insert into medication_record values ('MR001','ASPIRIN','2MG',30.00,'TR001');

2 insert into medication_record values ('MR002','ROBITUSSIN


COUGH','4MG',22.00,'TR002');

3 insert into medication_record values


('MR003','ACETAMINOPHEN','3MG',36.00,'TR003');

4 insert into medication_record values ('MR004','TRIAMINIC


COLD','2MG',29.00,'TR004')

5 insert into medication_record values ('MR005','LOPERAMIDE','3MG',34.00,'TR005');

RESULT:

MEDICATION MEDICINE NAME DOSAGE PRICE OF TREATMENT ID


RECORD ID MEDICINE

MR001 ASPIRIN 2mg 30.00 TR001

MR002 ROBITUSSIN 4mg 22.00 TR002


COUGH

MR003 ACETAMINOPHEN 3mg 36.00 TR003

MR004 TRIAMINIC COLD 2mg 29.00 TR004

MR005 LOPERAMIDE 3mg 34.00 TR005

15
7. DATA FOR TABLE BILL
Script name: InsertDataBill

Row No. Data

1 insert into bill values ('BL001',60.00,'02/01/2019','CP002');

2 insert into bill values ('BL002',62.00,'02/05/2019','CP004');

3 insert into bill values ('BL003',61.00,'03/18/2019','CP001');

4 insert into bill values ('BL004',64.00,'04/17/2019','CP003');

5 insert into bill values ('BL005',76.00,'05/12/2019','CP002');

RESULT:

BILL_ID TOTAL_AMOUNT DATE COMPANY_ID

BL001 60.00 02/01/2019 CP002

BL002 62.00 02/05/2019 CP004

BL003 61.00 03/18/2019 CP001

BL004 64.00 04/17/2019 CP003

BL005 76.00 05/12/2019 CP002

16
7.0 DATA QUERY

17
8.0 CONCLUSION

18

You might also like