# johndave-padolina/data-structures architecture

> Architecture diagram of the GitHub repository johndave-padolina/data-structures, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johndave-padolina/data-structures
- Repository: https://github.com/johndave-padolina/data-structures

## Overview

This is a console-based hospital data-management system, implemented in one Python file with text-file records. Its central workflow supports appointments and consultation updates, including queueing patients, recording care, and completing consultations. The same program also provides record maintenance and patient consultation history. The excerpts show queue and action handling, but not the complete menu routing or all file operations; dashed edges indicate unverified entry-point relationships, and unsampled capabilities are represented only where supported by the file tree or excerpts.

Main entry points: [`hospital_system.py`](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py) (Priority queue), [`consultations.txt`](https://github.com/johndave-padolina/data-structures/blob/main/consultations.txt) (Consultations), [`doctors.txt`](https://github.com/johndave-padolina/data-structures/blob/main/doctors.txt) (Doctors), [`clinics.txt`](https://github.com/johndave-padolina/data-structures/blob/main/clinics.txt) (Clinics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Consultation workflow"]
  node_appointments["Appointments<br/>[hospital_system.py]"]
  node_queue["Priority queue<br/>[hospital_system.py]"]
  node_care_updates["Care updates<br/>[hospital_system.py]"]
  node_action_history["Action stack<br/>[hospital_system.py]"]
end

subgraph group_records["Records and history"]
  node_record_admin["Record maintenance<br/>[hospital_system.py]"]
  node_patient_history["Patient history<br/>[hospital_system.py]"]
end

subgraph group_storage["Text-file data"]
  node_consultations[("Consultations<br/>[consultations.txt]")]
  node_consult_history_file[("Consultation history")]
  node_patients[("Patients<br/>[patients.txt]")]
  node_doctors[("Doctors<br/>[doctors.txt]")]
  node_hospitals[("Hospitals<br/>[hospitals.txt]")]
  node_clinics[("Clinics<br/>[clinics.txt]")]
  node_illnesses[("Illnesses<br/>[illnesses.txt]")]
  node_symptoms[("Symptoms<br/>[symptoms.txt]")]
  node_facilities[("Facilities<br/>[facilities.txt]")]
end

node_user(("Staff user"))
node_app["Console system<br/>[hospital_system.py]"]

node_user -.->|"uses"| node_app
node_app -.->|"offers"| node_appointments
node_app -.->|"offers"| node_record_admin
node_app -.->|"offers"| node_patient_history
node_appointments -.->|"queues patients"| node_queue
node_queue -.->|"dispatches care"| node_care_updates
node_care_updates -->|"records actions"| node_action_history
node_care_updates -->|"dequeues completion"| node_queue
node_queue -->|"rebuilds from"| node_consultations
node_queue -->|"looks up"| node_doctors
node_record_admin -->|"saves records"| node_clinics
node_patient_history -->|"reads history"| node_consultations

click node_app "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_appointments "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_queue "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_care_updates "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_action_history "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_record_admin "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_patient_history "https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py"
click node_consultations "https://github.com/johndave-padolina/data-structures/blob/main/consultations.txt"
click node_consult_history_file "https://github.com/johndave-padolina/data-structures/blob/main/consultation_history.txt"
click node_patients "https://github.com/johndave-padolina/data-structures/blob/main/patients.txt"
click node_doctors "https://github.com/johndave-padolina/data-structures/blob/main/doctors.txt"
click node_hospitals "https://github.com/johndave-padolina/data-structures/blob/main/hospitals.txt"
click node_clinics "https://github.com/johndave-padolina/data-structures/blob/main/clinics.txt"
click node_illnesses "https://github.com/johndave-padolina/data-structures/blob/main/illnesses.txt"
click node_symptoms "https://github.com/johndave-padolina/data-structures/blob/main/symptoms.txt"
click node_facilities "https://github.com/johndave-padolina/data-structures/blob/main/facilities.txt"

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_appointments,node_queue,node_care_updates,node_action_history,node_user toneBlue
class node_record_admin,node_patient_history toneAmber
class node_consultations,node_consult_history_file,node_patients,node_doctors,node_hospitals,node_clinics,node_illnesses,node_symptoms,node_facilities toneMint
class node_app toneTeal
```

## Components

### Consultation workflow

- [Appointments](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`
- [Priority queue](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`
- [Care updates](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`
- [Action stack](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`

### Records and history

- [Record maintenance](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`
- [Patient history](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`

### Text-file data

- [Consultations](https://github.com/johndave-padolina/data-structures/blob/main/consultations.txt): `consultations.txt`
- [Consultation history](https://github.com/johndave-padolina/data-structures/blob/main/consultation_history.txt): `consultation_history.txt`
- [Patients](https://github.com/johndave-padolina/data-structures/blob/main/patients.txt): `patients.txt`
- [Doctors](https://github.com/johndave-padolina/data-structures/blob/main/doctors.txt): `doctors.txt`
- [Hospitals](https://github.com/johndave-padolina/data-structures/blob/main/hospitals.txt): `hospitals.txt`
- [Clinics](https://github.com/johndave-padolina/data-structures/blob/main/clinics.txt): `clinics.txt`
- [Illnesses](https://github.com/johndave-padolina/data-structures/blob/main/illnesses.txt): `illnesses.txt`
- [Symptoms](https://github.com/johndave-padolina/data-structures/blob/main/symptoms.txt): `symptoms.txt`
- [Facilities](https://github.com/johndave-padolina/data-structures/blob/main/facilities.txt): `facilities.txt`

### Other components

- **Staff user**
- [Console system](https://github.com/johndave-padolina/data-structures/blob/main/hospital_system.py): `hospital_system.py`

## Connections

- Staff user → Console system: uses
- Console system → Appointments: offers (evidence: `hospital_system.py`)
- Console system → Record maintenance: offers (evidence: `hospital_system.py`)
- Console system → Patient history: offers (evidence: `hospital_system.py`)
- Appointments → Priority queue: queues patients (evidence: `hospital_system.py`)
- Priority queue → Care updates: dispatches care (evidence: `hospital_system.py`)
- Care updates → Action stack: records actions (evidence: `hospital_system.py`)
- Care updates → Priority queue: dequeues completion (evidence: `hospital_system.py`)
- Priority queue → Consultations: rebuilds from (evidence: `hospital_system.py`)
- Priority queue → Doctors: looks up (evidence: `hospital_system.py`)
- Record maintenance → Clinics: saves records (evidence: `hospital_system.py`)
- Patient history → Consultations: reads history (evidence: `hospital_system.py`)
