The Hospital Standardised Mortality Ratios publication is a quarterly publication that has been fully RAP'd. The entire process is contained within this R package and git repository.
All the publication files and folders are stored in the following directory:
/.../quality_indicators/hsmr/quarter_cycle
This directory should contain:
The master folder is the master copy of the publication repository. This is the "production-ready" version that is used for the publication process each quarter. Within it there will be a folder called "data" which contains the output files/basefiles for all previous publications. The master copy should never be edited and should only be updated from approved changes pulled from GitHub.
These folders also contain up-to-date copies of the repository and these are the versions which are edited each time the publication is updated or each time a change to the process has to be made. Analysts should only work in their own folders on their own development branches. Once they are content that their changes are ready for the master branch, they must create a pull request on GitHub and have other analysts from the team review their changes and, if satisfied, merge them back into the master branch. It is then that the master folder is updated.
The HSMR publication process has been wrapped up inside an R package and so a number of files/folders within the repository are there to facilitate this.
completeness
function.These can be located in the R/ folder.
The package is designed to require as little human intervention as possible. To update the publication each quarter, the analyst responsible for updating the scripts/running the publication should complete the following steps:
setup_environment.R
filecreate_smr_data.R
and create_trends_data.R
are still correct create_smr_data.R
, highlight the entire script and runcreate_trends_data.R
, highlight the entire script and runcreate_excel_tables.R
, highlight the entire script and run. This script pulls in Excel templates which can be found in the reference_files folder (without data). The output files are saved in the data/output folder. Once this step is done, the raw data files and Excel tables for the publication have been produced. The final step is knitting the markdown documents, but that can't be done until the completeness figures are available. Once that is done:
.Rmd
scripts and click "knit"The raw output files (.csv
files with the numbers) from this process also feed into the Tableau dashboard, so once they are ready, they should be moved to the appropriate folder.
The raw output files (csv datafiles, basefiles) all have the publication date in the name, so there is no need to archive as each time the process is re-run, new files will be created. The only files which do get overwritten are the publication document files, but these are copied over to the publication folder as part of the normal publication process so are already archived.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.