README.md

Hospital Standardised Mortality Ratios

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.

Resources

Folder Structure

All the publication files and folders are stored in the following directory:

/.../quality_indicators/hsmr/quarter_cycle

This directory should contain:

The "master" folder

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.

The individual analyst folders

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 Repository

Files and Folders

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.

Folders

Files

Functions

These can be located in the R/ folder.

Running the publication

Updating the code

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:

Running the code

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:

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.



Public-Health-Scotland/hsmr documentation built on June 24, 2024, 1:48 a.m.