How nhsdigital/mental-health-monthly-statistics works
This repository produces NHS England’s Mental Health Services Monthly Statistics from MHSDS data through several distinct publication pipelines. The main documented workflow prepares and aggregates measures, with additional pipelines for newer measures, publication-specific metrics, and data-quality outputs. The tree also includes restraint statistics and inpatient productivity outputs. The README establishes the pipelines’ purpose and contribution, but most sampled files do not name other modules; consequently, internal call relationships are not inferred. Some subsystem stages are represented by their exact directories because their individual files were not sampled.
Main entry points: menh_analysis Main measures · menh_publications Publication measures · menh_bbrb Newer measures · menh_dq DQ outputs
Components 26
Main analysis
- Main measures
Mental_Health_Monthly_Statistics/menh_analysis - Measure preparation
Mental_Health_Monthly_Statistics/menh_analysis/notebooks/01_Prepare - Lookup data
Mental_Health_Monthly_Statistics/menh_analysis/notebooks/01_Prepare/0.Insert_lookup_data.py - Measure aggregation
Mental_Health_Monthly_Statistics/menh_analysis/notebooks/02_Aggregate - LDA measures
Mental_Health_Monthly_Statistics/menh_analysis/notebooks/02_Aggregate/6.LDA.py - LDA extraction
Mental_Health_Monthly_Statistics/menh_analysis/notebooks/03_Extract
Publication measures
- Publication measures
Mental_Health_Monthly_Statistics/menh_publications - CYP ED waits
Mental_Health_Monthly_Statistics/menh_publications/notebooks/04a_CYP_ED_WaitingTimes/02_Aggregate/01_CYP_ED_WT_Aggregate.py - EIP measures
Mental_Health_Monthly_Statistics/menh_publications/notebooks/07_EIP/02_Aggregate/01_EIP_Aggregate_non_ethnicity.py
Newer measures
- Newer measures
Mental_Health_Monthly_Statistics/menh_bbrb - MHSDS references
Mental_Health_Monthly_Statistics/menh_bbrb/notebooks/01_Generic_Prepare/04_mhsds_ref_tables.py - Four-week waits
Mental_Health_Monthly_Statistics/menh_bbrb/notebooks/02_Specific_Prepare/02_4w_waits/4w_waits_prep.py - OAPS methodology
Mental_Health_Monthly_Statistics/menh_bbrb/notebooks/02_Specific_Prepare/08_oaps/oaps_prep.py - MHA preparation
Mental_Health_Monthly_Statistics/menh_bbrb/notebooks/02_Specific_Prepare/10_mha/mha_prep.py - Measure definitions
Mental_Health_Monthly_Statistics/menh_bbrb/notebooks/measure_metadata.py
Data quality
- DQ outputs
Mental_Health_Monthly_Statistics/menh_dq - Coverage extraction
Mental_Health_Monthly_Statistics/menh_dq/notebooks/3.extract/3.3.coverage_csvs.py - Validity aggregation
Mental_Health_Monthly_Statistics/menh_dq/notebooks/2.aggregate/validity_CDQA.py
Restraints
- Restraint statistics
Mental_Health_Monthly_Statistics/Restraints - Dashboard CSV build
Mental_Health_Monthly_Statistics/Restraints/Restraints_Dashboard_CSV_Build_v4.py - Published metrics
Mental_Health_Monthly_Statistics/Restraints/Restraints_Published_CSV_Build - Output suppression
Mental_Health_Monthly_Statistics/Restraints/Restraints_Suppression
Productivity
- Inpatient productivity
Mental_Health_Monthly_Statistics/mental_health_productivity/MH Productivity Inpatients CWA - CWA outputs
Mental_Health_Monthly_Statistics/mental_health_productivity/MH Productivity Inpatients CWA/AllOutputsV6_CWA.py
Other components
- Statistics producers
- MHSDS data
Connections 12
- Statistics producers → Main measures: runs
- Statistics producers → Publication measures: runs
- Statistics producers → Newer measures: runs
- Statistics producers → DQ outputs: runs
- MHSDS data → Main measures: provides data
- MHSDS data → Publication measures: provides data
- MHSDS data → Newer measures: provides data
- MHSDS data → DQ outputs: provides data
- Main measures → Statistics producers: contributes statistics
- Publication measures → Statistics producers: contributes statistics
- Newer measures → Statistics producers: contributes statistics
- DQ outputs → Statistics producers: provides DQ files