Skip to main content

NHP Data

A comprehensive data processing pipeline for the New Hospital Programme (NHP) model. This project orchestrates the extraction, transformation, and preparation of data required for the model.

Built to work in pyspark on Databricks, with Hospital Episode Statistics (HES) data.

  • Admitted Patient Care (APC)
  • Outpatient Appointments (OPA)
  • Emergency Care Dataset (ECDS), and for historical trends, Accident and Emergency (AAE)
  • ONS Population Projections
  • NHS Reference Data

Architecture

The project uses Databricks Asset Bundles to manage deployment. All processing is orchestrated through Databricks workflows that can run independently, or as part of the main pipeline.

graph TD
    ref[Reference Data]
    inputs[Inputs Data]
    ecds[ECDS Data]
    ip[Inpatient Data] 
    op[Outpatient Data]
    model[Model Data Extraction]

    ref --> ecds
    ref --> ip
    ref --> op
    
    ecds --> inputs
    ip --> inputs
    op --> inputs
    
    inputs --> model

The workflows are built into a python package, with all of the code in the src/ folder. Each task in the workflows is defined as an entry point in pyproject.toml, and by convention is a main() function which takes no arguments (parameters passed in via sys.argv).

Getting Started

Prerequisites

  • Access to Databricks workspace
  • Appropriate permissions for access to the data
  • Python 3.11+
  • uv

Installation

The project is packaged as a Python wheel and deployed via Databricks bundles:

# Build the package
uv build

# Deploy to development
databricks bundle deploy --target dev

Deployment to the prod target is via GitHub actions, and should not be done manually.

Running Workflows

Run the complete data pipeline:

databricks jobs run --job-name "Generate NHP Data"

Run individual components:

# Process reference data only
databricks jobs run --job-name "Generate NHP Data (Reference Data)"

# Process emergency care data
databricks jobs run --job-name "Generate NHP Data (AAE/ECDS)"

# Extract data for modeling containers
databricks jobs run --job-name "Extract NHP for containers"

Metadata

Release files for nhp-data 6.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nhp-data 6.0.0
File Size Uploaded
nhp_data-6.0.0.tar.gz 342.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nhp-data 6.0.0
File Interpreter ABI Platform
nhp_data-6.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 576.0 kB

Release files / nhp_data-6.0.0.tar.gz

Download URL nhp_data-6.0.0.tar.gz
Size 342.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e902d12e1d190795efa59f012aa6fd44cf33c00a6872fd0bcb1100e4e7bdc16f
BLAKE2b-256 checksum
How to use checksums
a7e4cfcdd512b60d02dd811a8a12bf05c36b5c850e2662582466c6512607ef29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / nhp_data-6.0.0-py3-none-any.whl

Download URL nhp_data-6.0.0-py3-none-any.whl
Size 233.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
480fd346fd74b3ff544fe58ec551e226841c07b3fbe74409ea8db077083f05ae
BLAKE2b-256 checksum
How to use checksums
1a0c92a8c716ccec321d4314963268b0b85c5c6b9902e1923cb8a7420a148c7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page