Introduction #
Note that much of the material on this page is reproduced verbatim from sources that are licensed under OGL and MIT, therefore links are provided to the source material in all cases.
RAP is becoming a widely known term, but for the sake of clarity it can be simply described as
The Goldacre review’s summary recommendation 17 states that RAPs should be
the core working practice that must be supported by all platforms and teams; make this a core focus of NHS analyst training.
Levels of RAP #
Within the NHS Digital RAP community of practice there are three levels of RAP given:
- Baseline - RAP fundamentals offering resilience against future change
- Silver - Implementing best practice by following good analytical and software engineering standards
- Gold - Analysis as a product to further elevate your analytical work and enhance its reusability to the public
These are summarised following.
Baseline RAP #
- Data produced by code in an open-source language (e.g., Python, R, SQL).
- Code is version controlled (see Git basics and using Git collaboratively guides).
- Repository includes a README.md file (or equivalent) that clearly details steps a user must follow to reproduce the code (use NHS Open Source Policy section on Readmes as a guide.
- Code has been peer reviewed.
- Code is published in the open and linked to & from accompanying publication (if relevant).
Silver RAP #
- Outputs are produced by code with minimal manual intervention.
- Code is well-documented including user guidance, explanation of code structure & methodology and docstrings for functions.
- Code is well-organised following standard directory format.
- Reusable functions and/or classes are used where appropriate.
- Code adheres to agreed coding standards (e.g PEP8, style guide for Pyspark).
- Pipeline includes a testing framework (unit tests, back tests).
- Repository includes dependency information (e.g. requirements.txt, PipFile, environment.yml.
- Logs are automatically recorded by the pipeline to ensure outputs are as expected.
- Data is handled and output in a Tidy data format.
Gold RAP #
- Code is fully packaged.
- Repository automatically runs tests etc. via CI/CD or a different integration/deployment tool e.g. GitHub Actions.
- Process runs based on event-based triggers (e.g., new data in database) or on a schedule.
- Changes to the RAP are clearly signposted. E.g. a changelog in the package, releases etc. (See gov.uk info on Semantic Versioning)