Skip to main content

This is a simple wrapper for working with the NHS referral-to-treatment dataset.

Project description

Web scraper for NHS rtt waiting time dataset

Note: ⚠️ Unofficial. This package provides programmatic access to publicly available NHS England Referral to Treatment (RTT) data. It is not affiliated with or endorsed by NHS England.

Database tables

Referral to Treatment (RTT) tables

all_rtt_raw

The raw data is initially imported into the all_rtt_raw table. We fix some column names that differ between releases of the data, and downcase and remove spaces from column names, and drop descriptive columns in favour of normalizing the codes to auxiliary tables later. This table has duplicate provider per-specialty, per-period as a provider can be commissioned by multiple commissioning organisations.

  • Fix variations in column names
  • Downcase column names
  • Drop descriptive columns
  • Normalize variations in period column names

The data has a per provider, per-period, per-specialty view, with duplicates for each of potentially multiple commissioning organisations, and then many columns containing metrics for waiting times in buckets. The number of buckets was previously up until 52 weeks and has more recently been increased to 104 weeks.

consolidated

This table consolidates the per-commissioning organisation into a single row per provider per period per specialty. The buckets are aggregated into totals for each pathway type. A lag window is used to calculate the operning and closing metrics for various pathway totals, and diffs between start and end of period.

pathways (admitted, incomplete, incomplete_with_dta, new_periods, nonadmitted)

These tables are the aggregated bucketed quantities for each pathway type, aggregated by commissioning organisation.

new_periods doesn't have buckets as its just an amount of new periods during that period.

known_issues:

  - description: Excel auto-format converts "10-19" to "Oct-19"
    affected_files: ["Outpatients 22-23", "Outpatients 23-24"]
    fixed_in: "24-25"
    remediation: map 'Oct-19' → '10-19'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nhs_waiting_lists-0.1.1.tar.gz (90.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nhs_waiting_lists-0.1.1-py3-none-any.whl (113.6 kB view details)

Uploaded Python 3

File details

Details for the file nhs_waiting_lists-0.1.1.tar.gz.

File metadata

  • Download URL: nhs_waiting_lists-0.1.1.tar.gz
  • Upload date:
  • Size: 90.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.21

File hashes

Hashes for nhs_waiting_lists-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ee37b9b1b7fd7f77eae4eb2168e27974434e67a3171c24a86cddb1724e8d0e0
MD5 0731591db80783486c9f788e5eaf6b30
BLAKE2b-256 a5dae0c720b7e972b8ee290e915b19e0d7db9a7c5d54fb72a2e4eebdea6c4fa3

See more details on using hashes here.

File details

Details for the file nhs_waiting_lists-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nhs_waiting_lists-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aefb94f5d8cc112dbd20f5427cd70f851b86c5cbf97f19dfbe8b20761e76d4d4
MD5 9076155b20650e0afb5b3890b926605e
BLAKE2b-256 8d4063eba39af0f159c64bd7e84957efd971f71eb910062335d76886ebaf7967

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page