You are on page 1of 52

Class & Semester : B.

TECH (Computer Engineering) SEM IV


Course Name : Database Management System
Student Name : Abraham Shukla

Roll No. : 75
PRN : 2014110738
Academic Year : 2021-2022

PROJECT TITLE

Patient Health Record Management System

PROJECT DESCRIPTION

The project is a Patient Health Record Management System which mainly 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 retrieve these details as and when required, and 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
project includes registration of patients, storing their details into the system, and
computerized billing .

Objectives:

Designing and creating database to store information about the patient.

Scope of the project:

1) Recording information about the Patients that come.


2) Treating the patients
3) Conducting necessary lab tests.
4) Giving necessary diagnosis or treatment.
5) Generating Bills.
Tasks carried out to develop the project:

1) Defining requirements and objectives of project.


2) Laying out design of database.
3) Developing conceptual model
4) Developing logical model.
5) Creating the physical database.
6) Performing necessary operations.

APPROACH USED-

DATABASE LIFECYCLE-

INTRODUCTION-

The database life cycle is a cycle that traces the history of the database in an
information system. The database life cycle incorporates the necessary steps
involved in database development, starting with requirements analysis and ending
with monitoring and modification. The DBLC never ends because database
monitoring, improvement, and maintenance are part of the life cycle, and these
activities continue as long as the database is alive and in use.

DATABASE INTIAL STUDY-

The database development process begins with a general analysis of the


organization’s business functions, the scope, user groups involved in it, required
data, and examples of reports or existing documents. For this reason, it is
necessary to collect facts whose sources include interviews, observations, the
examination of various documents, such as forms, reports, and other related
archives. You can obtain points from multiple users through a questionnaire. By
collecting relevant facts, you can specify users’ data requirements wholly and
accurately.

In our project we begin analysis on patient record management system and gather
all the necessary information for our project i.e. attributes ,entities ,relationship
and all other relevant information.
Project Requirement- Store data related to patirent record .the following
attributes have been identified and will be used for storing the needed record.

List of attributes identified-

1. pid
2. pname
3. gender
4. city
5. state
6. contact
7. zip code
8. dob
9. did
10.d name
11.contact
12.address
13.department
14.expertise
15.d fees
16.lid
17.lab name
18.lab address
19.ltest ID
20.test name
21.test result
22.testdate
23.labtest fees
24.pres-id
25.med-id
26.medicine
27.m-amount
28.prescription
29.dosage
30.bill-id
31.bill-date
32.tax
33.billing amount
34.total cost
Database Design-

Based on the results of the data requirements analysis, carry out the design
process. There are two database design approaches, namely:
• The top-down design uses an entity-relationship (ER) model. The design
begins with identifying entities, followed by relationships between entities
and cardinality or multiplicity. Each entity consists of attributes, primary
keys, and foreign keys (if any).
• The bottom-up design uses the process of normalization. Design starts with
identifying attributes, then grouping them into data sets to form relations.
The two approaches are complementary. The design process begins with
conceptual data modeling and continues to the logical database design and
physical database design stages. The ER model is used in the conceptual data
modeling stage. In the early ER model, normalization was carried out on entities
or relationships with multiple data attributes. The normalization results are used
to modify the initial ER model to obtain a better final ER model. In the logical
database design stage, normalization is carried out on the mapping result relations
of ER modeling, which has multiple data. The two approaches are
complementary. The design process begins with conceptual data modeling and
continues to the logical database design and physical database design stages. The
conceptual data modeling uses the ER model. In the early ER model, carry out
normalization on entities or relationships that have data redundancies. Use the
normalization results to obtain a better final ER model.

Conceptual Data Modeling-

Conceptual data modeling is free from implementation, hardware, software,


operating systems, DBMS, application programs, programming languages, etc.
Later, it can be implemented on any platform. Conceptual data modeling using
the entity-relationship (ER) model must represent existing business functions in
the organization and describe the users’ data requirements entirely and accurately.

• Develop the view of data


• We have identified entities and attributes
• Develop the er diagram for our project
• Performed normalisation
• Validate the er diagram
BEFORE NORMALISATION-
AFTER-NORMALISATION -

