completeness: SMR01 completeness

View source: R/completeness.R

completenessR Documentation

SMR01 completeness

Description

completeness takes the first day of the latest quarter of data which are included in the current HSMR publication. It extracts completeness information for the SMR01 dataset from the SMR Completeness Estimates spreadsheet published on the ISD website. It extracts the completeness percentages for the two most recent quarters for all health boards and Scotland.

Usage

completeness(
  quarter = c("previous", "current"),
  level = c("board", "scotland"),
  first_day
)

Arguments

quarter

A character string specifying the quarter for which completeness data should be returned. Valid options are 'previous' and 'current'.

level

A character string specifying the geographic level for which completeness data should be returned. Valid options are 'board' and 'scotland'.

first_day

The first day of the latest quarter, supplied with Date class. Must be the first day of either January, April, July or October. Only one value of first_day is valid at any one time. When the spreadsheet is updated with a new quarter's data, the previously valid value of first_day will now return an error, and a new value (the previous value + 3 months) should be supplied instead.

Details

The completeness function assumes that the list of health board names (including Scotland) is contained in cells B31:B47 in the spreadsheet, where B29 is 'NHS Board' and B47 is 'All NHS Boards'. Should this change, completeness should be edited accordingly.

The URL of the spreadsheet is occasionally modified. Should this happen, completeness should again be edited accordingly.

If the ISD website is down, completeness will return an error saying it has timed out. The hsmr package will also fail to build when the website is down, and the unit tests relating to completeness will fail, as access to the spreadsheet is required. Nothing can be done in this instance other than waiting for the website to return to normal.

Value

When level is set equal to board, completeness returns a sentence listing the boards (if any) which had an SMR01 completeness level of less than 95 percent for the specified quarter. When level is set equal to scotland, completeness returns Scotland's SMR01 completeness level for the specified quarter as a percentage.


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