An Emergency Severity Index (ESI)-aligned clinical risk assessment microservice built for low-resource deployment environments.
# Afya Triage Microservice
An Emergency Severity Index (ESI)-aligned clinical risk assessment microservice built for low-resource deployment environments.
---
## 📖 The Story Behind Afya Triage
**Afya** is the Swahili word for **"Health"**.
In rural clinics and under-resourced emergency departments across East Africa, healthcare workers face severe staffing shortages and overwhelming patient surges. Delayed recognition of critically ill individuals—particularly patients with silent hypoxia or unstable vital signs—frequently leads to preventable morbidity and mortality.
**Afya Triage** was built as a zero-dependency, deterministic clinical triage engine capable of running on low-cost edge devices and Android hardware via Termux. It prioritizes patients into 4 clinical urgency levels and enforces strict safety overrides for severe hypoxia (SpO2 < 88%), ensuring vital risk decisions occur in milliseconds even during power or internet grid failures.
---
## 📊 Analytics & Distribution Visualizations
---
## 🚀 Key Features
- **Deterministic Risk Engine**: Weighted clinical scoring based on vital signs with hard safety overrides for acute hypoxia (SpO2 < 88%).
- **Dual API Specs**: Supports both single-patient real-time assessment and array-based batch processing.
- **Production-Ready Stack**: Powered by Flask WSGI behind Gunicorn with multi-worker concurrency.
- **Automated Streak Tracker**: Daily GitHub Actions heartbeat workflow (`.github/workflows/daily-streak.yml`) to keep repository metrics active.
---
## 📦 Project Structure
afya-triage/
├── .github/workflows/
│ ├── ci.yml # GitHub Actions CI pipeline
│ └── daily-streak.yml # Automated daily commit streak workflow
├── data/ # Synthetic patient data store
├── docs/ # Generated SVG visualizations
├── models/ # Model evaluation metadata
├── src/
│ ├── api.py # Flask REST endpoints
│ ├── dataset.py …