Skip to content

Hospital Management System

Java CLI hospital system with role-based access for four user types, appointment scheduling, and CSV-backed persistence, built on clean OOP design.

Oct 2024 – Nov 2024
  • backend

Problem

A hospital gives different staff different powers over the same long-lived records — patients, doctors, pharmacists, and administrators each need a different slice of the system. That’s a textbook case for object-oriented design and role-based access, which is exactly how this CLI application is built.

Architecture

  • Java (JDK 17+), object-oriented throughout, on a command-line interface.
  • Role-based access control across four user types, each with a scoped set of actions.
  • File-based persistence via CSV (staff, patients, medication inventory) — portable, with no database dependency.
  • Secure login by hospital ID, with password management and a forced password change on first login.

Roles

  • Patient — view and manage medical records, book and manage appointments, and review appointment history and outcomes.
  • Doctor — manage patient records, set availability, record diagnoses and treatments, and issue prescriptions.
  • Pharmacist — process prescriptions, manage medication inventory, monitor stock, and submit replenishment requests.
  • Administrator — staff management, system-wide appointment oversight, inventory control, and data import / initialization.

Key decisions

Access is gated by role at the type level through an OOP class hierarchy, so each user only ever sees the operations they’re authorized for. State persists to CSV to keep the system dependency-free and easy to run anywhere, and a forced first-login password change stops default credentials from lingering.