Hospital Management System
Author: Dana Dvorcakova Date: 25/01/2026 Link Render: https://hospital-management-system-2-zpum.onrender.com Link Github: https://danadvorcakova.github.io/Hospital-Management-System/
Render Database Host name/address: dpg-d5pukpf5r7bs738m9oj0-a.frankfurt-postgres.render.com Port: 5432 Maintenance database: hospital_db_v57t Username: hospital_db_v57t_user Password: 6mYkKVljqO8kxDqPWTOmxWgT2p72TCJ2
OVERVIEW The Small Clinic Management System is designed to help clinics efficiently manage doctors, patients, and appointments in a centralized digital platform. It enables administrators to oversee clinic operations, doctors to manage consultations and medical records, and patients to book appointments and access their treatment information. The system improves organization, reduces paperwork, and enhances the overall quality of patient care.
FEATURES Role-based access: Admin / Doctor / Patient CRUD operations for doctors, patients, appointments, and medical records Audit logging for key actions Paginated views for large datasets
JavaScript: Live table search (rows hide/show as typing) Column-base filtering with dropdowns Dynamic appointment status chart Confirmation modals to delete/cancel actions Auto-dismiss flash messages Typewritter effect in search bars
DATABASE
Database Usage: SQLite is used for local development and testing. PostgreSQL is used in production when deployed on Render.com.
PERSONAS Admin Doctor Patient Appointment Medical Record Diagnosis Prescription Audit Log
ENTITIES AND ATTRIBUTES
USER STORIES:
AUTHENTICATION & ACCESS
As a user (Admin/Doctor/Patient) I want to log in using my username and password So that I can securely access the system based on my role.
As a logged-in user I want to log out of the system So that my account remains secure.
ADMIN USER STORIES
As an Admin I want to view the list of all doctors So that I can manage clinic staff.
As an Admin I want to add a doctor to the system So that patients can book appointments with them.
As an Admin I want to update doctor details So that information remains accurate.
As an Admin I want to delete a doctor from the system So that inactive or resigned doctors are removed.
As an Admin I want to view all registered patients So that I can monitor clinic activity.
As an Admin I want to update patient details So that information remains accurate.
As an Admin I want to delete a patient account So that inactive or duplicate patient records are removed.
As an Admin I want to view a dashboard with key statistics So that I can quickly monitor system activity.
As an Admin I want to view a paginated list of audit logs So that I can review all relevant details.
As an Admin I want to delete audit log records So that I can remove old unnecessary details.
DOCTOR USER STORIES
As a Doctor I want to view my scheduled appointments So that I can manage my daily consultations.
As a Doctor I want to view patient details for an appointment So that I can understand the patient’s medical background.
As a Doctor I want to add diagnosis and prescription So that patient treatment is properly documented.
As a Doctor I want to edit diagnosis and prescription So that patient treatment is properly documented.
As a Doctor I want to view a patient’s medical history So that I can provide better treatment.
PATIENT USER STORIES
As a Patient I want to register an account So that I can access clinic services online.
As a Patient I want to book an appointment with a doctor So that I can receive medical consultation
As a Patient I want to view my appointment status So that I know whether it is pending or completed.
As a Patient I want to view my diagnosis and prescription So that I can follow the doctor’s advice.
As a Patient I want to update my personal information So that my records stay current.
As a Patient I want to cancel my appointment So that I can reschedule if needed.
SECURITY & SYSTEM STORIES
As a system I want to restrict access based on user roles So that sensitive data is protected.
As a system I want to validate all inputs So that incorrect or malicious data is prevented.
RELATIONSHIPS
User → Doctor: 1:1 (a user can be a doctor) User → Patient: 1:1 (a user can be a patient) Admin (User with role=admin) → Doctor: 1:N (manages multiple doctors) Doctor → Appointment: 1:N (a doctor has many appointments) Patient → Appointment: 1:N (a patient books many appointments) Appointment → MedicalRecord: 1:1 (each appointment has one medical record) Doctor → MedicalRecord: 1:N (a doctor creates/updates multiple records) Doctor/Patient → MedicalRecord via Appointment (indirect relationship) User → AuditLog: 1:N (tracks all actions performed by users)
ER DIAGRAMs static/image/erd1.png static/image/erd2.png
TEST CREDENTIAL (admin, doctor, patient) User • Username: admin • Password: admin123 Patients • Username: bob • Password: 123 • Username: ella • Password: 123 Doctor DR. Smith • Username: dr_smith • Password: 123 • Username: dr_walsh • Password: 123
PROJECT FOLDER STRUCTURE
HOSPITAL-MANAGEMENT-SYSTEM/ # Main project folder │ ├── pycache/ # Python cache files (auto-generated) │ ├── .venv/ # Virtual environment directory for Python dependencies │ ├── instance/ # Instance folder for configuration & database │ ├── hospital.db # SQLite database file │ └── requirements.txt # Python dependencies │ ├── static/ # Static files (CSS, images, JavaScript) │ ├── css/ # CSS folder │ │ └── style.css # Stylesheet for the application │ ├── image/ # Image folder for app visuals │ │ ├── clinic.jpg # Clinic image for branding │ │ ├── erd1.png # ER diagram image 1 │ │ └── erd2.png # ER diagram image 2 │ └── js/ # JavaScript folder │ └── main.js # JavaScript for client-side functionality │ ├── templates/ # HTML templates for rendering views │ ├── components/ # Reusable components │ │ ├── pagination.html # Pagination controls for lists │ │ └── search_bar.html # Search bar for filtering │ ├── admin_audit.html # Admin audit log view │ ├── admin_doctors.html # Admin doctors management view │ ├── admin_patient_edit.html # Edit patient info (admin) │ ├── admin_patients.html # Admin patients management view │ ├── appointment_edit.html # Appointment editing view │ ├── appointment_new.html # New appointment creation view │ ├── base.html # Base template with common layout │ ├── doctor_appointments.html # Doctor’s appointments overview │ ├── doctor_edit.html # Doctor profile editing view │ ├── doctor_new.html # New doctor registration │ ├── doctor_patient_detail.html # Details of patient for doctor │ ├── doctor_patients.html # List of patients for doctor │ ├── doctor_records.html # Doctor’s medical records view │ ├── index.html # Homepage or landing page │ ├── login.html # User login page │ ├── patient_appointments.html # Patient’s appointments view │ ├── patient_profile.html # Patient profile view │ ├── patient_records.html # Patient medical records view │ ├── record_edit.html # Edit medical record view │ ├── record_new.html # New medical record creation view │ └── register.html # User registration page │ ├── app.py # Main Flask application file ├── config.py # Configuration settings for the app ├── models.py # Database models using SQLAlchemy ├── README.md # Project documentation
DOCTOR AND PATIENT WORKFLOW Doctor Initial Appointment Status - Upcoming When an appointment is created, it is set to Upcoming status. In this status, there are no available actions for the doctor. Status Transition to Pending On the day of the appointment, the status changes to Pending. At this point, the doctor can take action by selecting Add Record to document details about the appointment. Status Transition to Completed Once the doctor has added a record, the appointment status is automatically updated to Completed. In this status, the doctor can still take action by selecting Edit, allowing them to update the record or add additional notes if necessary.
Patient Initial Appointment Status - Pending When an appointment is created, it is set to Pending status. In this status, the patient has the ability to Edit or Cancel the appointment, allowing them to make changes or cancel it if necessary. These actions are available until the scheduled time of the appointment. Status Transition to Completed
Instructions on how to deploy and access the web app on Render.com
Setup and Installation instructions
Clone the repository:
git clone < https://github.com/DanaDvorcakova/Hospital-Management-System.git>
cd Hospital-Management-System
Create a virtual environment: python -m venv .venv source On Windows: .venv\Scripts\activate
Install dependencies: pip install -r requirements.txt
TECHNOLOGY
Python 3.13.9
Flask
Flask-SQLAlchemy (ORM)
SQLite (local development)
PostgreSQL (production deployment on Render)
HTML, CSS, JavaScript
draw.io
Note: SQLite is used for local development and testing. PostgreSQL is used in production when deployed on Render.com.
LIST OF SOURCES Image – google.com Logo and the other icons – google.com Inspirations – google.com Udemy YouTube w3schools github.com My previous projects Class Material