Hospital Management System Report
Hospital Management System Report
Table of Contents
1. Introduction
2. Objectives
3. ERD Representation
4. Database Schema with Integrity Constraints
5. Stored Procedures for DML Operations
6. User Roles and Privileges
7. Views for Data Access
8. DML Triggers
9. Usage of Indexes
10. DBA Roles and Responsibilities
11. Conclusion
1. Introduction
The Hospital Management System (HMS) is designed to streamline
healthcare processes by automating patient management.
The selected module focuses on managing patient details, doctor
assignments, appointments, and treatment records.
2. Objectives
- To create a robust database system for managing patient
information.
- To ensure data integrity, security, and optimized performance.
- To implement features like stored procedures, triggers, and views
for better functionality.
- To define and enforce database administration policies.
3. ERD Representation
The Entity-Relationship Diagram (ERD) for the Patient Management
System is as follows:
Entities:
- Patient: Stores patient information.
- Doctor: Stores doctor details.
- Appointment: Manages scheduling between patients and doctors.
- Treatment: Records diagnosis and prescriptions.
Relationships:
- Patient - Appointment: One-to-Many
- Doctor - Appointment: One-to-Many
- Appointment - Treatment: One-to-One
- Doctor Table:
CREATE TABLE Doctor (
DoctorID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(100) NOT NULL,
Specialty VARCHAR(50),
Contact VARCHAR(15) UNIQUE NOT NULL,
Availability BOOLEAN DEFAULT TRUE
);
- Appointment Table:
CREATE TABLE Appointment (
AppointmentID INT PRIMARY KEY AUTO_INCREMENT,
PatientID INT NOT NULL,
DoctorID INT NOT NULL,
AppointmentDate DATE NOT NULL,
Time TIME NOT NULL,
Status ENUM('Scheduled', 'Completed', 'Cancelled') DEFAULT
'Scheduled',
FOREIGN KEY (PatientID) REFERENCES Patient(PatientID),
FOREIGN KEY (DoctorID) REFERENCES Doctor(DoctorID)
);
8. DML Triggers
Example: Trigger for Updating Last Appointment Date
CREATE TRIGGER UpdateLastAppointment
AFTER INSERT ON Appointment
FOR EACH ROW
BEGIN
UPDATE Patient
SET LastAppointment = NEW.AppointmentDate
WHERE PatientID = NEW.PatientID;
END;
9. Usage of Indexes
Example: Adding Indexes for Faster Searches
CREATE INDEX idx_patient_name ON Patient(Name);
CREATE INDEX idx_appointment_date ON
Appointment(AppointmentDate);
11. Conclusion
The Patient Management System module in the Hospital Management
System meets the requirements for managing patient records and
appointments efficiently. The implementation of stored procedures,
triggers, and views ensures data integrity, ease of access, and
security. This project demonstrates the importance of well-designed
database systems in healthcare.