Used to insert the inclusion rule names from a cohort definition set when generating cohorts that include cohort statistics
Source:R/CohortStats.R
insertInclusionRuleNames.RdThis function will take a cohortDefinitionSet that inclusions the Circe JSON representation of each cohort, parse the InclusionRule property to obtain the inclusion rule name and sequence number and insert the values into the cohortInclusionTable. This function is only required when generating cohorts that include cohort statistics.
Usage
insertInclusionRuleNames(
connectionDetails = NULL,
connection = NULL,
cohortDefinitionSet,
cohortDatabaseSchema,
cohortInclusionTable = getCohortTableNames()$cohortInclusionTable
)Arguments
- connectionDetails
An object of type
connectionDetailsas created using thecreateConnectionDetailsfunction in the DatabaseConnector package. Can be left NULL ifconnectionis provided.- connection
An object of type
connectionas created using theconnectfunction in the DatabaseConnector package. Can be left NULL ifconnectionDetailsis provided, in which case a new connection will be opened at the start of the function, and closed when the function finishes.- cohortDefinitionSet
The
cohortDefinitionSetargument must be a data frame with the following columns:- cohortId
The unique integer identifier of the cohort
- cohortName
The cohort's name
- sql
The OHDSI-SQL used to generate the cohort
Optionally, this data frame may contain:
- json
The Circe JSON representation of the cohort
- cohortDatabaseSchema
Schema name where your cohort tables reside. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
- cohortInclusionTable
Name of the inclusion table, one of the tables for storing inclusion rule statistics.