# klstudyhub/hospital-patient-record-system-hprs- architecture

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

- Interactive diagram: https://gitdiagram.com/klstudyhub/hospital-patient-record-system-hprs-
- Repository: https://github.com/klstudyhub/hospital-patient-record-system-hprs-

## Overview

HPRS is a small interactive hospital-records application. A user selects an operation in the command-line menu; the HPRS controller registers and searches patients, admits them to capacity-limited wards, updates bills, or requests occupancy analytics. Patient objects hold demographic, admission, and billing state, while Ward objects track assigned patients. Analytics turns ward occupancy into a displayed chart. The sampled code shows in-memory state only; no persistent database or discharge workflow is evident.

Main entry points: [`system.py`](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/system.py) (HPRS Controller), [`main.py`](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/main.py) (Menu), [`analytics.py`](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/analytics.py) (Occupancy Analytics), [`patient.py`](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/patient.py) (Patient Record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_cli["Menu<br/>[main.py]"]
end

subgraph group_records["Patient Operations"]
  node_controller["HPRS Controller<br/>[system.py]"]
  node_patient["Patient Record<br/>[patient.py]"]
  node_ward["Ward Capacity<br/>[ward.py]"]
end

subgraph group_reporting["Analytics"]
  node_analytics["Occupancy Analytics<br/>[analytics.py]"]
end

node_user(("User"))
node_plotting["Matplotlib"]

node_user -->|"selects operation"| node_cli
node_cli -->|"dispatches actions"| node_controller
node_controller -->|"creates records"| node_patient
node_controller -->|"displays search result"| node_patient
node_controller -->|"assigns patient"| node_ward
node_controller -->|"requests chart"| node_analytics
node_analytics -->|"renders chart"| node_plotting

click node_cli "https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/main.py"
click node_controller "https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/system.py"
click node_patient "https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/patient.py"
click node_ward "https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/ward.py"
click node_analytics "https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/analytics.py"

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_cli,node_user toneBlue
class node_controller,node_patient,node_ward toneAmber
class node_analytics toneMint
class node_plotting toneIndigo
```

## Components

### User Interface

- [Menu](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/main.py): `main.py`

### Patient Operations

- [HPRS Controller](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/system.py): `system.py`
- [Patient Record](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/patient.py): `patient.py`
- [Ward Capacity](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/ward.py): `ward.py`

### Analytics

- [Occupancy Analytics](https://github.com/klstudyhub/hospital-patient-record-system-hprs-/blob/main/analytics.py): `analytics.py`

### Other components

- **User**
- **Matplotlib**

## Connections

- User → Menu: selects operation
- Menu → HPRS Controller: dispatches actions
- HPRS Controller → Patient Record: creates records
- HPRS Controller → Patient Record: displays search result
- HPRS Controller → Ward Capacity: assigns patient
- HPRS Controller → Occupancy Analytics: requests chart
- Occupancy Analytics → Matplotlib: renders chart