E-R DIAGRAM-

You will see the conceptual design in the project.

Selection of software-

• After laying out the design of database we need to select software inwhich we
will develop the project.
• So in our project we are using mysql community server.
Logical Database Design

• Based on the conceptual data model and mapping rules, every entity and
relationship with attributes are converted into relations. Relationships that
have attribute groups with data redundancies result in anomalies when
adding, updating, or deleting data. Such tables need to be normalized, at least
up to 3NF (third normal form). Each relation attribute is determined by its
data type and domain, including whether the data must be unique or not. The
result is a specification for each relation.
• In this we have normalized our database till 3nf and then on the basis of 3nf
we have developed our relations and final database.
• After that we have created table and defined our table datatypes and
constraints.
• Constraints like primary key,not null etc.

Database Implementation and loading-

• In database implementation we have developed our databases on the basis of


relations we have obtained after normalization.
• Then we dump some data in our database.

Test the database-


• After creating the database we need to check the database whether its
working properly or not all the constraints are defined or not and queries are
executing properly or not. Whether we can perform insertion,deletion and
updation without any problem or not.

Opertation-
• Performing the required operartion like insertion and creation and
performing the sql queries to obtain result from our database.
Database Maintenance

• When the database comes into operation, monitoring is carried out to see
if performance requirements are being met; whether user expectations
increase with demands for better performance. If not, modifications must
be made to improve performance.
NORMALIZATION-

Normalization is the process of minimizing redundancy from a relation or


set of relations. Redundancy in relation may cause insertion, deletion, and
update anomalies. So, it helps to minimize the redundancy in
relations. Normal forms are used to eliminate or reduce redundancy in
database tables.

DATABASE TABLE-
THE BELOW TABLE IS OUR ORIGINAL TABLE AS IT IS VERY LARGE
WE CAN’T SEE THE TABLE CONTENTS SO WE HAVE BREAKED THE
ORIGINAL TABLE INTO SMALLER TABLE SO THAT IT IS VISIBLE.

PID PNAME GENDER CONTACT CITY STATE ZIPCODE DOB


1 JOHN MALE 12345 ROCHESTER YORK 1462 12-04-1990
2 TOM MALE 67891 PRINCETON JERSEY 8540 05-02-1997
3 CHRIS MALE 55555 CAMBRIDGE PERTH 6000 05-01-1985
4 JACK MALE 54545 ALEXANDRIA SDYNEY 2000 07-07-1989
5 ROBIN FEMALE 35798 HOPPEGARTEN BERLIN 1115 02-02-2000
6 JOHN MALE 16789 YOKOHAMA TOKYO 1001 16-06-1995
7 ROBERT MALE 28937 NEW YORK NEW YORK 5001 18-08-2005
8 BRAD MALE 33221 MANDOLI DELHI 1101 25-04-1996
MYEONG-
9 MARK MALE 12987 DONG SEOUL 1021 27-04-1990
10 DWAYNE MALE 94689 TORONTO ONTARIO 5001 15-04-1995
DID DNAME EXPERTISE DEPARTMENT LOCATION CONTACT ADDRESS
101 MIKE UROLOGISTS UROLOGY 98889 DELHI
102 HENRY ORTHOPAEDIC ORTHOLOGIST 87778 PUNE
103 MIACHEL NEUROLOGIST NEUROSURGEON 76667 ORGEGON
104 SONNY ENT ENT SPECALIST 43334 BRISBANE
105 LEE GASTROENTEROLOGY GASTROENTEROLOGY 54345 AUCKLAND
106 ARTHUR PSYCHIATRISTS PSYCHIATRT 31123 SEOUL
107 HARVEY CARDIOTHORACIC CARDIOLOGIST 49594 OHIO
NEW
108 PAUL ENT ENT SPECALIST 49594 JERSEY
109 ALFRED HEMATOLOGISTS HEMATOLOGY 54345 TEXAS
110 THEODOR DENTIST DENTISTRY 93696 CALIFORNIA

