dbmsfinalisampdf
dbmsfinalisampdf
MANAGEMENT SYSTEM
A PROJECT REPORT
Submitted by
BACHELOR OF TECHNOLOGY
in
ARTIFICIAL INTELLIGENCE
i
SRM INSTITUTION OF SCIENCE AND TECHNOLOGY
KATTANKULATHUR-603203
BONAFIDE CERTIFICATE
Certified that this Course Project Report titled “PATIENT INFORMATION AND
HOSPITAL MANAGEMENT SYSTEM” is the bonafide work done by AAGAM
CHHAJER [RA2211047010110], DIVJOT SINGH MANCHANDA [RA2211047010131],
SOMAAN RAUNIYAR. [RA2211047010115], and AMAN SINGHAL [RA2211047010132]
of IIIrd Year/Vth Sem B. Tech (AI) who carried out under my supervision for the course
21CSE205P - DATABASE MANAGEMENT SYSTEM . Certified further, that to the best
of my knowledge, the work reported herein does not form part of any other work.
ii
ABSTRACT
The system also includes role-based access control, ensuring that only authorized
personnel can access specific data and safeguarding patient confidentiality in
compliance with healthcare data regulations. By integrating critical hospital
functions into one platform, this management system boosts operational efficiency,
improves interdepartmental communication, and ultimately supports a more
patient-centered approach to healthcare delivery.
iii
TABLE OF CONTENTS
6 CHAPTER 6: IMPLEMENTATION OF 10
CONCURRENCY CONTROL AND RECOVERY
MECHANISMS WITH POSTGRESQL
8 CHAPTER 8: RESULTS 16
10 CONCLUSION 21
11 FUTURE ASPECTS 23
12 APPENDIX 25
iv
PROBLEM STATEMENT
Furthermore, security and privacy concerns are paramount in healthcare due to the
sensitive nature of patient data. Existing systems may lack adequate data security,
putting institutions at risk of data breaches and compromising patient trust.
Compliance with regulatory standards such as HIPAA (in the United States) or
GDPR (in Europe) adds an additional layer of complexity to data management.
1
CHAPTER 1: Problem Understanding and
Entity-Relationship Model
2
The Patient entity is central to the Hospital Management System as it represents
individuals receiving care. Each patient is uniquely identified by a PatientID and
has attributes such as Name, Date of Birth (DOB), Blood Group, Address, City,
State, Country, and Phone Number. Patients have various interactions within the
hospital system. They undergo Lab Tests, which are recorded in the LabTest entity,
linked through the PatientID attribute. They are prescribed Medications as part of
their treatment, which is managed through a relationship where the Doctor
prescribes medications based on the patient’s diagnosis. Additionally, each patient
has insurance details recorded, which are managed by linking the Insurance entity
with the Patient entity to cover medical expenses. This insurance coverage is
captured by attributes such as Provider, Insurance Type, and InsuranceID. The
Patient entity also connects with Appointments and Medical Records, providing a
comprehensive view of their healthcare history.
The Doctor entity represents healthcare providers within the hospital. Each doctor
has a unique DoctorID, along with attributes such as Name, Specialization, and
3
Department, which indicate their area of expertise. Doctors have multiple
responsibilities, such as performing Diagnoses for patients, which are logged in the
Diagnosis entity and linked via DoctorID. The doctor’s work is organized by
Departments, ensuring that each doctor is associated with a particular department
like cardiology, oncology, or emergency medicine, which is represented in the
Department entity by attributes such as DepartmentID and Location. Doctors also
schedule and manage Appointments with patients, recording details like Date,
Time, and Room Number, ensuring structured patient-doctor interactions.
Furthermore, they provide Treatments as part of patient care, which are
documented in the Treatment entity with details like Treatment Name, Description,
Date, and DoctorID.
The LabTest entity records various medical tests conducted on patients. Each lab
test has a unique LabTestID and includes attributes such as TestName and
TestResult. The entity is linked to the Patient entity to document tests a patient has
undergone. Similarly, Medications prescribed by doctors are recorded in the
Medication entity, with each medication having attributes like MedicationName,
Dosage, and PatientID, which ties back to the patient receiving the medication.
The Insurance entity captures details of a patient’s health insurance coverage.
Attributes such as InsuranceID, Provider, Insurance Type, and Insurance Name
help manage financial aspects by connecting patients with their respective
insurance providers. This connection allows tracking of which treatments and
diagnoses are covered under a patient’s insurance plan, simplifying the billing and
claims process. The Bill entity is also associated with this, containing BillID,
Amount, LabTestID, and Appointment attributes to streamline financial
management and record all expenses related to patient care.
The Room entity represents hospital rooms and wards where patients may be
accommodated. Each room has attributes like RoomID, RoomType, and Capacity,
helping manage patient accommodation effectively. The Appointment entity tracks
scheduled visits between doctors and patients, containing attributes such as
AppointmentID, Date, Time, and Room Number. This entity ensures that patient
appointments are organized, minimizing scheduling conflicts.
Finally, Medical Records capture the entire history of a patient’s treatments,
diagnoses, and prescriptions. This entity is linked to both the Patient and Doctor
entities, ensuring a detailed log of each patient’s medical journey within the
4
hospital. The Treatment entity further supports this by documenting specific
treatments administered to patients, with details like Treatment Name, Date, and a
summary description.
This chapter discusses the design of relational schemas for a patient management
system, which includes defining entities, attributes, and relationships. The images
included provide visual examples of how data is structured within the database
tables, helping to understand the real-world layout of information.
5
Figure-2 shows the structure of the appointment table with fields like
appointment_id, patient_id, doctor_id, appointment_date, and reason_for_visit.
This table helps track patient visits and the reasons for their appointments,
facilitating scheduling and record-keeping.
The Patient Information section includes key data fields to uniquely identify and
categorize each patient within the hospital system. These fields include the Patient
ID, First Name, and Last Name, which together serve as the primary means of
patient identification. The Gender field is important for certain medical conditions
and considerations that may vary by gender. Additionally, the Address field
provides insight into the patient’s place of residence or, in some cases, their current
ward location within the hospital. This ensures that patients can be easily located
and communicated with, both within the hospital and post-discharge.
The Appointment Information section tracks the scheduling and purpose of each
visit to the hospital. It includes Appointment ID and Appointment Date, ensuring
each visit is uniquely identified and recorded for proper tracking and continuity of
care. The Reason for Visit field, such as "Pain" or "Eye Check", provides a quick
reference to the patient’s condition or complaint, which is essential for triaging and
prioritizing care based on urgency. This section also helps in aligning resources
(such as rooms and staff) to ensure efficient patient management.
The Room and Accommodation Details are crucial for managing patient
placements within the hospital. Information like Room ID, Room Number, and
Room Type (e.g., "General") helps to identify and manage patient occupancy in
various hospital rooms. Room Status indicates whether a room is currently
occupied, which is important for maintaining hospital capacity and efficiently
assigning rooms to incoming patients. This also helps ensure that available
6
resources are maximized, and patients are placed in suitable accommodations
based on their needs.
The Medical and Medication Information section tracks the clinical aspects of a
patient’s treatment. Nurse Allocation identifies the nurse assigned to a patient,
ensuring accountability and consistent care. The Medication Issued Status field,
such as "Ongoing" or "Completed", indicates whether a prescribed medication
course is being followed or has been completed. Dosage instructions associated
with each medication help healthcare providers track the treatment plan accurately.
This section plays a vital role in ensuring that patients are receiving the correct
treatment in a timely manner, contributing to effective medical outcomes.
The Contact Information section records the patient’s phone numbers, which may
include multiple contacts (such as family or emergency contacts). This ensures that
the hospital can reach the patient or their relatives in case of emergencies,
appointment reminders, or follow-up communication. Reliable contact information
is vital for maintaining communication throughout the patient’s treatment journey
and after discharge.
7
8
9
CHAPTER 3: Complex Queries
This next step after designing the relational schema is to model the complex
queries to retrieve data from these tables. Upon data retrieval, there are countless
use cases where multiple tables are needed to get the intended data for display. The
complex queries that utilize joins are illustrated below with the query along with
the table output.
10
3. UPDATING ENTRIES
5. INNER JOIN
11
6. LEFT JOIN
7. RIGHT JOIN
8. CROSS JOIN
12
9. CREATION OF VIEW
13
10. TRIGGER
14
CHAPTER 4: Analyzing the pitfalls, Identifying the
dependencies and applying normalizations
Normalization to 1NF:
The initial step in the normalization process involves transforming unnormalized data
into the First Normal Form (1NF). In the unnormalized version, multiple attributes are
often combined into one, leading to redundancy. For a patient database, this could include
multi-valued attributes such as contact numbers or addresses stored in a single column. In
n1NF, these multi-valued attributes are split into individual records, so each attribute has
a unique value within each table row. For example, a patient’s multiple contact numbers
would be separated into individual rows.
Once in 1NF, the tables are analyzed for Partial Dependencies to achieve Second Normal
Form (2NF). In a patient information system, partial dependencies may arise when
non-primary attributes (like patient age) are only partially dependent on a subset of the
primary key. By splitting the table, we ensure that each table represents a single concept,
such as separating patient contact details from their medical records.
15
patient’s primary physician is stored alongside their address and both fields depend on
patient ID, transitive dependency is removed by creating separate tables for patient
addresses and physicians, linked by foreign keys.
Normalization to 4NF:
In healthcare data, multi-valued Dependencies are common, especially for attributes like
phone numbers, emergency contacts, and addresses. In Fourth Normal Form (4NF), we
create separate tables for these multi-valued attributes, linking them to the patient ID as a
foreign key to remove redundancy and ensure data integrity.
16
CHAPTER 5: TRANSACTIONAL CONTROL
LANGUAGE
ACID Properties:
Atomicity: Ensures that all operations within a transaction are completed.
If any part fails, the entire transaction fails, and the database state remains
unchanged.
Consistency: Guarantees that a transaction takes the database from one
valid state to another, maintaining all rules, constraints, and relationships.
Isolation: Ensures that the operations in one transaction are not visible to
other concurrent transactions until they are complete.
Durability: Ensures that once a transaction has been committed, the
changes are permanent, even in the case of a system crash.
START TRANSACTION: Begins a new transaction. From this point on, any
SQL operations are considered part of the transaction until it is explicitly
ended by either committing or rolling back.
17
database.
ROLLBACK: Reverts the database back to its state at the beginning of the
transaction or to a specific savepoint, effectively undoing any changes
made in the transaction.
18
OUTPUT:
The amount didn't get deducted, and rollback happened as the required amount was
not present in the sender’s account.
19
20
OUTPUT:
This time there was sufficient balance, so the amount got deducted and there was
no rollback.
21
Chapter 6: Implementation of Concurrency Control
and Recovery Mechanisms with PostgreSQL
22
One of the core features is Write-Ahead Logging (WAL), which logs all changes to
the database before they are applied. This ensures that in the case of a system
crash, the database can be recovered by replaying the log, either committing or
rolling back transactions to maintain data integrity. For example, if a power failure
occurs while a patient's medical record is being updated, PostgreSQL uses WAL to
ensure that the transaction is either fully committed or rolled back, preventing
partial or corrupt data from being stored. Additionally, PostgreSQL supports
Point-in-Time Recovery (PITR), allowing the system to be restored to a specific
state at a particular time using archived WAL files. This feature is critical for
recovering from catastrophic failures or data corruption. For instance, if an
incorrect update is made to patient records, the system can roll back to the last
known good state, ensuring that erroneous data is not retained. PostgreSQL also
provides Hot Standby and Replication, allowing the database to maintain real-time
copies of itself. These replicas can take over in case the primary database fails,
ensuring minimal downtime and continuous access to patient data. Lastly,
automated backups can be scheduled to create snapshots of the database, ensuring
that even in the event of a failure, the most recent data is recoverable.
23
guarantees that the data remains consistent even in the event of concurrent
transactions. Moreover, tools like Point-in-Time Recovery (PITR), Hot Standby,
and Automated Backups ensure that the system remains available and recoverable,
with minimal downtime and data integrity maintained at all times.
24
25
CHAPTER 7 : CODE FOR THE PROJECT
// /pages/api/patients.js
try {
data: {
first_name,
last_name,
gender,
contact_number,
address,
},
});
res.status(200).json(newPatient);
} catch (error) {
26
console.error("Error creating patient:", error);
try {
where: { patient_id },
data: {
first_name,
last_name,
gender,
contact_number,
address,
},
});
res.status(200).json(updatedPatient);
} catch (error) {
27
}
} else {
// /pages/index.js
try {
if (patientId) {
// Update patient
} else {
28
await axios.post('api/patients', data);
} catch (error) {
console.error(error);
};
return (
<div>
<form onSubmit={handleSubmit(onSubmit)}>
<div>
<label>First Name:</label>
</div>
<div>
<label>Last Name:</label>
</div>
<div>
29
<label>Date of Birth:</label>
</div>
<div>
<label>Gender:</label>
</div>
<div>
<label>Contact Number:</label>
</div>
<div>
<label>Address:</label>
</div>
</form>
</div>
);
30
CHAPTER 8 : RESULTS
31
32
33
CONCLUSION
34
FUTURE ASPECTS
The future aspects of the Patient Information and Hospital Management System
(PIS/HMS) offer vast opportunities for transformation in healthcare delivery. One
major area is the integration of AI and machine learning. Predictive analytics could
be used to analyze patient data, enabling healthcare providers to foresee health
trends, patient conditions, and treatment outcomes, allowing for proactive care.
Additionally, AI could assist in clinical decision-making by suggesting diagnoses
and treatments based on historical patient data, as well as automate administrative
workflows such as appointment scheduling and medication tracking.
Another area for growth is the use of blockchain technology for enhanced data
security and interoperability. Blockchain can ensure data integrity and prevent
unauthorized access to sensitive patient records. It can also facilitate secure data
sharing across different healthcare systems, ensuring patient information is
accessible wherever and whenever needed, with full privacy compliance. This could
improve collaboration between healthcare providers while maintaining strict security
standards.
The rise of telemedicine and remote patient monitoring is also shaping the future of
PIS/HMS. Integration with telemedicine platforms could allow for virtual
consultations, improving access to care, especially in underserved areas.
Additionally, remote monitoring systems could be incorporated, using wearable
devices to track patients’ health in real-time and alert healthcare providers to any
anomalies, enabling quicker responses to emerging health issues.
In the context of cloud-based solutions and mobile access, the shift to cloud
technologies could offer greater scalability, easy access to patient data, and
collaboration opportunities across healthcare professionals. Patients could also
benefit from mobile apps that provide direct access to their medical records, lab
results, appointment scheduling, and more, improving patient engagement and
communication with healthcare providers.
Finally, enhanced patient experience will remain a focus. With patient empowerment
through self-service options for appointment management, bill payments, and direct
communication with healthcare providers, patients will have more control over their
35
healthcare journey. Real-time feedback systems could help hospitals continuously
improve patient care by responding to patient satisfaction and concerns.
These future advancements will not only make the Patient Information and Hospital
Management System more efficient but will also lead to better healthcare delivery,
improved patient outcomes, and greater accessibility to medical services.
36
APPENDIX : NPTEL PROGRESS REPORT
AMAN SINGHAL RA2211047010132
37
AAGAM CHHAJER RA2211047010110
38
SOMAAN RAUNIYAR RA2211047010115
39
DIVJOT SINGH MANCHANDA RA2211047010131
40