sql_smr: Extract Scottish Morbidity Record (SMR) data using SQL

query_smr01R Documentation

Extract Scottish Morbidity Record (SMR) data using SQL

Description

The SMR query functions take an extract start date and, with the exception of query_gro_smr, an extract end date. They define the SQL queries used to extract data for the HSMR publication.

  • query_smr01 extracts the relevant data from the SMR01 database from the beginning of the baseline period until the end date cut off for the current publication.

  • query_smr01_minus5 extracts data from the SMR01 database from five years prior to the beginning of the baseline period until the end date cut off for the current publication.

  • query_gro_smr extracts data from the SMR Deaths database from the beginning of the baseline period.

Usage

query_smr01(extract_start, extract_end)

query_smr01_minus5(extract_start, extract_end)

query_gro_smr(extract_start)

Arguments

extract_start

The extract start date, supplied with Date class. Must be the first day of either January, April, July or October.

extract_end

The extract end date, supplied with Date class. Must be the final day of either March, June, September or December.


NHS-NSS-transforming-publications/hsmr documentation built on June 30, 2024, 11:48 a.m.