Description Usage Arguments Details Value
View source: R/create_cohort.R
This function is used to take a cohort definition and an audit output specification and build them together to produce results for a cohort.
1 2 3 4 5 6 7 | create_aggregated_cohort(ssnap_data, csv_columns = NULL,
from_cohort_definition, audit_outputs_table, period_type = c("months",
"periods", "financialyears"), aggregate_by = c("national", "team"),
filters = NULL)
create_filtered_cohort(ssnap_data, csv_columns = NULL,
from_cohort_definition, audit_outputs_table = NULL, filters = NULL)
|
ssnap_data |
Either a tibble containing raw SSNAP data, or a string containing the name of a CSV file. |
csv_columns |
Columns from the patient data table (processed CSV, referred to as ssnap_data here) needed by the provided audit_outputs_table. This will mostly need renaming to be clearer. |
from_cohort_definition |
A cohort definition object which describes how to select the patients and data from the cohort. |
audit_outputs_table |
A table providing column names, fields and labels for the audit outputs. |
period_type |
A string determining what the gap between time periods should be. The factor should either be 'months', 'periods' or financialyears'. Months and financialyears are self-explanatory. Periods represent reporting periods - these were initially quarterly, then were trimesterly, then quarterly again. Periods are referred to by their numeric number, rather than a defined time period to avoid confusion in the calcalations. |
aggregate_by |
Set whether we are looking to aggregate by 'team' (default) or 'national'. |
filters |
Filters to apply to ssnap_data before creating the cohort. Common examples would be to select only a subset of teams or a certain date range to reduce the need to summarise results which are not going to be used subsequently. |
create_aggregated data is used to produce aggregated summary statistics for a cohort; whilst create_filtered_cohort is used to create a cohort of patient-level data with filtering applied and/or new calculated fields added.
The cohort is returned in a tibble
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.