LID LAB_ADDRESS LABNAME LTEST-ID TESTNAME TEST - RESULT TEST-DATE


201 DELHI PUVT 501 URINE NORMAL 05-01-2022
ANKLE-
202 PUNE NEURO 502 XRAY HAIRLINE-CRACK 10-01-2022
202 PUNE NEURO 503 MRI NORMAL 19-01-2022
LOW HEARING-
203 HYD ENT-LAB 504 EAR LOSS 05-01-2022
204 BANGLORE GAESTRO 505 GAESTRIC NORMAL 25-01-2022
204 NULL NULL 506 NO-TEST NO RESULT 05-01-2022
205 PUNJAB PUVT 507 VITAMIN LOW B12 02-02-2022
203 HYD ENT-LAB 508 NOSE ASTHAMA 19-02-2022
205 PUNJAB PUVT 509 PLATELET LOW 02-02-2022
205 PUNJAB PUVT 510 CALCIUM LOW CALCIUM 28-01-2022
MED-ID PRES-ID MEDICINE PRESCRIPTION DOSAGE
1001 301 NULL NULL 0
1002 302 DOLO-650 PAINKILLER 4
1003 303 NULL NULL 0
1004 304 COMBIFLAME PAINKILLER 2
REDUCE
1005 305 DIGINE ACIDITY 1
1006 306 NULL NULL 0
NEUROBION-
1007 307 20 VITAMIN SUPP. 4
1008 308 FLUCTICASONE BREATHING 2
1009 309 PREDNISONE INC. PLATELET 4
CALCIUM
1010 310 SUPP. INC.CALCIUM 1
FUNCTIONAL DEPENDENCIES->
PID->PNAME
PID,PNAME->DOB
PID AND PNAME->ADDRESS
PID AND PNAME->CONTACT
DID->DNAME
DID AND DNAME->FOS
DID AND DNAME->CONTACT
DID->DEPARTMENT
LID->LNAME
LID->LTEST-ID
LTEST-ID->TESTNAME
LTEST-ID->TEST RESULT
LTEST-ID->TEST DATE
DID->LTESTID
PID->LTESTID
PRES-ID->MED-ID
PID ,DID,>PRES-ID
MED ID AND PID->DOSAGE
PRES-ID->PURPOSE
MED -ID->PRICE
DID->D.FEES
LTEST-ID->LABCOST
MED-ID->MEDICINE AMOUNT
BID->TOTAL COST
BID AND DID AND PID->TOTAL COST
1NF-
If a relation contain composite or multi-valued attribute, it violates first normal form or a
relation is in first normal form if it does not contain any composite or multi-valued
attribute. A relation is in first normal form if every attribute in that relation is singled
valued attribute.

So in our case our data is already in first normal form so we have no need to convert data into
first normal form and we can directly move to second normal form.

PID PNAME
GENDER CONTACT CITY STATE ZIPCODE DOB
1 JOHNMALE 12345 ROCHESTER YORK 1462 12-04-1990
2 TOM MALE 67891 PRINCETON JERSEY 8540 05-02-1997
3 CHRIS
MALE 55555 CAMBRIDGE PERTH 6000 05-01-1985
4 JACKMALE 54545 ALEXANDRIA SDYNEY 2000 07-07-1989
5 ROBIN
FEMALE 35798 HOPPEGARTEN BERLIN 1115 02-02-2000
6 JOHNMALE 16789 YOKOHAMA TOKYO 1001 16-06-1995
7 ROBERT
MALE 28937 NEW YORK NEW YORK 5001 18-08-2005
8 BRADMALE 33221 MANDOLI DELHI 1101 25-04-1996
MYEONG-
9 MARK MALE 12987 DONG SEOUL 1021 27-04-1990
10 DWAYNE MALE 94689 TORONTO ONTARIO 5001 15-04-1995
DEPARTMENT
DID DNAME EXPERTISE LOCATION CONTACT ADDRESS
101 MIKE UROLOGISTS UROLOGY 98889 DELHI
102 HENRY ORTHOPAEDIC ORTHOLOGIST 87778 PUNE
103 MIACHEL NEUROLOGIST NEUROSURGEON 76667 ORGEGON
104 SONNY ENT ENT SPECALIST 43334 BRISBANE
105 LEE GASTROENTEROLOGY GASTROENTEROLOGY 54345 AUCKLAND
106 ARTHUR PSYCHIATRISTS PSYCHIATRT 31123 SEOUL
107 HARVEY CARDIOTHORACIC CARDIOLOGIST 49594 OHIO
NEW
108 PAUL ENT ENT SPECALIST 49594 JERSEY
109 ALFRED HEMATOLOGISTS HEMATOLOGY 54345 TEXAS
110 THEODOR DENTIST DENTISTRY 93696 CALIFORNIA

