FAIZA IBRAHIM SURAW
Hospital Management System (HMS) Documentation
MARCH 28, 2025
MURANG’A UNIVERSITY OF TECHNOLOGY
SC212/3286
Table of Contents
Chapter 1: Introduction
1.1 Background
1.2 Objectives
1.3 Purpose, Scope, and Applicability
Chapter 2: Survey of Technologies
2.1 Overview of Hospital Management Systems
2.2 Selected Technologies
2.3 Project Directory Structure
Chapter 3: Requirement and Analysis
3.1 Problem Definition
3.2 Requirements Specification
3.3 Preliminary Product Description
3.4 Conceptual Models
Chapter 4: System Design
4.1 Basic Modules
4.2 Data Design
4.3 Procedural Design
4.4 User Interface Design
4.5 Security Issues
4.6 Test Cases Design
Chapter 5: Implementation and Testing
5.1 Implementation Approaches
5.2 Coding Details and Code Efficiency
5.3 Modifications and Improvements
Chapter 6: Results and Discussion
6.1 Test Reports
6.2 User Documentation
Chapter 7: Conclusions
References
Appendices
SC212/3286
Chapter 1: Introduction
1.1 Background
Healthcare management has evolved significantly with the integration of technology, aiming to improve
efficiency, accuracy, and accessibility in patient care. Traditional hospital management relied on paper-
based records, which were prone to loss, errors, and inefficiencies. With the advent of digital systems,
hospitals now leverage software solutions to streamline operations, enhance patient experience, and
ensure regulatory compliance.
Existing Work in Hospital Management Systems
Numerous Hospital Management Systems (HMS) have been developed to address challenges in
healthcare administration. Some notable systems include:
OpenMRS: An open-source medical record system designed for low-resource environments,
focusing on patient data management and interoperability.
Epic Systems: A widely used HMS offering comprehensive solutions for electronic health records
(EHR), billing, and patient management.
Meditech: Provides integrated solutions for hospitals, covering clinical, financial, and
administrative processes.
Bahmni: An open-source HMS tailored for low-income countries, integrating electronic medical
records with hospital workflows.
Despite the advancements in HMS, many existing solutions face challenges such as high
implementation costs, complexity in customization, and the need for continuous training. The
HealthStack's Hospital Management System (HMS) is designed to address these gaps by
providing a user-friendly, cost-effective, and efficient solution tailored to the specific needs of the facility.
SC212/3286
References
OpenMRS. (n.d.). Retrieved from [Link]
Epic Systems Corporation. (n.d.). Retrieved from [Link]
Meditech. (n.d.). Retrieved from [Link]
Bahmni. (n.d.). Retrieved from [Link]
1.2 Objectives
The objective of this project is to develop a Hospital Management System (HMS) for HealthStack to
enhance patient record management, appointment scheduling, billing, and inventory tracking. The
system aims to improve efficiency, reduce errors, and ensure secure data handling in healthcare
operations.
1.3 Purpose, Scope, and Applicability
1.3.1 Purpose
The purpose of this project is to develop a Hospital Management System (HMS) that enhances
healthcare service delivery by streamlining administrative, financial, and medical processes. The
system aims to eliminate inefficiencies in paper-based record-keeping, improve accuracy in patient
data management, and enhance accessibility to critical healthcare information. By implementing a
digital HMS, HealthStack will benefit from improved workflow automation, reduced
operational costs, and enhanced patient care. This project aligns with modern healthcare trends that
emphasize efficiency, security, and interoperability of medical data within healthcare facilities.
1.3.2 Scope
This project covers the design, development, and implementation of a Hospital Management System
(HMS) tailored for HealthStack. The system will focus on key functionalities, including:
Patient Record Management: Secure storage, retrieval, and updating of patient information.
Appointment Scheduling: Streamlined booking and tracking of patient appointments.
Billing and Invoicing: Automated generation of invoices, processing of payments, and financial
record-keeping.
Inventory Management: Tracking and managing hospital supplies and medication stocks.
User Role Management: Defining different access levels for administrators, doctors, and staff to
ensure data security.
Assumptions and Limitations
Assumptions:
The hospital has basic IT infrastructure to support the HMS.
Users will receive training for system adoption.
Data security and patient confidentiality will be maintained.
Limitations:
The system is initially designed for use within HealthStack only.
Integration with external healthcare databases and third-party services is not included in the initial
version.
Internet connectivity may impact real-time updates and accessibility of cloud-based features.
1.3.3 Applicability
The Hospital Management System (HMS) developed for HealthStack has both direct and indirect
applications in the healthcare and technology sectors.
Direct Applications:
Enhancing hospital administration by automating record-keeping, billing, and inventory
management.
Improving patient care through faster data retrieval and efficient scheduling of appointments.
Ensuring regulatory compliance by maintaining accurate and secure health records.
Indirect Applications:
Serving as a model for other small to mid-sized healthcare facilities seeking cost-effective digital
transformation.
Contributing to the advancement of healthcare informatics and medical data management.
Potentially integrating with national healthcare databases in the future to improve interoperability.
The project provides a scalable and adaptable solution that can be extended to other healthcare
institutions, contributing to the broader goal of modernizing medical management through technology.
Chapter 2: Survey of Technologies
2.1 Overview of Technologies
This chapter discusses the technologies used in developing the Hospital Management System
(HMS) for HealthStack. It highlights the available technologies in the field, provides a comparative
analysis, and justifies the selection of specific tools for this project.
2.2 Selected Technologies
Programming Language: Python
Python is chosen for its simplicity, readability, and vast ecosystem of libraries. It is widely used in web
development and healthcare applications due to its strong community support and rapid development
capabilities.
Framework: Django
Django is a high-level Python web framework that promotes rapid development and clean, pragmatic
design. It provides built-in security features, an ORM (Object-Relational Mapping) for database
interactions, and an admin panel for efficient management.
User Interface: HTML & CSS
HTML (HyperText Markup Language) and CSS (Cascading Style Sheets) are used to structure and
style the frontend interface, ensuring a responsive and user-friendly design.
Version Control: Git
Git is employed for version control, enabling efficient collaboration, tracking of code changes, and
project management.
Database: SQLite
SQLite is chosen as the database management system due to its lightweight nature, ease of
integration, and minimal configuration requirements.
2.3 Project Directory Structure
.
├── ChatApp
├── LICENSE
├── [Link]
├── api // API routes
├── build // Shared libraries
├── db.sqlite3 // the database
├── [Link] // documentation of the project
├── doctor // Contains Doctor programming logic
├── healthstack // Contains Medical Programming Logic
├── hospital // Contains hospital programming logic
├── hospital_admin // Contains hospital administration programming logic
├── [Link] // run server
├── pharmacy
├── [Link]
├── [Link]
├── sslcommerz
├── sslcommerz_lib
├── [Link] // simple bash script to run the project
├── static
├── templates
├── [Link]
└── venv // virtual env
Chapter 3: Requirements and Analysis
3.1 Problem Definition
Healthcare facilities face numerous challenges in managing patient records, scheduling appointments,
handling billing processes, and maintaining inventory. Traditional paper-based systems are prone to
inefficiencies, errors, and security risks. The Hospital Management System (HMS) for HealthStack to
address these challenges by providing a digital solution that enhances efficiency, reduces errors, and
improves overall healthcare administration.
Sub-Problems
Patient Record Management: Ensuring accurate, secure, and easily accessible patient data.
Appointment Scheduling: Streamlining the booking and management of patient appointments.
Billing and Invoicing: Automating payment processing and financial records.
Inventory Management: Keeping track of medical supplies and pharmaceuticals.
User Role Management: Providing role-based access to different users within the hospital.
3.2 Requirements Specification
The system requirements define the necessary components and functionalities required for the HMS
to operate effectively. This section details both hardware and software requirements essential for
system development and deployment.
3.2.1 Hardware Requirements
The following hardware specifications are required for running the HMS:
Processor: Intel Core i5 or higher / AMD Ryzen 5 or higher
RAM: Minimum 8GB (16GB recommended)
Storage: Minimum 256GB SSD (512GB recommended)
Graphics: Integrated or dedicated graphics support
Peripherals: Standard keyboard, mouse, and monitor
Network: Reliable internet connectivity for online features
3.2.2 Software Requirements
The following software components are required for the development and execution of the HMS:
Operating System: Windows 10/11, macOS, or Linux (Ubuntu recommended)
Programming Language: Python (3.8 or higher)
Framework: Django (latest stable version)
Database: SQLite
Web Technologies: HTML, CSS
Version Control: Git
Development Tools: VS Code/PyCharm, Postman (for API testing)
3.3 Preliminary Product Description
The Hospital Management System (HMS) for HealthStack is designed to improve hospital workflow
efficiency by automating administrative and medical processes. The system will handle patient
records, appointment scheduling, billing, and inventory management, ensuring accurate and secure
data processing. The HMS will enhance accessibility, improve patient care, and reduce administrative
workload.
System Functions
Secure Patient Record Storage: Maintain patient details with confidentiality and security
measures.
Automated Appointment Scheduling: Allow patients to book, modify, or cancel appointments
online.
Billing & Invoicing: Generate invoices, process payments, and maintain transaction records.
Inventory Management: Track hospital supplies and notify administrators of low stock levels.
User Access Management: Define roles for doctors, administrators, and staff with appropriate
access levels.
3.4 Conceptual Models
To understand the problem domain, the system is modeled using various conceptual diagrams
3.4.1 Schema Design
Defines the database structure and relationships between entities, ensuring efficient data storage and
retrieval.
3.4.2 Data Integrity and Constraints
Defines and explains all validity checks and constraints implemented to maintain data integrity,
ensuring accurate and reliable information management.
3.4.3 Logic Diagrams
Illustrates systematic workflows to enhance process comprehension, including Control Flow Charts
and Process Diagrams.
3.4.4 Data Structures
Defines the data structures used within the system to ensure efficient data processing and retrieval.
3.4.5 Algorithm Design
Provides explanations of input data, output data, and process logic, describing how system algorithms
function to achieve desired outcomes.
These models help in designing an efficient and scalable architecture before system implementation.
Chapter 4: System Design
Describes desired features and operations in detail, including screen layouts, business rules, process
diagrams, pseudocode, and other documentation.
4.1 Basic Modules
The project is divided into manageable modules that can be developed separately and then integrated
into a fully functional system. These modules include:
Patient Management Module: Handles the creation, modification, and retrieval of patient
records.
Appointment Scheduling Module: Manages appointment bookings, cancellations, and
modifications.
Billing and Invoicing Module: Automates the generation of invoices and payment processing.
Inventory Management Module: Keeps track of medical supplies and pharmaceuticals.
User Access Management Module: Manages user roles and permissions within the system.
4.2 Data Design
Data design involves the organization, management, and manipulation of the data within the system.
4.2.1 Schema Design
The database schema consists of the following main tables:
Patients: Stores patient information such as name, date of birth, contact details, etc.
Appointments: Stores data related to patient appointments, including date, time, and status.
Invoices: Stores information related to billing, including patient ID, date, and amount.
Inventory: Stores details about medical supplies and pharmaceuticals, including stock levels.
Users: Stores user information such as roles, access levels, and login details.
4.2.2 Data Integrity and Constraints
To ensure data integrity, the following constraints are applied:
Primary Key Constraints: Uniquely identifies each record in a table.
Foreign Key Constraints: Ensures referential integrity between related tables.
Unique Constraints: Ensures no duplicate entries, such as in patient identification numbers or
appointment slots.
Check Constraints: Ensures valid data, such as checking that appointment dates are in the
future.
4.3 Procedural Design
Procedural design outlines the development of algorithms and procedures for the system.
4.3.1 Logic Diagrams
The following process flow is designed to improve comprehension:
Patient Registration: User inputs patient data, system validates the information, and stores it in
the database.
Appointment Booking: Patient selects a time slot, system checks availability, and confirms the
appointment.
4.3.2 Data Structures
The system employs the following data structures:
Array/List: For storing patient and appointment details.
Dictionary/Hash Map: For quick lookups of user credentials and roles.
Queue: For managing appointment processing order.
4.3.3 Algorithm Design
The core algorithm for appointment booking is as follows:
Input: Patient details, requested appointment time.
Process: Check if the requested time slot is available.
Output: Confirm appointment or suggest alternative times.
4.4 User Interface Design
The user interface is designed to be intuitive and easy to use. It includes:
Login Page: For authentication with user credentials.
Dashboard: For accessing modules such as patient management, appointments, billing, etc.
Patient Registration Form: For entering patient details.
Appointment Scheduler: For viewing available time slots and booking appointments.
The user interface will be developed using HTML, CSS, and JavaScript.
4.5 Security Issues
To ensure data security, the following measures are implemented:
Authentication: Role-based access control to ensure only authorized users can access certain
data.
Data Encryption: Sensitive data such as passwords and patient details are encrypted.
Regular Security Audits: To detect vulnerabilities and prevent attacks.
4.6 Test Cases Design
Test cases are designed to validate the functionality of the system under different conditions:
Test Case 1: Verify that patient data can be correctly entered and retrieved.
Test Case 2: Verify that appointments are correctly booked and conflicts are handled.
Test Case 3: Verify that billing calculations are accurate.
Test Case 4: Verify that inventory levels are correctly updated after use.
Chapter 5: Implementation and Testing
5.1 Implementation Approaches
This section defines the plan of implementation for the Hospital Management System (HMS). The
implementation follows the following approaches:
Modular Design: The system is divided into smaller, manageable modules, each implementing
specific functionality.
Agile Development: The system is built incrementally, with continuous feedback from
stakeholders to improve the software.
Standard Practices: The implementation adheres to industry standards for code structure,
documentation, and testing.
Technological Stack: The system uses Python (Django), SQLite, HTML, CSS, and JavaScript for
development.
5.2 Coding Details and Code Efficiency
This section provides details on the important parts of the implementation. It includes key code
snippets and explanations of their functionality.
5.2.1 Code Efficiency
The code is optimized for performance in the following ways:
Efficient Database Queries: Using Django ORM for database access ensures that queries are
optimized and prevent issues like N+1 query problems.
Caching: Certain frequently accessed data, such as patient records, are cached to reduce the
load on the database.
Asynchronous Tasks: Time-consuming tasks like email notifications and report generation are
processed asynchronously to avoid blocking user interactions.
Code Refactoring: Redundant code has been refactored into reusable functions and classes to
improve maintainability and performance.
5.2.2 Testing Approach
Testing follows the model defined in the system design chapter. The testing approach is as follows:
Category Partition: This method is used to partition the input space and test each partition with
representative test cases.
State Machine-based Testing: Tests are created based on different states the system can be in,
ensuring that state transitions are handled correctly.
Functional Testing: This verifies that each function of the system performs as expected.
User Acceptance Testing: This tests whether the system meets the user's needs and
expectations.
5.2.3 Unit Testing
Unit testing is performed on individual modules. Each module is tested independently to ensure that its
functions behave correctly and handle edge cases. For example:
Patient Management Module: Tests ensure that patient records can be added, retrieved,
updated, and deleted correctly.
Appointment Scheduling Module: Tests ensure that appointments are booked, modified, and
canceled as expected.
5.2.4 Integrated Testing
Once all modules are integrated, the system undergoes integrated testing to check for errors, bugs,
and interoperability issues. This includes testing:
Database Integration: Ensures that all modules interact correctly with the database.
End-to-End Workflow: Verifies that workflows, such as patient registration, appointment booking,
and billing, function correctly when connected.
User Permissions: Tests ensure that role-based access control works as intended, restricting
and granting access appropriately.
5.3 Modifications and Improvements
After testing, bugs and errors are identified and fixed. Some modifications made to improve the system
include:
Bug Fixes: Issues with appointment scheduling were fixed by improving the algorithm to handle
overlapping appointments.
Performance Enhancements: Optimized database queries to reduce load times for large
datasets.
UI Improvements: The user interface was made more intuitive based on feedback from user
testing, including simplifying navigation and improving error handling.
Chapter 6: Results and Discussion
6.1 Test Reports
In this section, we explain the test results and reports based on the test cases conducted. The
following scenarios were tested to ensure that the Hospital Management System (HMS) is capable of
handling various conditions and works efficiently:
Sample Test Inputs and Outputs:
Test Case 1: Signup/Login
Input: New user details (username, password, email).
Output: User successfully registered and logged in.
Expected Result: The system should validate the input, create the user, and allow access to
the dashboard.
Test Case 2: Doctor Dashboard
Input: Doctor logs in and accesses the dashboard.
Output: Doctor dashboard displays patient list, appointments, and messages.
Expected Result: The dashboard should load the relevant information based on the doctor's
profile.
Test Case 3: Appointment Booking (Patient)
Input: Patient selects a doctor and appointment time.
Output: Appointment successfully booked and confirmation sent.
Expected Result: The system should check the doctor’s availability and confirm the booking.
Test Case 4: Chat Functionality (Doctor/Patient)
Input: Doctor sends a message to a patient.
Output: Message successfully delivered to the patient.
Expected Result: The system should allow real-time messaging between the doctor and the
patient.
These tests confirm that the system is capable of handling different scenarios and works as intended
under various conditions.
6.2 User Documentation
This section provides an overview of the software’s functionality, with detailed explanations of its
components. It will help users understand how to use the system effectively.
User Stories
Doctor Guide
1. Signup/Login
Story: As a doctor, I want to sign up or log in to the system using my credentials so that I can
access the dashboard and manage my appointments.
Actions: Enter credentials (username/password), click "Login."
Expected Result: Successful login redirects to the doctor’s dashboard.
2. Doctor Dashboard
Story: As a doctor, I want to view my patient list, upcoming appointments, and any new
messages on my dashboard so that I can manage my schedule effectively.
Actions: View patient information, appointments, and notifications.
Expected Result: Dashboard displays patient details, appointments, and message alerts.
3. Chat with Patients
Story: As a doctor, I want to send and receive messages from patients to discuss their health
concerns in real-time.
Actions: Open chat window, type message, send.
Expected Result: Message is sent to the patient’s chat interface and the patient receives it in
real time.
4. Appointment Management
Story: As a doctor, I want to accept or reject patient appointments and update my availability.
Actions: Accept or reject appointment requests, update availability.
Expected Result: Appointment status is updated accordingly in the system.
Patient Guide
1. Signup/Login
Story: As a patient, I want to sign up and log in to access my personal health records and
make appointments.
Actions: Enter username, password, and login.
Expected Result: Patient successfully logged in and directed to the dashboard.
2. View and Book Appointments
Story: As a patient, I want to view available doctors and schedule an appointment at a
convenient time.
Actions: Choose a doctor, select an available slot, book appointment.
Expected Result: Appointment booked and confirmation received.
3. Chat with Doctor
Story: As a patient, I want to communicate with my doctor regarding my health concerns via
chat.
Actions: Open chat window, type message, send.
Expected Result: Message is sent to the doctor, and the patient receives a response.
4. View Medical Records
Story: As a patient, I want to view my medical history and past appointments so that I can
track my health progress.
Actions: Access medical records section, view details.
Expected Result: Patient records and appointment history displayed correctly.
Admin Guide
1. Admin Signup/Login
Story: As an admin, I want to sign up or log in to manage the system and oversee doctors,
patients, and appointments.
Actions: Enter admin credentials, log in.
Expected Result: Admin successfully logged in and directed to the admin dashboard.
2. Manage Users (Doctors/Patients)
Story: As an admin, I want to manage user accounts, including adding, deleting, and
updating doctor and patient profiles.
Actions: View user list, update user details, delete users.
Expected Result: User profiles updated or deleted successfully.
Admin Manage Users Screenshot Placeholder
3. Manage Appointments
Story: As an admin, I want to oversee the appointment schedule and resolve conflicts if
necessary.
Actions: View appointments, resolve conflicts, adjust doctor availability.
Expected Result: Appointment details updated successfully.
This user documentation ensures that all users—doctors, patients, and admins—can effectively
navigate and utilize the system to its full potential.
Chapter 7: Conclusions
7.1 Conclusion
The Hospital Management System (HMS) was designed and implemented to improve the efficiency of
hospital operations, enhance patient care, and streamline administrative processes. Throughout this
project, we developed a system that enables doctors, patients, and administrators to interact
seamlessly, manage appointments, and access important medical records.
The implementation followed modular design principles, ensuring scalability and maintainability.
Testing confirmed that the system met functional requirements, with successful execution of
appointment scheduling, role-based access control, and secure communication features.
Overall, the system has proven to be a valuable tool for managing hospital workflows. While there are
areas for further improvement, HMS provides a solid foundation for digital healthcare management.
7.2 Limitations of the System
Despite the successful implementation, the system has some limitations:
Scalability Issues: The current database structure is optimized for small to medium-sized
hospitals, but performance could be impacted in larger facilities with high data loads.
Limited Integration with External Systems: The system does not yet integrate with third-party
electronic health record (EHR) systems or insurance providers.
Real-time Notifications: While chat functionality exists, real-time alerts and notifications could be
improved for better responsiveness.
Criticisms During Demonstration: Some users noted the need for a mobile-friendly version of
the application and an improved user interface for better accessibility.
References
It is essential to acknowledge the sources that contributed to the development of this project.
Books:
Author Name, Book Title, Edition, Publisher, Year.
Journals:
Author(s), "Title of the Paper," Journal Name, Volume(Issue), Page Numbers, Year.
Online Resources:
Author/Organization, "Title," URL, Accessed on Date.
Glossary
This section provides definitions for abbreviations, acronyms, and technical terms frequently used in
this report:
HMS – Hospital Management System
EHR – Electronic Health Records
ORM – Object-Relational Mapping, a technique used for database interaction
CRUD – Create, Read, Update, Delete (basic database operations)
Appendices
The appendices include additional technical details, code snippets, and supplementary documentation
that may be useful for future development.
Appendix A: Sample Code Snippets
Contains critical parts of the implementation, such as database models and API endpoints.
Appendix B: User Guide
Detailed instructions on system usage, including screenshots and explanations.
Appendix C: Test Cases
List of test cases conducted, their input conditions, and expected outputs.