# hemanthsaiburla/hospital-management-system architecture

> Architecture diagram of the GitHub repository hemanthsaiburla/hospital-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hemanthsaiburla/hospital-management-system
- Repository: https://github.com/hemanthsaiburla/hospital-management-system

## Overview

This Spring Boot/JSP hospital system handles patient registration and appointments, clinician updates, billing, and payment-gated pharmacy dispensing. Role-specific web controllers invoke services, which manage domain records through Spring Data repositories backed by MySQL. The README also describes administration, staff CRUD, dashboards, search, and AI diagnostic assistance; some of these capabilities are documented but their implementation was not sampled, so their internal links are not asserted.

Main entry points: [`src/main/java/com/hemanth/hospital/service/AppointmentService.java`](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/AppointmentService.java) (Appointment services), [`src/main/java/com/hemanth/hospital/repository/PatientRepository.java`](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/PatientRepository.java) (Patient records), [`src/main/java/com/hemanth/hospital/controller/AdminController.java`](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AdminController.java) (Admin portal), [`src/main/java/com/hemanth/hospital/controller/DoctorController.java`](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/DoctorController.java) (Doctor portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Web access"]
  node_auth["Role login"]
  node_admin["Admin portal"]
  node_user_service["User services<br/>[UserService.java]"]
end

subgraph group_care["Patient care"]
  node_doctor["Doctor portal"]
  node_patient["Patient portal"]
  node_appointments["Appointment API"]
  node_nurse["Nurse portal"]
  node_diagnostics["Diagnostic assistant"]
  node_patient_service["Patient services"]
  node_doctor_service["Doctor services<br/>[DoctorService.java]"]
  node_appointment_service["Appointment services"]
end

subgraph group_operations["Hospital operations"]
  node_reception["Reception desk"]
  node_pharmacy["Pharmacy portal"]
  node_billing["Billing API"]
  node_medicine["Medicine API"]
  node_staff["Staff portals"]
  node_reception_service["Reception services"]
  node_pharmacy_service["Pharmacy services"]
  node_admin_service["Administration services<br/>[AdminService.java]"]
  node_nurse_service["Nurse services<br/>[NurseService.java]"]
  node_medicine_service["Medicine services"]
  node_bill_service["Billing services<br/>[BillService.java]"]
end

subgraph group_persistence["Domain and persistence"]
  node_patient_repo["Patient records"]
  node_appointment_repo["Appointment records"]
  node_user_repo["User records"]
  node_domain["Hospital entities<br/>[Patient.java]"]
  node_mysql[("MySQL database")]
end

node_visitor(("Patient and staff"))

node_visitor -->|"requests access"| node_auth
node_visitor -->|"books care"| node_patient
node_auth -.->|"validates user"| node_user_service
node_patient -.->|"manages patients"| node_patient_service
node_patient -.->|"books appointment"| node_appointment_service
node_doctor -->|"updates records"| node_doctor_service
node_doctor -->|"loads appointments"| node_appointment_service
node_doctor -.->|"uses assistant"| node_diagnostics
node_reception -->|"registers patients"| node_reception_service
node_reception -->|"loads appointments"| node_appointment_service
node_pharmacy -->|"checks dispensing"| node_pharmacy_service
node_appointments -.->|"handles bookings"| node_appointment_service
node_medicine -.->|"manages medicines"| node_medicine_service
node_nurse -.->|"manages nurses"| node_nurse_service
node_admin -->|"manages staff"| node_admin_service
node_admin -->|"creates users"| node_user_service
node_admin -->|"loads statistics"| node_appointment_service
node_staff -.->|"staff operations"| node_nurse_service
node_doctor_service -.->|"uses records"| node_patient_repo
node_patient_service -.->|"uses records"| node_patient_repo
node_reception_service -->|"reads and writes"| node_patient_repo
node_pharmacy_service -->|"updates dispensing"| node_patient_repo
node_appointment_service -->|"reads and writes"| node_appointment_repo
node_user_service -->|"reads and writes"| node_user_repo
node_pharmacy_service -->|"updates status"| node_domain
node_patient_repo -.->|"persists records"| node_mysql
node_appointment_repo -.->|"persists records"| node_mysql
node_user_repo -.->|"persists records"| node_mysql
node_billing -->|"handles billing"| node_bill_service

click node_auth "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AuthController.java"
click node_admin "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AdminController.java"
click node_doctor "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/DoctorController.java"
click node_patient "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/PatientController.java"
click node_reception "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/ReceptionistController.java"
click node_pharmacy "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/PharmacistController.java"
click node_appointments "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AppointmentController.java"
click node_billing "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/BillController.java"
click node_medicine "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/MedicineController.java"
click node_nurse "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/NurseController.java"
click node_staff "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/SupportStaffController.java"
click node_diagnostics "https://github.com/hemanthsaiburla/hospital-management-system/tree/main/src/main/java/com/hemanth/hospital/controller"
click node_patient_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/PatientService.java"
click node_doctor_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/DoctorService.java"
click node_appointment_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/AppointmentService.java"
click node_reception_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/ReceptionistService.java"
click node_pharmacy_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/PharmacistService.java"
click node_admin_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/AdminService.java"
click node_user_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/UserService.java"
click node_nurse_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/NurseService.java"
click node_medicine_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/MedicineService.java"
click node_bill_service "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/BillService.java"
click node_patient_repo "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/PatientRepository.java"
click node_appointment_repo "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/AppointmentRepository.java"
click node_user_repo "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/UserRepository.java"
click node_domain "https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/models/Patient.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_admin,node_user_service toneBlue
class node_doctor,node_patient,node_appointments,node_nurse,node_diagnostics,node_patient_service,node_doctor_service,node_appointment_service toneAmber
class node_reception,node_pharmacy,node_billing,node_medicine,node_staff,node_reception_service,node_pharmacy_service,node_admin_service,node_nurse_service,node_medicine_service,node_bill_service toneMint
class node_patient_repo,node_appointment_repo,node_user_repo,node_domain,node_mysql toneRose
class node_visitor toneIndigo
```

## Components

### Web access

- [Role login](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AuthController.java): `src/main/java/com/hemanth/hospital/controller/AuthController.java`
- [Admin portal](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AdminController.java): `src/main/java/com/hemanth/hospital/controller/AdminController.java`
- [User services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/UserService.java): `src/main/java/com/hemanth/hospital/service/UserService.java`

### Patient care

- [Doctor portal](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/DoctorController.java): `src/main/java/com/hemanth/hospital/controller/DoctorController.java`
- [Patient portal](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/PatientController.java): `src/main/java/com/hemanth/hospital/controller/PatientController.java`
- [Appointment API](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/AppointmentController.java): `src/main/java/com/hemanth/hospital/controller/AppointmentController.java`
- [Nurse portal](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/NurseController.java): `src/main/java/com/hemanth/hospital/controller/NurseController.java`
- [Diagnostic assistant](https://github.com/hemanthsaiburla/hospital-management-system/tree/main/src/main/java/com/hemanth/hospital/controller): `src/main/java/com/hemanth/hospital/controller`
- [Patient services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/PatientService.java): `src/main/java/com/hemanth/hospital/service/PatientService.java`
- [Doctor services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/DoctorService.java): `src/main/java/com/hemanth/hospital/service/DoctorService.java`
- [Appointment services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/AppointmentService.java): `src/main/java/com/hemanth/hospital/service/AppointmentService.java`

### Hospital operations

- [Reception desk](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/ReceptionistController.java): `src/main/java/com/hemanth/hospital/controller/ReceptionistController.java`
- [Pharmacy portal](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/PharmacistController.java): `src/main/java/com/hemanth/hospital/controller/PharmacistController.java`
- [Billing API](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/BillController.java): `src/main/java/com/hemanth/hospital/controller/BillController.java`
- [Medicine API](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/MedicineController.java): `src/main/java/com/hemanth/hospital/controller/MedicineController.java`
- [Staff portals](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/controller/SupportStaffController.java): `src/main/java/com/hemanth/hospital/controller/SupportStaffController.java`
- [Reception services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/ReceptionistService.java): `src/main/java/com/hemanth/hospital/service/ReceptionistService.java`
- [Pharmacy services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/PharmacistService.java): `src/main/java/com/hemanth/hospital/service/PharmacistService.java`
- [Administration services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/AdminService.java): `src/main/java/com/hemanth/hospital/service/AdminService.java`
- [Nurse services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/NurseService.java): `src/main/java/com/hemanth/hospital/service/NurseService.java`
- [Medicine services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/MedicineService.java): `src/main/java/com/hemanth/hospital/service/MedicineService.java`
- [Billing services](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/service/BillService.java): `src/main/java/com/hemanth/hospital/service/BillService.java`

### Domain and persistence

- [Patient records](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/PatientRepository.java): `src/main/java/com/hemanth/hospital/repository/PatientRepository.java`
- [Appointment records](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/AppointmentRepository.java): `src/main/java/com/hemanth/hospital/repository/AppointmentRepository.java`
- [User records](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/repository/UserRepository.java): `src/main/java/com/hemanth/hospital/repository/UserRepository.java`
- [Hospital entities](https://github.com/hemanthsaiburla/hospital-management-system/blob/main/src/main/java/com/hemanth/hospital/models/Patient.java): `src/main/java/com/hemanth/hospital/models/Patient.java`
- **MySQL database**

### Other components

- **Patient and staff**

## Connections

- Patient and staff → Role login: requests access
- Patient and staff → Patient portal: books care
- Role login → User services: validates user
- Patient portal → Patient services: manages patients (evidence: `src/main/java/com/hemanth/hospital/controller/PatientController.java`)
- Patient portal → Appointment services: books appointment (evidence: `src/main/java/com/hemanth/hospital/controller/PatientController.java`)
- Doctor portal → Doctor services: updates records (evidence: `src/main/java/com/hemanth/hospital/controller/DoctorController.java`)
- Doctor portal → Appointment services: loads appointments (evidence: `src/main/java/com/hemanth/hospital/controller/DoctorController.java`)
- Doctor portal → Diagnostic assistant: uses assistant
- Reception desk → Reception services: registers patients (evidence: `src/main/java/com/hemanth/hospital/controller/ReceptionistController.java`)
- Reception desk → Appointment services: loads appointments (evidence: `src/main/java/com/hemanth/hospital/controller/ReceptionistController.java`)
- Pharmacy portal → Pharmacy services: checks dispensing (evidence: `src/main/java/com/hemanth/hospital/controller/PharmacistController.java`)
- Appointment API → Appointment services: handles bookings
- Medicine API → Medicine services: manages medicines
- Nurse portal → Nurse services: manages nurses (evidence: `src/main/java/com/hemanth/hospital/controller/NurseController.java`)
- Admin portal → Administration services: manages staff (evidence: `src/main/java/com/hemanth/hospital/controller/AdminController.java`)
- Admin portal → User services: creates users (evidence: `src/main/java/com/hemanth/hospital/controller/AdminController.java`)
- Admin portal → Appointment services: loads statistics (evidence: `src/main/java/com/hemanth/hospital/controller/AdminController.java`)
- Staff portals → Nurse services: staff operations
- Doctor services → Patient records: uses records
- Patient services → Patient records: uses records
- Reception services → Patient records: reads and writes (evidence: `src/main/java/com/hemanth/hospital/service/ReceptionistService.java`)
- Pharmacy services → Patient records: updates dispensing (evidence: `src/main/java/com/hemanth/hospital/service/PharmacistService.java`)
- Appointment services → Appointment records: reads and writes (evidence: `src/main/java/com/hemanth/hospital/service/AppointmentService.java`)
- User services → User records: reads and writes (evidence: `src/main/java/com/hemanth/hospital/service/UserService.java`)
- Pharmacy services → Hospital entities: updates status (evidence: `src/main/java/com/hemanth/hospital/service/PharmacistService.java`)
- Patient records → MySQL database: persists records
- Appointment records → MySQL database: persists records
- User records → MySQL database: persists records
- Billing API → Billing services: handles billing
