TriageOS is a hybrid medical software solution designed to solve the "ER Bottleneck" problem. It combines a high-performance C++ backend (optimized for mathematical sorting efficiency) with a modern Python dashboard (for real-time visualization).
Unlike standard hospital systems that use basic First-In-First-Out (FIFO) or simple Priority Queues, TriageOS utilizes a Fibonacci Heap data structure to achieve
- Smart Triage Queue: Automatically prioritizes patients based on the Emergency Severity Index (ESI) (1=Critical to 10=Non-Urgent).
- Dynamic Deterioration Engine: Allows instant re-triage. If a patient in the waiting room (Priority 4) suffers a cardiac arrest, their priority can be updated to Priority 1 instantly.
-
Mass Casualty "Merge" Protocol: In the event of a disaster (e.g., bus crash), the system can merge a secondary list of incoming ambulance patients into the main hospital queue in
$O(1)$ time. - Live Vitals Monitor: Visualizes real-time patient status including Heart Rate (BPM), Blood Pressure, and SpO2 with an animated EKG graph.
- LWBS (Left Without Being Seen): Efficiently handles patients who walk out, removing them from the queue to maintain accurate wait-time statistics.
-
Hybrid Architecture: Uses a custom
subprocessbridge to allow Python to visualize low-level C++ memory operations in real-time. -
"No-STL" Compliance: Built strictly using Raw C++ Arrays and manual memory management.
-
No
std::vector: Replaced with a customNodeVectorstruct with dynamic resizing logic. -
No
std::unordered_map: Replaced with a Direct Address Table (nodeLookup[10001]) for instant$O(1)$ access without hash collisions.
-
No
- Secure Authentication: Implements a salted DJB2 Hashing Algorithm to secure user credentials (passwords are never stored in plain text).
Why use a Fibonacci Heap? In a high-volume ER, seconds matter. Standard Binary Heaps slow down as the queue grows.
| Operation | Standard System (Binary Heap) | TriageOS (Fibonacci Heap) | Real-World Scenario |
|---|---|---|---|
| Insert Patient |
|
50 patients arrive at once during a surge. | |
| Update Priority |
|
A patient's appendix bursts while waiting. | |
| Merge Queues |
|
Integrating an ambulance convoy list. | |
| Discharge (Extract) | Doctor treats the next most critical patient. |
TriageOS/
├── src/ # THE C++ ENGINE
│ ├── Auth.cpp # Security & Hashing Logic
│ ├── Auth.h # Header for Auth
│ ├── FibHeap.cpp # The Core Fibonacci Heap Algorithms
│ ├── FibHeap.h # Header for Heap
│ ├── Node.cpp # Patient Logic (Circular Linked Lists)
│ ├── Node.h # Header for Node
│ ├── System.cpp # Command Processor & Bridge Logic
│ └── System.h # Header for System
│
├── medical_gui.py # THE PYTHON DASHBOARD (Frontend)
├── users_db.txt # Encrypted User Database
├── patients_data.txt # Patient Persistence File
└── README.md # Documentation