The OpenSAFELY framework is a secure analytics platform for electronic health records research in the NHS.
Instead of requesting access for slices of patient data and transporting them elsewhere for analysis, the framework supports developing analytics against dummy data, and then running against the real data within the same infrastructure that the data is stored. Read more at OpenSAFELY.org.
To enable this, some exploration of raw data is required in order to implement new data as easy-to-use and well-documented functions for end users.
This repo contains (will contain) a template for performing plausibility checking of datasets.
- Add codelist to the codelists/codelists.txt file
- Make changes to the analysis/config.py file
- Make changes to the analysis/config_numeric_value_checks.py file
- This code can then be run locally using the command
opensafely run run_all
- This generates a Jupyter notebook (.ipynb) file in the analysis subfolder (e.g.,
analysis/Notebook_numeric_values_<codelist_name>.ipynb
) - Someone with L2/3 access can then clone the repository and run the notebook as per these instructions.
- Add desired codelist(s) to
codelists/codelists.txt
- Download codelist(s) using
opensafely codelists update
- Specify one codelist and other required information in
analysis/config_numeric_value_checks.py
. - Generate the notebook (ipynb) file locally using the command
opensafely run create_notebook_numeric
. Alternatively, run theanalysis/create_notebook_numeric_value_checks.py
file itself directly. - Repeat steps 3-4 for each codelist.
- Commit the new & modified files to the repo.
- Someone with L2/3 access can then clone the repository and run the notebook as per these instructions.
- Notebooks can be saved to html and made available for release.