LTEST-
LID LAB_ADDRESS LABNAME ID TESTNAME TEST - RESULT TEST-DATE
201 DELHI PUVT 501 URINE NORMAL 05-01-2022
ANKLE- HAIRLINE-
202 PUNE NEURO 502 XRAY CRACK 10-01-2022
202 PUNE NEURO 503 MRI NORMAL 19-01-2022
LOW HEARING-
203 HYD ENT-LAB 504 EAR LOSS 05-01-2022
204 BANGLORE GAESTRO 505 GAESTRIC NORMAL 25-01-2022
204 NULL NULL 506 NO-TEST NO RESULT 05-01-2022
205 PUNJAB PUVT 507 VITAMIN LOW B12 02-02-2022
203 HYD ENT-LAB 508 NOSE ASTHAMA 19-02-2022
205 PUNJAB PUVT 509 PLATELET LOW 02-02-2022
205 PUNJAB PUVT 510 CALCIUM LOW CALCIUM 28-01-2022
MED-ID PRES-ID MEDICINE PRESCRIPTION DOSAGE
1001 301 NULL NULL 0
1002 302 DOLO-650 PAINKILLER 4
1003 303 NULL NULL 0
1004 304 COMBIFLAME PAINKILLER 2
REDUCE
1005 305 DIGINE ACIDITY 1
1006 306 NULL NULL 0
1007 307 NEUROBION-20 VITAMIN SUPP. 4
1008 308 FLUCTICASONE BREATHING 2
1009 309 PREDNISONE INC. PLATELET 4
1010 310 CALCIUM SUPP. INC.CALCIUM 1
Second Normal Form –

To be in second normal form, a relation must be in first normal form and relation must not
contain any partial dependency. A relation is in 2NF if it has No Partial
Dependency, i.e., no non-prime attribute (attributes which are not part of any candidate
key) is dependent on any proper subset of any candidate key of the table.
Partial Dependency – If the proper subset of candidate key determines non-prime
attribute, it is called partial dependency.

DID DNAME CONTACT EXPERTISE DEPARTMENT ADDRESS D.FEES


