NHS Performance Dashboard

πŸš€ NHS Performance Dashboard V1

License Repo Size FastAPI Jinja2 TailwindCSS Chart.js DuckDB Pandas Pydantic Faker NHS Number Last Commit


An end-to-end Clinical Intelligence suite that monitors patient wait times and predicts RTT (Referral to Treatment) breaches using a high-performance DuckDB analytical engine. This project features a full modular pipeline: synthetic patient generation with Faker and nhs-number validation, high-speed data processing via Polars and Pandas, and a FastAPI-powered dashboard with real-time waitlist metrics and specialty distribution charts


πŸ“Έ Screenshots

NHS Performance Dashboard NHS Performance Dashboard NHS Performance Dashboard NHS Performance Dashboard


πŸ› οΈ Setup Instructions

Clone the Repository

git clone https://github.com/reory/nhs-performance-dashboard.git
cd nhs-performance-dashboard

1. Create a Virtual Environment

python -m venv venv
source venv/Scripts/activate # On mac/linux venv/bin/activate

2. Install Dependencies

pip install -r requirements.txt

Initialize the Data Engine

python generate_faker_data.py

Launch the Dashboard

Run the Uvicorn server to host the FastAPI application.

uvicorn app.main:app --reload

Navigate to http://127.0.0.1:8000 to view the live clinical suite.


πŸ“‚ Project Structure

nhs_performance_dashboard/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ database.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ routers/
β”‚   β”‚   β”œβ”€β”€ api.py
β”‚   β”‚   └── dashboard.py
β”‚   └── templates/
|       β”œβ”€β”€ html_components/
|       |    └── charts.html
|       |    β”œβ”€β”€ metrics.html
β”‚       |    β”œβ”€β”€ navbar.html
β”‚       |    β”œβ”€β”€ search_bar.html
β”‚       |    β”œβ”€β”€ table.html
|       β”œβ”€β”€ js_components/
|       |    └── charts_logic.html
|       |    β”œβ”€β”€ js_scripts.html
β”‚       |    β”œβ”€β”€ metrics.html
β”‚       |    β”œβ”€β”€ search_logic.html
β”‚       β”œβ”€β”€ base.html
|       β”œβ”€β”€ index.html
β”œβ”€β”€ data/
β”‚   └── hospital_data.db
β”œβ”€β”€ scripts/
β”‚   └── generate_faker_data.py
|   └── view_all.py
β”œβ”€β”€ tests/
|   └── conftest.py
|   └── test_clinical_logic.py
|   └── test_connection.py
|   └── test_validation.py
β”œβ”€β”€ .venv
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENCE.md
β”œβ”€β”€ pytest.ini


πŸ’» Tech Stack


πŸ§ͺ Testing

Consistent with my professional workflow in the West Yorkshire Traffic Intelligence Suite,and other projects, this project includes a full Pytest suite to ensure RTT breach calculations and search logic remain modular and predictable.

pytest

🀝 Contributing


πŸ“ Notes


πŸ—ΊοΈ Roadmap


❀️ Thanks

Faker - For helping create the fake data. The NHS Digital Community: For maintaining the open standards and logic found in the nhs-number validation libraries. The FastAPI & NiceGUI Teams: For creating high-performance frameworks that make complex clinical dashboards possible with Python. The Open Source Community: For the Faker and DuckDB projects, which allow developers to build and test robust systems without compromising real-world patient privacy.


Built By Roy Peters Click here for contact details😁