Skip to content

Code-ve/Hospital_management_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🏥 Hospital Management System

A Java-based console application for managing hospital operations efficiently — built with a clean service-oriented architecture and file-based data persistence.


📋 Table of Contents


Overview

The Hospital Management System is a command-line Java application that streamlines core hospital operations. It allows hospital staff to manage patients, doctors, appointments, medical records, and billing — all from a simple, intuitive menu-driven interface. Data is automatically persisted to text files, ensuring records are retained across sessions.


✨ Features

Module Capabilities
🧑‍⚕️ Patient Management Add patients, view all records, search by Patient ID
👨‍⚕️ Doctor Management Register doctors with specializations, view all doctors
📅 Appointment Booking Schedule appointments between patients and doctors
🗂️ Medical Records Add and retrieve patient medical history
💰 Billing System Generate and view patient billing records
💾 Data Persistence All records auto-saved to .txt files

📁 Project Structure

Hospital-managment/
│
├── Main.java                  # Entry point — main menu & navigation
│
├── Models
│   ├── Patient.java           # Patient entity (ID, Name, Age, Disease)
│   ├── Doctor.java            # Doctor entity (ID, Name, Specialization)
│   ├── Appointment.java       # Appointment entity (ID, PatientID, DoctorID, Date)
│   ├── Bill.java              # Bill entity (ID, PatientID, Amount)
│   └── MedicalRecord.java     # Medical Record entity
│
├── Services
│   ├── PatientService.java    # Patient CRUD operations
│   ├── DoctorService.java     # Doctor CRUD operations
│   ├── AppointmentService.java# Appointment booking & viewing
│   ├── BillingService.java    # Bill generation & viewing
│   ├── MedicalRecordService.java # Medical record management
│   └── Utils.java             # File I/O utility (read/write)
│
└── Data Files (auto-generated)
    ├── patients.txt
    ├── doctors.txt
    ├── appointments.txt
    ├── bills.txt
    └── medical_records.txt

🚀 Getting Started

Prerequisites

  • Java JDK 8 or higher
  • A terminal / command prompt

Compilation

Navigate to the Hospital-managment/ directory and compile all .java files:

cd Hospital-managment
javac *.java

Running the Application

java Main

🖥️ Usage

Upon launching, you will see the main menu:

=== HOSPITAL MANAGEMENT SYSTEM ===
1. Patient Management
2. Doctor Management
3. Appointment Management
4. Medical Records
5. Billing
6. Exit
Enter choice:

Navigate by entering the corresponding number. Each sub-menu provides options to add or view records. For example:

  • Patient Management → Add Patient: enter name, age, and diagnosis
  • Appointment Management → Book Appointment: link a patient ID to a doctor ID with a date
  • Billing → Generate Bill: enter the patient ID and the billing amount

💾 Data Persistence

All records are stored as comma-separated values (CSV) in plain text files in the running directory:

File Contents
patients.txt id,name,age,disease
doctors.txt id,name,specialization
appointments.txt id,patientId,doctorId,date
bills.txt id,patientId,amount
medical_records.txt Medical history entries

Data is loaded at startup and appended on every new entry — no database required.


🏛️ Architecture

The system follows a Service-Oriented Architecture (SOA) pattern:

Main.java (Controller / UI Layer)
    │
    ├── PatientService        ──► patients.txt
    ├── DoctorService         ──► doctors.txt
    ├── AppointmentService    ──► appointments.txt
    ├── BillingService        ──► bills.txt
    └── MedicalRecordService  ──► medical_records.txt
              │
              └── Utils.java (File I/O Layer)
  • Models hold data (plain Java objects).
  • Services handle business logic and delegate I/O to Utils.
  • Utils provides reusable readAll() and writeToFile() methods.

👤 Author

Pradyumn Krishna Arya
📦 GitHub: Code-ve/Pradyumn_Krishna_Arya


This project was developed as part of a Java programming submission demonstrating object-oriented programming principles, file handling, and service-oriented design.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages