Skip to content

8harath/Hospital-Management-project

Repository files navigation

Hospital Management Project

A simple Hospital Management System developed as an academic project for the DBMS (Database Management Systems) subject during my 2nd year of university. This repository contains the source code, database scripts, and documentation for the project.

Note: This README is written as a general, ready-to-use project description. If your repository uses a specific language/framework (PHP, Java, Python, .NET, etc.), replace the placeholder commands and configuration paths below with the actual ones used in the repo.

Table of contents

  • Project overview
  • Key features
  • System architecture & technologies
  • Database / ER overview
  • Setup & installation
  • Running the project
  • Sample SQL schema
  • Usage
  • Tests (if any)
  • Screenshots
  • Contributing
  • License
  • Author & acknowledgements

Project overview

This Hospital Management System allows hospital staff to manage:

  • Patient records
  • Doctor records and schedules
  • Appointments
  • Medical records / prescriptions
  • Billing (basic)
  • Search and reporting (basic)

The project was implemented to demonstrate database design, SQL operations, and integration of a backend application with a relational database as part of the DBMS curriculum.

Key features

  • CRUD operations for patients, doctors, appointments, and medicines.
  • Appointment booking and schedule management.
  • Simple billing / invoice generation.
  • Search by patient name, doctor name, or appointment date.
  • Basic input validation and data integrity enforced at the DB level.

System architecture & technologies

(Replace or update these to match the repository's actual stack)

  • Database: MySQL (or MariaDB)
  • Backend: (e.g., PHP / Java / Python / Node.js) — configure according to repo
  • Frontend: HTML, CSS, JavaScript (server-rendered or single-page depending on repo)
  • Deployment: Local or server-based (LAMP / WAMP / Tomcat / Node)

Database / ER overview

The core entities:

  • Patient (patient_id, name, dob, contact, address, medical_history)
  • Doctor (doctor_id, name, specialization, contact, schedule)
  • Appointment (appointment_id, patient_id, doctor_id, date, time, status)
  • Prescription (prescription_id, appointment_id, medicine, dosage, notes)
  • Billing (bill_id, patient_id, amount, date, status)

ER relationships:

  • A Patient can have many Appointments.
  • A Doctor can have many Appointments.
  • An Appointment can have one Prescription.
  • A Patient can have multiple Bills.

Setup & installation

Prerequisites

  • Git
  • MySQL / MariaDB (or the database your project uses)
  • Language/runtime for the backend (PHP, Java, Python, Node.js, etc.)
  • Any additional dependencies listed in the repository (composer, pip, npm, Maven/Gradle)

Steps (generic)

  1. Clone the repository
  2. Change into the project directory
    • cd Hospital-Management-project
  3. Install backend dependencies (adjust to your stack)
    • PHP: composer install
    • Node.js: npm install
    • Python: pip install -r requirements.txt
    • Java: mvn clean install (or ./gradlew build)
  4. Create and configure the database
    • Create a new database (e.g., hospital_db)
    • Import the SQL schema provided (see Sample SQL schema below or db/schema.sql if present)
  5. Configure the application to connect to the database
    • Edit configuration file (example: config/config.php, .env, application.properties) and set DB_HOST, DB_NAME, DB_USER, DB_PASS
  6. Start the application (adjust to stack)
    • PHP (with built-in server): php -S localhost:8000 -t public
    • Node.js: npm start
    • Python Flask: flask run
    • Java (Spring Boot): mvn spring-boot:run

Running the project

  • After starting the backend, open your browser:
  • Log in with sample admin credentials (if included). If there are no default users, create your first admin user via the registration route or insert directly into the database.

Sample SQL schema

Below is a minimal schema you can import/modify to get started. Save as db/schema.sql or run with your DB client.

-- Database: hospital_db
CREATE DATABASE IF NOT EXISTS hospital_db;
USE hospital_db;

CREATE TABLE IF NOT EXISTS patients (
  patient_id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(150) NOT NULL,
  dob DATE,
  gender VARCHAR(10),
  contact VARCHAR(50),
  address VARCHAR(255),
  medical_history TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS doctors (
  doctor_id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(150) NOT NULL,
  specialization VARCHAR(100),
  contact VARCHAR(50),
  email VARCHAR(150),
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS appointments (
  appointment_id INT AUTO_INCREMENT PRIMARY KEY,
  patient_id INT NOT NULL,
  doctor_id INT NOT NULL,
  appointment_date DATE NOT NULL,
  appointment_time TIME,
  status VARCHAR(50) DEFAULT 'scheduled',
  notes TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (patient_id) REFERENCES patients(patient_id) ON DELETE CASCADE,
  FOREIGN KEY (doctor_id) REFERENCES doctors(doctor_id) ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS prescriptions (
  prescription_id INT AUTO_INCREMENT PRIMARY KEY,
  appointment_id INT NOT NULL,
  medicine VARCHAR(255),
  dosage VARCHAR(100),
  notes TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (appointment_id) REFERENCES appointments(appointment_id) ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS bills (
  bill_id INT AUTO_INCREMENT PRIMARY KEY,
  patient_id INT NOT NULL,
  amount DECIMAL(10,2) NOT NULL,
  status VARCHAR(50) DEFAULT 'unpaid',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (patient_id) REFERENCES patients(patient_id) ON DELETE CASCADE
);

Usage

  • Admin / staff should be able to:
    • Add, update, delete patient records
    • Add, update, delete doctor records
    • Create appointments, search appointments, update their status
    • Add prescriptions tied to appointments
    • Generate / view bills

Tip: For large record imports or testing, prepare CSV files and write simple import scripts that read CSV and insert into the database.

Tests

  • If the repository contains test suites, run them using:
    • PHP (PHPUnit): ./vendor/bin/phpunit
    • Node.js (Jest/Mocha): npm test
    • Python (pytest): pytest
    • Java (Maven): mvn test

Add or update tests to cover CRUD and DB transactions.

Screenshots

Add screenshots (place inside docs/screenshots/) showing core flows:

  • Patient registration
  • Appointment booking
  • Prescription view
  • Billing page

Example:

  • docs/screenshots/patient_add.png
  • docs/screenshots/appointment_list.png

Contributing

If you'd like to contribute, please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to your fork (git push origin feature/my-feature)
  5. Open a Pull Request

Please include clear descriptions and, if applicable, a SQL migration or updated schema.

License

This project is provided for academic purposes. You can include a license such as MIT: MIT License — see LICENSE file for details.

Author & acknowledgements

Author: 8harath (GitHub: https://github.com/8harath)

This project was developed as part of my DBMS subject in the 2nd year of university to demonstrate database design and application integration.

Acknowledgements:

  • Course instructors and teaching assistants
  • Any open-source libraries used in the project

If you want, I can:

  • Update the README to include exact setup commands for the actual stack in this repository (PHP/Node/Java/Python, etc.).
  • Add a pre-built db/schema.sql file or a seed data script and a sample .env example.
    Tell me which backend stack and entry-point file the repo uses and I will update the README accordingly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published