Skip to content

National Reusable Code Library

Discover, share, and adapt healthcare data code from across the NHS. Every entry is catalogued, scored for metadata quality, and tiered for reusability, then linked to its source repository.

Browse the catalogue Submit your code

Synthetic Patient Generator

NHS Example Analytics Collaborative · IG & Security · Data Masking Scripts

A Python package that generates realistic but entirely synthetic patient demographics, spells, and pathways for testing NHS data pipelines. Output conforms to NHS Data...

synthetic-data nhsdd test-data data-masking +1

Gold 100% Python

Success stories

Synthetic Patient Generator

Used by four organisations to replace ad hoc copies of live data in their development environments, closing a long-standing IG audit action at each.

NHS Example Analytics Collaborative

NHS Number Validator

Adopted by six trusts as a shared dependency, eliminating 400 lines of duplicated validation code across their pipelines.

NHS Example Organisation

Recently added

A&E Daily Attendance Extract

NHS Example Trust · Data Engineering · Ad Hoc Extractions

SQL scripts to extract daily A&E attendance and four-hour performance data from a trust's local SUS mirror. Written to answer a one-off operational question but shared so...

a-and-e sus ed four-hour-standard +1

Baseline 65% SQL private

Reusable RAP CI Workflows

NHS Example Data Science Network · DataOps & DevOps · CI/CD Pipelines

A set of reusable GitHub Actions workflows for NHS analytics repositories: linting, testing, dependency audit, and Quarto/MkDocs publishing, workflows that teams call from a...

ci-cd rap github-actions linting +1

Silver 75% YAML

Bed Occupancy Dashboard

NHS Example Foundation Trust · Data Analytics · Dashboards

An R Shiny dashboard giving site managers a live view of bed occupancy, admissions, and discharges by ward. Pulls from a standard staging table and is config-driven so other...

bed-management patient-flow shiny urgent-care +1

Silver 75% R SQL

SUS Ingest Pipeline

NHS Example Commissioning Support Unit · Data Engineering · Data Pipelines (Automated)

A Python and SQL pipeline that lands the monthly SUS extract, applies standard data quality checks, and loads conformed admitted patient care tables into a local warehouse....

sus apc etl data-quality +1

Silver 65% Python SQL private

RTT Waiting Times Report

NHS Example Integrated Care Board · Data Analytics · Automated Reporting Pipelines

A Quarto pipeline that produces the monthly referral-to-treatment waiting times report from the national RTT extract. Generates trust and specialty level breakdowns with...

rtt waiting-lists elective-recovery quarto +1

Bronze 65% R private

Entries by reusability tier

Every entry is assessed against the reusability framework, from Baseline (discoverable) to Gold (plug-and-play). Not sure where your code sits? The framework page has a self-assessment checklist.

Gold
3
Silver
5
Bronze
3
Baseline
2

Where next