An executive-level surveillance engine that applies kinematic principles (Velocity & Acceleration) to hospital incident data. Instead of tracking static incident counts, this system identifies "Risk Surges" by calculating the momentum and pressure of harm before sentinel events occur.
Standard hospital reporting is reactive. This engine bridges the gap between the ICU and the Boardroom by applying Classical Mechanics to patient safety data:
- Quantization (Position): Categorical Harm Levels (A-I) are encoded into a continuous Risk Priority Number (RPN).
-
Risk Velocity (
$v$ ): The first derivative of risk. It measures the rate at which harm accumulates over a sliding window ($w$ ). -
Risk Acceleration (
$a$ ): The second derivative. This is the Early Warning Signal. It detects if risk is compounding, predicting systemic breakdown.
The engine utilizes a Risk Appetite Selector allowing executives to define their tolerance for variance:
-
Zero Tolerance (
$1\sigma$ ): Alerts on top 32% of deviations. -
Standard Oversight (
$2\sigma$ ): Alerts on top 5% (Statistical Outliers). -
Critical Focus (
$3\sigma$ ): Alerts only on the top 0.3% of extreme events.
Using a discrete time-step (
-
Velocity (
$v$ ):$$v = \frac{RPN_t - RPN_{t-w}}{w}$$ -
Acceleration (
$a$ ):$$a = \frac{v_t - v_{t-w}}{w}$$
To ensure scalability and clinical reliability, the portal is architected into discrete functional modules:
app.py: The Orchestrator. Manages the Streamlit UI and executive dashboard state.risk_engine.py: The Mathematical Brain. Contains the proprietary logic for RPN quantization, velocity derivatives, and Z-score thresholding.ui_styles.py: The Design System. Defines the Apple-matte UI/CSS and clinical nomenclature (NCC MERP mapping).hospital_risk_data.csv: The clinical dataset.
- Activate Environment:
.\venv\Scripts\Activate.ps1 - Install Dependencies:
pip install -r requirements.txt - Launch Portal:
streamlit run app.py