Author: Pharmacy, Optometry and Dental Strategy Analysis team, NHS England
Contact: england.primarycare.phodsdata@nhs.net
This repository contains code to produce the Dental SMT Pack created by the Pharmacy, Optometry and Dental Strategy Analysis team in NHS England.
This code produces two outputs:
- National PDF report
- Excel file containing data presented in the report
- ICB HTML report
There is a further output which is not currently produced:
- Regional HTML report
The process uses the following R packages:
- tidyverse
- readxl
- DBI
- odbc
- downloadthis
- lubridate
- ggrepel
- grid
- formattable
- cowplot
- data.table
- ggpubr
- reactable
- knitr
- rmarkdown
- ggpubr
- gridExtra
- scales
- textclean
- openxlsx
- xaringanExtra
To install the required packages, run source("install_requirements.R")
in the console.
The following files define the functions used to create the reports:
- SQLpulls.Rmd - extracts data needed from NCDR
- Data_Processing.Rmd - reformats data to be used in the report
- plotting.Rmd - creates the charts and tables in the report
- appendix_functions.Rmd - carries out analysis to understand the impact of moving the pack to a new data source
The following files create the outputs:
- SMT_dental_report_National_PDF.Rmd - creates the national PDF report
- ExportDataFile.R - creates the Excel data file
- ExportDataFile_metadata.R - creates the metadata table for the Excel data file
- SMT_dental_report_region_ICB_level.rmd - creates the ICB HTML report
- DRAFT_SMT_dental_report_national_regional_level.rmd - creates the regional HTML report, note this file is not currently in use
The SMT_dental_report_National_PDF.Rmd file needs to be rendered separately using the 'Knit' option in RStudio. The Excel data file and ICB level HTML reports for all regions can be automatically produced by running the auto_render_SMT_report_functions.R file.
All other files are required to produce the outputs, for example setting up the format of all slides and creating a table of workdays to use for standardisation, or for internal set up, such as uploading the tables to the data warehouse.
Unless stated otherwise, the codebase is released under the MIT Licence. This covers both the codebase and any sample code in the documentation.
The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.