101 MIKE 98889 UROLOGISTS UROLOGY DELHI 500
102 HENRY 87778 ORTHOPAEDIC ORTHOLOGIST PUNE 200
103 MIACHEL 76667 NEUROLOGIST NEUROSURGEON ORGEGON 350
104 SONNY 43334 ENT ENT SPECALIST BRISBANE 400
105 LEE 54345 GASTROENTEROLOGY GASTROENTEROLOGY AUCKLAND 1050
106 ARTHUR 31123 PSYCHIATRISTS PSYCHIATRT SEOUL 900
107 HARVEY 49594 CARDIOTHORACIC CARDIOLOGIST OHIO 1000
108 PAUL 49594 ENT ENT SPECALIST NEW 300
JERSEY
109 ALFRED 54345 HEMATOLOGISTS HEMATOLOGY TEXAS 400
110 THEODOR 93696 DENTIST DENTISTRY CALIFORNIA 250
PRES-ID PID MED-ID MEDICINE PRESCRIPTION DOSAGE M.AMOUNT
301 1 1001 NULL NULL 0 0
302 2 1002 DOLO-650 PAINKILLER 4 150
303 3 1003 NULL NULL 0 0
304 4 1004 COMBIFLAME PAINKILLER 2 160
REDUCE
305 5 1005 DIGINE ACIDITY 1 70
306 6 1006 NULL NULL 0 0
VITAMIN
307 7 1007 NEUROBION-20 SUPP. 4 140
308 8 1008 FLUCTICASONE BREATHING 2 50
309 9 1009 PREDNISONE INC. PLATELET 4 90
310 10 1010 CALCIUM SUPP. INC.CALCIUM 1 400
DID BID PID LTEST- BILL DATE BILLING AMOUNT TAX TOTAL COST
ID
101 901 1 501 05-01- 1500 50 1550
2022
102 902 2 502 10-01- 1900 100 2000
2022
103 903 3 503 19-01- 1550 15 1565
2022
104 904 4 504 05-01- 3060 60 3120
2022
105 905 5 505 25-01- 2720 200 2920
2022
106 906 6 506 05-01- 900 70 970
2022
107 907 7 507 02-02- 2990 80 3070
2022
108 908 8 508 19-02- 850 120 970
2022
109 909 9 509 02-02- 1290 110 1400
2022
110 910 10 510 28-01- 1950 100 2050
2022
3nf-
A relation is in third normal form, if there is no transitive dependency for non-prime
attributes as well as it is in second normal form.
A relation is in 3NF if at least one of the following condition holds in every non-trivial
function dependency X –> Y
1. X is a super key.
2. Y is a prime attribute (each element of Y is part of some candidate key).

DID DNAME DEPARTMENT LOCATION


101 MIKE UROLOGY
102 HENRY ORTHOLOGIST
103 MIACHEL NEUROSURGEON
104 SONNY ENT SPECALIST
105 LEE GASTROENTEROLOGY
106 ARTHUR PSYCHIATRT
107 HARVEY CARDIOLOGIST
108 PAUL ENT SPECALIST
109 ALFRED HEMATOLOGY
110 THEODOR DENTISTRY
DID EXPERTISE D.FEES
101 UROLOGISTS 500
102 ORTHOPAEDIC 200
103 NEUROLOGIST 350
104 ENT 400
105 GASTROENTEROLOGY 1050
106 PSYCHIATRISTS 900
107 CARDIOTHORACIC 1000
108 ENT 300
109 HEMATOLOGISTS 400
110 DENTIST 250

DID DNAME CONTACT ADDRESS


101 MIKE 98889 DELHI
102 HENRY 87778 PUNE
103 MIACHEL 76667 ORGEGON
104 SONNY 43334 BRISBANE
105 LEE 54345 AUCKLAND
106 ARTHUR 31123 SEOUL
107 HARVEY 49594 OHIO
108 PAUL 49594 NEW JERSEY
109 ALFRED 54345 TEXAS
110 THEODOR 93696 CALIFORNIA

LID PID LTEST-ID TESTNAME TEST - RESULT TEST-DATE LAB FEES


201 1 501 URINE NORMAL 05-01-2022 1000
202 2 502 ANKLE- HAIRLINE-CRACK 10-01-2022 1550
XRAY
202 3 503 MRI NORMAL 19-01-2022 1200
203 4 504 EAR LOW HEARING-LOSS 05-01-2022 2500
204 5 505 GAESTRIC NORMAL 25-01-2022 1600
204 6 506 NO-TEST NO RESULT 05-01-2022 0
205 7 507 VITAMIN LOW B12 02-02-2022 1850
203 8 508 NOSE ASTHAMA 19-02-2022 500
205 9 509 PLATELET LOW 02-02-2022 800
205 10 510 CALCIUM LOW CALCIUM 28-01-2022 1300
PRES-ID PRESCRIPTION DOSAGE MED-ID DID
301 NULL 0 1001 101
302 PAINKILLER 4 1002 102
303 NULL 0 1003 103
304 PAINKILLER 2 1004 104
305 REDUCE 1 1005 105
ACIDITY
306 NULL 0 1006 106
307 VITAMIN 4 1007 107
SUPP.
308 BREATHING 2 1008 108
309 INC. PLATELET 4 1009 109
310 INC.CALCIUM 1 1010 110

