cohort_definition: Creates a new cohort_definition object

Description Usage Arguments Details Value

View source: R/cohort_definition.R

Description

This function is used to create a new cohort_definition.

Usage

1
2
3
4
cohort_definition(cohort_name, row_selection_criteria,
  reporting_period_index_name, choose_patients_from = NULL,
  attribute_to_team = NULL, attribute_to_team_columns = NULL,
  apply_data_from = NULL, csv_columns = NULL, description = NULL)

Arguments

row_selection_criteria

A list of expressions which describe the filters to be applied to the raw data.

reporting_period_index_name

The name of a date/time field which will be used as the temporal index for results.

attribute_to_team

A function which describes how to find the records we want in our population. The function should accept a single parameter, source_data. Typical uses of this parameter are to apply slice operations for example, or complex filter operations in combination with other actions. If not required, this parameter should be set as NULL or omitted.

attribute_to_team_columns

This is a list of the column names we want to keep from the population we have selected the records from. Columns not stated within this list will be overwritten with the data in the apply_data_from column below. The two columns which do not need specifying in this are the unique patient identifier (PatientId) and the unique record identifier (ProClinV1Id).

apply_data_from

A function which describes how to query for the data we want to apply to our final cohort. This is used where we might want to apply data from records different to the ones we have selected (such as in SSNAP's Team72hr cohort where we choose records from the admitting team, but we apply the results from the team who locked the record at 72hrs).

csv_columns

a character vector of all the columns from the raw CSV file needed to make this audit measure.

description

A textural description of what the cohort is intended to represent. This will be passed to the metadata of outputs.

Details

Cohort definitions are used to describe how to take raw audit data and select the data to represent a particular cohort.

Most cohorts involve selecting, and/or filtering data to get the required cohort. row_selection_criteria is used to pass a list of filters which should be applied. The filters are passed as a list of expressions: where multiple filters are present they are ANDed together (the equivalent to each individual filter being applied in sequence).

All cohorts are time series objects: it is therefore important to state which time series will form the index. The tsibble package is used to support temporal-context outputs. This allows the final results to be broken down and displayed by date range. Sometimes rather than just selection we need to do more complex operations to select our cohort - such as slicing the data to find the first record meeting criteria. In these circumstances we provide a function in attribute_to_team, which must take in a single parameter (source_data).

Where we have multiple records pertaining to a patient (for example where the patient has multiple admissions, or passes between different teams), we may want to apply the results from other records to our selected cohort. To do this we can use the apply_data_from parameter. The cohort selection is then right joined by dplyr to the apply_data_from results. Like attribute_to_team this is a function with a single parameter source_data.

Value

The created cohort_definition object.


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