Skip to content

About the library

The National Reusable Code Library is a catalogue of healthcare data code written in and for the NHS. It indexes GitHub repositories, public and private, using structured metadata, so that analysts, engineers, and data scientists can find work that already exists before building their own.

NHS organisations solve the same data problems again and again: validating NHS numbers, extracting SUS data, forecasting waiting lists, masking patient identifiers. Most of that code never leaves the team that wrote it. The library exists to change that. It does not demand polished packages; it makes whatever exists discoverable first and reusable over time.

The SUL principle

The library encourages developers to think about their code in three decoupled layers:

Layer What it is Example
S - Structural Templates, folder structures, project skeletons A cookiecutter template for analytics projects
U - Utility Generic helper functions decoupled from project logic An NHS number validation function
L - Logic Bespoke project-specific code, clearly separated The SQL for one trust's A&E extract

Code rarely transfers wholesale between organisations, but its layers do. Another team may not want your waiting list dashboard, but they may want your date-handling utilities, or your project skeleton, or just the logic of your approach. Separating the three makes each one liftable on its own.

Every catalogue entry records which SUL layers it demonstrates, and the reusability framework uses SUL thinking to define its Silver and Gold tiers.

The reusability framework

Reproducibility (the code produces the right results) is vital, but for a national library reusability (someone else can adapt the code) matters just as much. Each entry is tiered:

  • Baseline: discoverable, catalogued and findable
  • Bronze: transferable, tidy enough to read and copy from
  • Silver: modular, config-driven, with adaptation instructions
  • Gold: plug-and-play, packaged, tested, documented

See the full framework for the requirements at each tier, and try the self-assessment checklist to place your own code.

Alongside the tier, each entry carries a quality score measuring how complete and current its catalogue metadata is.

Who is sharing

The organisations page lists every NHS organisation with code in the library and links to their entries.

Relationship to the HSMA Atlas

The HSMA Decision Intelligence Atlas catalogues simulation, modelling, and decision-support projects from the HSMA community. Some projects belong in both places. Entries cross-listed on the Atlas carry an "HSMA Atlas" badge linking to their Atlas page, and scripts/export_atlas.py can draft an Atlas entry from our metadata to make cross-submission easier.

Get involved