LID LTEST-ID LABNAME LAB_ADDRESS


201 501 PUVT DELHI
202 502 NEURO PUNE
202 503 NEURO PUNE
203 504 ENT-LAB HYD
204 505 GAESTRO BANGLORE
204 506 NULL NULL
205 507 PUVT PUNJAB
203 508 ENT-LAB HYD
205 509 PUVT PUNJAB
205 510 PUVT PUNJAB
MED-ID MEDICINE M.AMOUNT
1001 NULL 0
1002 DOLO-650 150
1003 NULL 0
1004 COMBIFLAME 160
1005 DIGINE 70
1006 NULL 0
1007 NEUROBION-20 140
1008 FLUCTICASONE 50
1009 PREDNISONE 90
1010 CALCIUM SUPP. 400
LOGICAL DESIGNS-

PATIENT-
• PID (PRIMARY KEY)
• DID(FOREIGN KEY)
• PRES ID(FOREIGN KEY)
• PNAME
• GENDER
• CONTACT
• CITY
• STATE
• ZIPCODE
• DOB
D_INFO-
• DID(PRIMARY KEY)
• DNAME
• CONTACT
• ADDRESS
D_DEPARTMENT-
• DID (PRIAMRY KEY)
• DNAME
• DEPARTMENT LOCATION

D_FEES
• DID(PRIMARY KEY)
• EXPERTISE
• FEES

LABTEST
• LTEST ID(PRIMARY KEY)
• LID
• PID(FOREIGN KEY)
• TEST NAME
• TEST RESULT
• TEST DATE
• LABFEES
PRES
• PRES ID(PRIMARY KEY)
• PRESCRIPTION
• DOSAGE

LAB
• LID
• LTEST ID(PRIMARY KEY)
• LABNAME
• LAB ADDRESS

MEDICINE
• MED ID(PRIMARY KEY)
• MEDICINE
• M.AMOUNT

BILL
• PID(FOREIGN KEY)
• DID(FOREIGN KEY)
• BID(PRIMARY KEY)
• BILL DATE
• LABFEES
• M_AMOUNT
• D_FEES
• TAX
• BILLING AMOUNT
• TOTAL COST
BUILDING INDEXES->

Patient->

D_info->
d-department->

D_fees->
labtest->

Lab->
Medicine->

Prescription->
bill->
DEVELOPING THE PHYSICAL DATABASE
TABLE CREATION AND DUMPING DATA-
PATIENT-
• PID (PRIMARY KEY)
• DID(FOREIGN KEY)
• PRES ID(FOREIGN KEY)
• PNAME
• GENDER
• CONTACT
• CITY
• STATE
• ZIPCODE
• DOB
D_INFO-
• DID(PRIMARY KEY)
• DNAME
• CONTACT
• ADDRESS
D_DEPARTMENT-
• DID (PRIAMRY KEY)
• DNAME
• DEPARTMENT LOCATION

D_FEES
• DID(PRIMARY KEY)
• EXPERTISE
• FEES

LABTEST
• LTEST ID(PRIMARY KEY)
• LID
• PID(FOREIGN KEY)
• TEST NAME
• TEST RESULT
• TEST DATE
• LABFEES
PRES
• PRES ID(PRIMARY KEY)
• PRESCRIPTION
• DOSAGE

LAB
• LID
• LTEST ID(PRIMARY KEY)
• LABNAME
• LAB ADDRESS

MEDICINE
• MED ID(PRIMARY KEY)
• MEDICINE
• M.AMOUNT

BILL
• PID(FOREIGN KEY)
• DID(FOREIGN KEY)
• BID(PRIMARY KEY)
• BILL DATE
• LABFEES
• M_AMOUNT
• D_FEES
• TAX
• BILLING AMOUNT
• TOTAL COST
D_info->

D_department->
D_fees->
Prescription->
Medicine->
Patient->
Labtest->
Lab->
Bill->
FINAL TABLES->
D_info->

D_department->
D_fees->

Medicine->
Prescription->

Patient->
Labtest->

Lab->
Bill->
QUERIES-

You might also like