# aaravsingh23/hospital-management-sysytem architecture

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

- Interactive diagram: https://gitdiagram.com/aaravsingh23/hospital-management-sysytem
- Repository: https://github.com/aaravsingh23/hospital-management-sysytem

## Overview

HMS is a terminal-based hospital operations program. A user selects a menu workflow to manage patients, beds, doctors, bills, appointments, emergency triage, or search and sorting; the program loads binary records at startup and saves changes and data on exit. The runtime is implemented in one C file, so distinct responsibilities share the same path. README capabilities are included, but omitted source excerpts limit certainty about some cross-feature calls.

Main entry points: [`HMS.c`](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c) (Main and feature menus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Terminal interaction"]
  node_main["Program lifecycle<br/>[HMS.c]"]
  node_menus["Main and feature menus<br/>[HMS.c]"]
end

subgraph group_care["Hospital operations"]
  node_beds["Bed allocation<br/>[HMS.c]"]
  node_billing["Billing<br/>[HMS.c]"]
  node_appointments["Appointment scheduling<br/>[HMS.c]"]
  node_emergency["Emergency queue<br/>[HMS.c]"]
end

subgraph group_records["Records and search"]
  node_patients["Patient management<br/>[HMS.c]"]
  node_doctors["Doctor records<br/>[HMS.c]"]
  node_searchsort["Search and sorting<br/>[HMS.c]"]
end

subgraph group_persistence["Persistent data"]
  node_data["In-memory records<br/>[HMS.c]"]
  node_files[("Binary data files<br/>[HMS.c]")]
end

node_user(("Hospital staff"))

node_user -->|"chooses workflow"| node_menus
node_menus -->|"dispatches"| node_patients
node_menus -->|"dispatches"| node_doctors
node_menus -->|"dispatches"| node_beds
node_menus -->|"dispatches"| node_billing
node_menus -->|"dispatches"| node_appointments
node_menus -->|"dispatches"| node_emergency
node_menus -->|"dispatches"| node_searchsort
node_main -->|"runs"| node_menus
node_main -->|"loads at startup"| node_files
node_main -->|"saves on exit"| node_files
node_patients -->|"updates"| node_data
node_doctors -->|"updates"| node_data
node_beds -->|"updates"| node_data
node_billing -->|"updates"| node_data
node_appointments -->|"updates"| node_data
node_emergency -->|"updates"| node_data
node_searchsort -->|"searches and sorts"| node_data
node_patients -->|"saves changes"| node_files
node_doctors -->|"saves changes"| node_files
node_beds -->|"saves changes"| node_files
node_billing -->|"saves changes"| node_files
node_appointments -->|"saves changes"| node_files
node_emergency -->|"saves changes"| node_files
node_searchsort -->|"persists sorting"| node_files

click node_main "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_menus "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_patients "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_doctors "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_beds "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_billing "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_appointments "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_emergency "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_searchsort "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_data "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"
click node_files "https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c"

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_main,node_menus toneBlue
class node_beds,node_billing,node_appointments,node_emergency toneAmber
class node_patients,node_doctors,node_searchsort toneMint
class node_data,node_files toneRose
class node_user toneIndigo
```

## Components

### Terminal interaction

- [Program lifecycle](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Main and feature menus](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`

### Hospital operations

- [Bed allocation](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Billing](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Appointment scheduling](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Emergency queue](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`

### Records and search

- [Patient management](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Doctor records](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Search and sorting](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`

### Persistent data

- [In-memory records](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`
- [Binary data files](https://github.com/aaravsingh23/hospital-management-sysytem/blob/main/HMS.c): `HMS.c`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → Main and feature menus: chooses workflow
- Main and feature menus → Patient management: dispatches
- Main and feature menus → Doctor records: dispatches
- Main and feature menus → Bed allocation: dispatches
- Main and feature menus → Billing: dispatches
- Main and feature menus → Appointment scheduling: dispatches
- Main and feature menus → Emergency queue: dispatches
- Main and feature menus → Search and sorting: dispatches
- Program lifecycle → Main and feature menus: runs
- Program lifecycle → Binary data files: loads at startup
- Program lifecycle → Binary data files: saves on exit
- Patient management → In-memory records: updates
- Doctor records → In-memory records: updates
- Bed allocation → In-memory records: updates
- Billing → In-memory records: updates
- Appointment scheduling → In-memory records: updates
- Emergency queue → In-memory records: updates
- Search and sorting → In-memory records: searches and sorts
- Patient management → Binary data files: saves changes
- Doctor records → Binary data files: saves changes
- Bed allocation → Binary data files: saves changes
- Billing → Binary data files: saves changes
- Appointment scheduling → Binary data files: saves changes
- Emergency queue → Binary data files: saves changes
- Search and sorting → Binary data files: persists sorting
