# dantondanvin/hospital-management-system architecture

> Architecture diagram of the GitHub repository dantondanvin/hospital-management-system, 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/dantondanvin/hospital-management-system
- Repository: https://github.com/dantondanvin/hospital-management-system

## Overview

This is a terminal-based hospital patient and bed management program. A user enters through password setup, reaches the main menu, and can register, edit, display, or delete patient records, inspect the patient list and count, or check bed availability. Patient IDs correspond to slots in a fixed-capacity, in-memory patient store; bed availability is tracked alongside those records. The excerpts show menu dispatch and direct state access, but not persistent storage. README-listed capabilities are represented where supported; the sampled code is incomplete.

Main entry points: [`HospitalManagementSystem.c`](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c) (Patient menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Menus and Access"]
  node_auth["Password entry"]
  node_mainmenu["Main menu"]
  node_patientmenu["Patient menu"]
end

subgraph group_patients["Patient Records"]
  node_patientstate["Patient and bed state"]
  node_register["Register patient"]
  node_maintain["Edit or display patient"]
  node_delete["Delete patient"]
  node_directory["Patient directory"]
  node_patientcount["Patient count"]
end

subgraph group_beds["Bed Capacity"]
  node_bedmenu["Bed availability"]
end

node_user(("Hospital staff"))

node_user -->|"enters password"| node_auth
node_auth -->|"continues to"| node_mainmenu
node_mainmenu -->|"opens records"| node_patientmenu
node_mainmenu -->|"checks beds"| node_bedmenu
node_patientmenu -->|"dispatches"| node_register
node_patientmenu -->|"dispatches"| node_maintain
node_patientmenu -->|"dispatches"| node_delete
node_patientmenu -->|"dispatches"| node_directory
node_patientmenu -->|"dispatches"| node_patientcount
node_register -->|"writes record"| node_patientstate
node_maintain -->|"reads or edits"| node_patientstate
node_delete -->|"deletes record"| node_patientstate
node_directory -->|"reads records"| node_patientstate
node_patientcount -->|"reads count"| node_patientstate
node_bedmenu -->|"reads availability"| node_patientstate

click node_auth "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_mainmenu "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_patientmenu "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_patientstate "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_register "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_maintain "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_delete "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_directory "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_patientcount "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c"
click node_bedmenu "https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.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_auth,node_mainmenu,node_patientmenu toneBlue
class node_patientstate,node_register,node_maintain,node_delete,node_directory,node_patientcount toneAmber
class node_bedmenu toneMint
class node_user toneIndigo
```

## Components

### Menus and Access

- [Password entry](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Main menu](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Patient menu](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`

### Patient Records

- [Patient and bed state](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Register patient](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Edit or display patient](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Delete patient](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Patient directory](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`
- [Patient count](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`

### Bed Capacity

- [Bed availability](https://github.com/dantondanvin/hospital-management-system/blob/main/HospitalManagementSystem.c): `HospitalManagementSystem.c`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → Password entry: enters password
- Password entry → Main menu: continues to
- Main menu → Patient menu: opens records
- Main menu → Bed availability: checks beds
- Patient menu → Register patient: dispatches
- Patient menu → Edit or display patient: dispatches
- Patient menu → Delete patient: dispatches
- Patient menu → Patient directory: dispatches
- Patient menu → Patient count: dispatches
- Register patient → Patient and bed state: writes record
- Edit or display patient → Patient and bed state: reads or edits
- Delete patient → Patient and bed state: deletes record
- Patient directory → Patient and bed state: reads records
- Patient count → Patient and bed state: reads count
- Bed availability → Patient and bed state: reads availability
