# 0xfaysal/hospital-management-system architecture

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

## Overview

A Windows-oriented, menu-driven hospital administration program. The operator selects doctor or patient record operations, manages treatment details, checks billing or views statistics; records are held in memory and persisted to text files. The implementation is concentrated in main.c, so components below describe its runtime responsibilities rather than separate modules. The source excerpts are partial; README-documented capabilities are included, but uncertain internal call wiring is omitted.

Main entry points: [`main.c`](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c) (Menu controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console interaction"]
  node_menu["Menu controller<br/>[main.c]"]
end

subgraph group_records["Record management"]
  node_doctor_ops["Doctor records<br/>[main.c]"]
  node_patient_ops["Patient records<br/>[main.c]"]
  node_treatment["Treatment details<br/>[main.c]"]
  node_doctor_state["Doctor data<br/>[main.c]"]
  node_patient_state["Patient data<br/>[main.c]"]
end

subgraph group_finance["Billing and reporting"]
  node_billing["Patient billing<br/>[main.c]"]
  node_statistics["Hospital statistics<br/>[main.c]"]
end

subgraph group_persistence["Persistence"]
  node_doctor_file[("Doctor text file")]
  node_patient_file[("Patient text file")]
end

node_operator(("Hospital operator"))

node_operator -->|"selects options"| node_menu
node_menu -->|"dispatches doctor actions"| node_doctor_ops
node_menu -->|"dispatches patient actions"| node_patient_ops
node_menu -->|"dispatches billing"| node_billing
node_menu -->|"displays counts"| node_statistics
node_doctor_ops -->|"updates or searches"| node_doctor_state
node_patient_ops -->|"updates or searches"| node_patient_state
node_patient_ops -->|"captures treatment"| node_treatment
node_billing -->|"reads bill data"| node_patient_state
node_statistics -->|"counts doctors"| node_doctor_state
node_statistics -->|"counts patients"| node_patient_state
node_menu -->|"loads and saves"| node_doctor_file
node_menu -->|"loads and saves"| node_patient_file

click node_menu "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_doctor_ops "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_patient_ops "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_treatment "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_billing "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_statistics "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_doctor_state "https://github.com/0xfaysal/hospital-management-system/blob/main/main.c"
click node_patient_state "https://github.com/0xfaysal/hospital-management-system/blob/main/main.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_menu toneBlue
class node_doctor_ops,node_patient_ops,node_treatment,node_doctor_state,node_patient_state toneAmber
class node_billing,node_statistics toneMint
class node_doctor_file,node_patient_file toneRose
class node_operator toneIndigo
```

## Components

### Console interaction

- [Menu controller](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`

### Record management

- [Doctor records](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`
- [Patient records](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`
- [Treatment details](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`
- [Doctor data](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`
- [Patient data](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`

### Billing and reporting

- [Patient billing](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`
- [Hospital statistics](https://github.com/0xfaysal/hospital-management-system/blob/main/main.c): `main.c`

### Persistence

- **Doctor text file**
- **Patient text file**

### Other components

- **Hospital operator**

## Connections

- Hospital operator → Menu controller: selects options
- Menu controller → Doctor records: dispatches doctor actions
- Menu controller → Patient records: dispatches patient actions
- Menu controller → Patient billing: dispatches billing
- Menu controller → Hospital statistics: displays counts
- Doctor records → Doctor data: updates or searches
- Patient records → Patient data: updates or searches
- Patient records → Treatment details: captures treatment
- Patient billing → Patient data: reads bill data
- Hospital statistics → Doctor data: counts doctors
- Hospital statistics → Patient data: counts patients
- Menu controller → Doctor text file: loads and saves
- Menu controller → Patient text file: loads and saves
