# chiraghariprasad/hospital-management-system architecture

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

## Overview

This is a console-based hospital management system. The main workflow is staff menu interaction to maintain patient and doctor records, assign doctors, manage emergency-prioritized waiting, record visits, and save or reload hospital state. The README also describes a separate sample-data generator that assigns doctors and writes the same binary dataset. Source excerpts are partial, so links for unsampled main-program capabilities are limited to documented behavior rather than inferred helper calls.

Main entry points: [`hospital_management.c`](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c) (Console menu), [`generate_data.c`](https://github.com/chiraghariprasad/hospital-management-system/blob/main/generate_data.c) (Sample doctor assignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Hospital operations"]
  node_main["Console menu"]
  node_patients["Patient records"]
  node_doctors["Doctor management"]
  node_assignment["Specialty assignment"]
  node_queue["Priority waiting queue"]
  node_visits["Visit history"]
  node_performance["Doctor performance"]
end

subgraph group_state["Hospital state"]
  node_state_data[("Patient and doctor state")]
  node_storage["Load and save data"]
  node_data_file[("hospital_data.bin")]
end

subgraph group_seed["Sample data"]
  node_generator["Sample-data generator<br/>[generate_data.c]"]
  node_sample_assignment["Sample doctor assignment<br/>[generate_data.c]"]
end

node_staff(("Hospital staff"))

node_staff -->|"uses menu"| node_main
node_main -->|"loads and saves"| node_storage
node_storage -->|"reads and writes"| node_data_file
node_main -->|"dispatches patient tasks"| node_patients
node_main -->|"dispatches doctor tasks"| node_doctors
node_main -->|"dispatches queue tasks"| node_queue
node_main -->|"dispatches assignment"| node_assignment
node_main -->|"dispatches visit tasks"| node_visits
node_main -->|"dispatches reporting"| node_performance
node_patients -->|"updates records"| node_state_data
node_doctors -->|"updates records"| node_state_data
node_assignment -->|"updates assignments"| node_state_data
node_queue -->|"queues patient IDs"| node_state_data
node_visits -->|"updates history"| node_state_data
node_performance -->|"reads counters"| node_state_data
node_generator -->|"assigns patients"| node_sample_assignment
node_sample_assignment -->|"writes dataset"| node_data_file

click node_main "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_patients "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_doctors "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_assignment "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_queue "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_visits "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_performance "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_state_data "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_storage "https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c"
click node_generator "https://github.com/chiraghariprasad/hospital-management-system/blob/main/generate_data.c"
click node_sample_assignment "https://github.com/chiraghariprasad/hospital-management-system/blob/main/generate_data.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_patients,node_doctors,node_assignment,node_queue,node_visits,node_performance toneBlue
class node_state_data,node_storage,node_data_file toneAmber
class node_generator,node_sample_assignment toneMint
class node_staff toneIndigo
```

## Components

### Hospital operations

- [Console menu](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Patient records](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Doctor management](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Specialty assignment](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Priority waiting queue](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Visit history](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Doctor performance](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`

### Hospital state

- [Patient and doctor state](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- [Load and save data](https://github.com/chiraghariprasad/hospital-management-system/blob/main/hospital_management.c): `hospital_management.c`
- **hospital_data.bin**

### Sample data

- [Sample-data generator](https://github.com/chiraghariprasad/hospital-management-system/blob/main/generate_data.c): `generate_data.c`
- [Sample doctor assignment](https://github.com/chiraghariprasad/hospital-management-system/blob/main/generate_data.c): `generate_data.c`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → Console menu: uses menu
- Console menu → Load and save data: loads and saves
- Load and save data → hospital_data.bin: reads and writes
- Console menu → Patient records: dispatches patient tasks
- Console menu → Doctor management: dispatches doctor tasks
- Console menu → Priority waiting queue: dispatches queue tasks
- Console menu → Specialty assignment: dispatches assignment
- Console menu → Visit history: dispatches visit tasks
- Console menu → Doctor performance: dispatches reporting
- Patient records → Patient and doctor state: updates records
- Doctor management → Patient and doctor state: updates records
- Specialty assignment → Patient and doctor state: updates assignments
- Priority waiting queue → Patient and doctor state: queues patient IDs
- Visit history → Patient and doctor state: updates history
- Doctor performance → Patient and doctor state: reads counters
- Sample-data generator → Sample doctor assignment: assigns patients
- Sample doctor assignment → hospital_data.bin: writes dataset
