ssnap_field: Record-level data fields built from other data fields

Description Usage Format Details

Description

ssnap_field is a set of named expressions (code snippets) used to describe calculations to perform on individual rows to produce new patient-level information.

Usage

1

Format

An object of class list of length 52.

Details

Example uses of these fields are to calculate time differences, or to perform complex row calculations such as eligibility for thrombolysis.

We aren't actually creating these extra data rows - instead we insert the code inline into the formulae for performing the summarising: the expressions in the ssnap_measures lists insert these snippets to perform the calculation.

Writing the code in this way allows us to test these code segments individually in the unit tests, and execute them in the same pass as aggregation. If the goal is for us to send a query to the SSNAP database, we don't want to need to receive patient-level detail.

Although the primary intended user is SSNAPStats, they are exported because we may want to apply these in custom calculations outside of SSNAPStats.

When examining the internals of this function, we can't reference another ssnap_field from within the same list as they are all created in parallel, so if you want to use a ssnap_field from within ssnap_field, you must put the first one outside it and then splice it in - see inset_to_clock_start as an example of that.


md0u80c9/SSNAPStats documentation built on Feb. 11, 2020, 11:43 a.m.