AI-powered hospital queue management system. Predicts wait times with 87% accuracy, flags overcrowding, and optimizes doctor allocation. MOH Kenya compliant. Built with Streamlit + scikit-learn.
# 🏥 Afya Pap - Hospital Queue Optimizer
**AI-Powered Hospital Queue Management System for Kenyan Healthcare**
> Predict wait times • Flag overcrowding • Alert doctors • Save lives
## 📊 Overview
Afya Pap is an intelligent hospital queue management system that uses machine learning to predict patient wait times, detect overcrowding, and optimize resource allocation in hospitals. Built specifically for Kenyan healthcare facilities following MOH (Ministry of Health) guidelines.
### 🎯 The Problem
- **Patients wait 6+ hours** at MTRH OPD and other Kenyan hospitals
- **Lost lives + Lost revenue** from inefficient queue management
- **No real-time visibility** into overcrowding situations
- **Poor staff allocation** leading to burnout and underutilization
- **Manual MOH reporting** that's time-consuming and error-prone
### 💡 Our Solution
Afya Pap provides:
- **87% accurate wait time predictions** using RandomForest ML
- **Real-time overcrowding alerts** with automated doctor notifications
- **Interactive dashboards** for data-driven decision making
- **MOH compliance reporting** at the click of a button
## ✨ Features
### 🔮 Wait Time Prediction
- Machine learning model (RandomForest) with R² = 0.87 accuracy
- Real-time predictions based on department, triage level, and arrival time
- Feature importance analysis for model transparency
- MOH Kenya compliance monitoring and flagging
### 📊 Advanced Analytics
- Department bottleneck analysis with visualizations
- Hourly wait time patterns and peak hour detection
- Patient satisfaction correlation with wait times
- Interactive Plotly dashboards with drill-down capabilities
### 🚨 Overcrowding Detection
- Real-time overcrowding alerts with severity levels
- MOH standard violation flagging (Emergency >15min, etc.)
- Critical patient identification (>4 hour wait)
- One-click automated doctor SMS alerts
- Overflow capacity recommendations
### 👨⚕️ Doctor Performance Dashboard
- Workload distribution visualization
- Effi …