Skip to content

About

A console-based Hospital Management System developed in C++ using Object-Oriented Programming principles. The system manages patients, doctors, appointments, and admins through secure role-based access, dynamic memory management, file handling, inheritance and polymorphism.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

4 Commits

Folders and files

Repository files navigation

๐Ÿฅ Hospital Management System

A console-based Hospital Management System built using C++ and core Object-Oriented Programming (OOP) concepts.

This project simulates a real hospital workflow with separate interfaces for Admins, Doctors, and Patients, allowing appointment booking and management with persistent file storage.


โœจ Features

๐Ÿ‘จโ€๐Ÿ’ผ Admin Features

  • โž• Add doctors
  • โŒ Remove doctors
  • โž• Add patients
  • โŒ Remove patients
  • ๐Ÿ“‹ View all doctors
  • ๐Ÿ“‹ View all patients

๐Ÿ‘จโ€โš•๏ธ Doctor Features

  • โž• Add appointment slots
  • โŒ Remove slots
  • ๐Ÿ‘€ View slot availability
  • โœ๏ธ Update personal details

๐Ÿง‘โ€๐Ÿฆฑ Patient Features

  • ๐Ÿ” Search doctors by specialty
  • ๐Ÿ“… View available slots
  • โœ… Book appointments
  • โŒ Cancel appointments
  • ๐Ÿ“‹ View personal appointments
  • โœ๏ธ Update personal details

๐Ÿง  OOP Concepts Used

Concept How It Was Used
๐Ÿ”’ Encapsulation Private/protected members with getters & setters
๐Ÿงฌ Inheritance Doctor, Patient, and Admin inherit from User
๐ŸŽญ Polymorphism Virtual functions like displayInfo()
๐Ÿงฑ Abstraction Pure virtual methods in User
๐Ÿ—๏ธ Constructor Overloading Multiple constructors in classes
๐Ÿ’พ File Handling Persistent storage using text files
โš ๏ธ Exception Handling try-catch and throw statements
๐Ÿงน Dynamic Memory Arrays allocated using new[] and delete[]

๐Ÿ—๏ธ Class Overview

๐Ÿ‘ค User (Abstract Base Class)

The base class for all users in the system.

Stores:

  • ID
  • Username
  • Password

Provides:

  • Authentication
  • File handling
  • Virtual methods for polymorphism

๐Ÿ‘จโ€๐Ÿ’ผ Admin

Derived from User.

Responsibilities:

  • Managing doctors
  • Managing patients
  • Viewing records

๐Ÿ‘จโ€โš•๏ธ Doctor

Derived from User.

Additional Data:

  • Specialization
  • Appointment slots
  • Slot availability

Responsibilities:

  • Managing slots
  • Updating details
  • Viewing appointments

๐Ÿง‘โ€๐Ÿฆฑ Patient

Derived from User.

Additional Data:

  • Disease/complaint
  • Age

Responsibilities:

  • Searching doctors
  • Booking appointments
  • Cancelling appointments

๐Ÿ“… Appointment

Represents a booked appointment between a doctor and a patient.

Stores:

  • Appointment ID
  • Doctor ID
  • Patient ID
  • Slot index

๐Ÿ’พ File Persistence

The system automatically saves and loads data using text files.

File Purpose
doctors.txt Stores doctor records
patients.txt Stores patient records
appointments.txt Stores appointment records

โœ… Data is:

  • Loaded automatically at startup
  • Saved automatically before exit

๐Ÿ” Authentication System

๐Ÿ‘จโ€๐Ÿ’ผ Admin Login

Username: admin
Password: admin123

๐Ÿ‘จโ€โš•๏ธ Doctor Login

Doctors login using:

  • Doctor ID
  • Password

๐Ÿง‘โ€๐Ÿฆฑ Patient Login

Patients login using:

  • Patient ID
  • Password

๐Ÿš€ How To Run

๐Ÿ’ป Using Visual Studio

  1. Open the .sln file
  2. Build the project
  3. Run using:
Ctrl + F5

โš™๏ธ Using g++

g++ main.cpp User.cpp Admin.cpp Doctor.cpp Patient.cpp Appointment.cpp -o hospital
./hospital

๐Ÿ”„ Example Workflow

๐Ÿ‘จโ€๐Ÿ’ผ Admin

  1. Login as admin
  2. Add doctors and patients

๐Ÿ‘จโ€โš•๏ธ Doctor

  1. Login using doctor ID
  2. Add appointment slots

๐Ÿง‘โ€๐Ÿฆฑ Patient

  1. Login using patient ID
  2. Search doctors by specialty
  3. Book an available appointment

๐ŸŒŸ Technical Highlights

  • โœ… Uses OOP principles extensively
  • โœ… Uses polymorphism and abstraction
  • โœ… Prevents double-booking slots
  • โœ… Automatically frees slots after cancellation
  • โœ… Handles invalid input safely
  • โœ… Persistent file storage
  • โœ… Modular and maintainable code design

๐Ÿ“Š Sample Data Included

The repository already contains sample:

  • Doctors
  • Patients
  • Appointments

for easy testing and demonstration.


๐Ÿ”ฎ Future Improvements

Possible future enhancements:

  • ๐Ÿ–ฅ๏ธ GUI/Desktop Interface
  • ๐Ÿ—„๏ธ Database Integration
  • ๐Ÿ“† Appointment scheduling by date
  • ๐Ÿ” Password encryption
  • ๐Ÿ“ฑ Mobile or Web version
  • ๐Ÿ“Š Admin dashboards
  • ๐Ÿ’ณ Billing system

๐Ÿ› ๏ธ Technologies Used

  • ๐Ÿ’ป C++
  • ๐Ÿง  Object-Oriented Programming
  • ๐Ÿ’พ File Handling
  • โš™๏ธ Dynamic Memory Allocation
  • ๐ŸชŸ Visual Studio

๐Ÿ‘จโ€๐Ÿ’ป Authors

Name ID
Abdelrahman Nader 25-105217
Yassin Tamer 25-103804
Youssef Mohamed 25-101800
Seif El Sayed 25-103665
Abdelrahman Shady 25-100322

๐Ÿ”— GitHub Profile:
https://github.com/YoussefOthman10

๐Ÿ“‚ Project Repository:
https://github.com/YoussefOthman10/HospitalManagementSystem

About

A console-based Hospital Management System developed in C++ using Object-Oriented Programming principles. The system manages patients, doctors, appointments, and admins through secure role-based access, dynamic memory management, file handling, inheritance and polymorphism.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages