Details of the purpose and any published outputs from this project can be found at the link above.
The contents of this repository MUST NOT be considered an accurate or valid representation of the study or its purpose. This repository may reflect an incomplete or incorrect analysis with no further ongoing work. The content has ONLY been made public to support the OpenSAFELY open science and transparency principles and to support the sharing of re-usable code for other subsequent users. No clinical, policy or safety conclusions must be drawn from the contents of this repository.
The study in this repository aims to (1) implement the QOF blood pressure indicators in OpenSAFELY and (2) provide resources and coding guidelines that help with the implementation of future QOF studies in OpnSAFELY. New QOF studies should follow the workflow and repository strcuture described in the qof-utilities GitHub repository and the general structure of this repo (for more details see this of the readme below.
General practice has been disrupted by the pandemic in many clinical areas (e.g., Curtis et al., 2021; Williams et al., 2020). This project aims to assess the impact of the pandemic on the routine management of blood pressure as measured by the QOF blood pressure indicator. High blood pressure is one of the leading risk factors for several diseases (e.g., cardiovascular disease, stroke) worldwide. Research suggests that delays in the management of high blood pressure are associated with worse clinical outcomes, for example acute cardiovascular events, or death (Xu et al., 2015).
The Quality and Outcomes Framework (QOF) outlines several indicators that focus blood pressure (BP) targets. This project aims to use OpenSAFELY to quantify the extent to which any of the relevant blood pressure QOF indicators (v46) were disrupted during the pandemic but wont link our results to clinical outcomes. A short description of the QOF blood pressure (v46) indicator BP002 is shown below:
- BP002: The percentage of patients aged 45 or over who have a record of blood pressure in the preceding 5 years.
The following list outlines the the general steps for implementing QOF indicators in OpenSAFELY:
- Add all codelists specified in the QOF busieness rules to codelists/codelists.txt. The codelists can be found on OpenCodelists under NHSD Primary Care Domain Refsets.
- Define the variables specified in the business rules in shared variable dictionaries or individyal study definitions
- Implement QOF numerator and denominator rules in study definition (see here)
- Specify measures (e.g., percentage of patients receiving indicated care, exclusions, and breakdowns) for each indicator (see here)
More details and reusable code for implementing QOF registers in OpenSAFELY are available in the qof-utilities GitHub repository.
- All codelists used in this project are available in the codelists folder.
Variables that are shared by multiple QOF indicators are specified in dictionaries (see OpenSAFELY programming tricks):
-
Demographic variables: analysis/dict_demo_variables.py
-
Variables to define the blood pressure indicator (
bp002_variables
): analysis/dict_bp_variables.pyAlmost all denominator and numerator rules can be broken down into individual variables that follow this strucutre: (1) a clinical codelist and a (2) timeframe, so variable names are following this structure:
<name_of_codelist>_<time_frame>
. For example, consider the following description of denominator rule 2 for indicator BP002:Rule number Rule Rule description or comments 2 If BP_DAT
> (PPED
– 5 years)Select patients passed to this rule who had their blood pressure recorded in the 5 year period leading up to and including the payment period end date. Pass all remaining patients to the next rule. This rule could be implemented like shown below, where the codelist ht_max_codes is defined in analysis/codelists.py.
bp002_denominator_r2=patients.satisfying( """ bp_rec_5y """, bp_rec_5y=patients.with_these_clinical_events( codelist=bp_codes, between=[ "first_day_of_month(index_date) - 5 years", "last_day_of_month(index_date)", ], returning="binary_flag", return_expectations={"incidence": 0.5}, ), ),
- Where the date of the variable will also be needed, we can make use of the
include_date_*
argument. This includes the date associated with each event to the data (see OpenSAFELY variable reference). - The variables defined in these dictionaries can then be loaded as needed in individual study defintions using
** name_of_variable_dictionary,
.
- Where the date of the variable will also be needed, we can make use of the
-
The blood pressure indicator (BP002) is specified here: analysis/study_definition_bp002.py. The denominator and numerator rules are composed using variables from the dictionaries using the
patients.satisfying()
function to:- Create a variable for each numerator and denominator rule (e.g.,
bp002_denominator_r1
), where variables for each rule number are named following this structure:<indicator>_<numerator/denominator>_<rule_number>
. - These rule variables can then again be composed to create the numerator and denominator variables (e.g.,
bp002_denominator
).
- Create a variable for each numerator and denominator rule (e.g.,
-
Commonly used dates (e.g., 'Payment Period Start Date') and variables used for breakdowns of results are defined in analysis/config.py
The main results (montly percentage of patients receiving indicated care per incicator) are calculated using the Measure()
framework (see OpenSAFELY documentation).
The following results are calculated for each measure:
- Percentage of patients receiving indicated care:
- the total target population:
measure_<condition_tag>_achievem_population_rate.csv
- different demographic and clinical breakdowns (see demographic_breakdowns list in analysis/config.py):
measure_<condition_tag>_achievem_<breakdown_tag>_breakdown_rate.csv
- individual GP practices; this data is only used to generate deciles using the reusable action deciles-charts
- the total target population:
All scripted and reusable actions are defined in the project.yaml.
- Each indicator has the following actions:
generate_study_population_<condition_tag>
: Extracts study populationgenerate_measures_<condition_tag>
: Generates measures using theMeasure()
framework (see OpenSAFELY documentation)
Developers and epidemiologists interested in the framework should review the OpenSAFELY documentation The OpenSAFELY framework is a Trusted Research Environment (TRE) for electronic health records research in the NHS, with a focus on public accountability and research quality. Read more at OpenSAFELY.org.
As standard, research projects have a MIT license.