Run a cohort generation and export results
runCohortGeneration(
connectionDetails,
cdmDatabaseSchema,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
cohortDatabaseSchema = cdmDatabaseSchema,
cohortTableNames = getCohortTableNames(),
cohortDefinitionSet = NULL,
negativeControlOutcomeCohortSet = NULL,
occurrenceType = "all",
detectOnDescendants = FALSE,
stopOnError = TRUE,
outputFolder,
databaseId = 1,
minCellCount = 5,
incremental = FALSE,
incrementalFolder = NULL
)An object of type connectionDetails as created using the
createConnectionDetails function in the
DatabaseConnector package.
Schema name where your patient-level data in OMOP CDM format resides. Note that for SQL Server, this should include both the database and schema name, for example 'cdm_data.dbo'.
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.
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'.
The names of the cohort tables. See getCohortTableNames
for more details.
The cohortDefinitionSet argument must be a data frame with
the following columns:
The unique integer identifier of the cohort
The cohort's name
The OHDSI-SQL used to generate the cohort
Optionally, this data frame may contain:
The Circe JSON representation of the cohort
The negativeControlOutcomeCohortSet argument must be a data frame with
the following columns:
The unique integer identifier of the cohort
The cohort's name
The concept_id in the condition domain to use for the negative control outcome.
For negative controls outcomes, the occurrenceType will detect either: the first time an outcomeConceptId occurs or all times the outcomeConceptId occurs for a person. Values accepted: 'all' or 'first'.
For negative controls outcomes, when set to TRUE, detectOnDescendants will use the vocabulary to find negative control outcomes using the outcomeConceptId and all descendants via the concept_ancestor table. When FALSE, only the exact outcomeConceptId will be used to detect the outcome.
If an error happens while generating one of the cohorts in the cohortDefinitionSet, should we stop processing the other cohorts? The default is TRUE; when set to FALSE, failures will be identified in the return value from this function.
Name of the folder where all the outputs will written to.
A unique ID for the database. This will be appended to most tables.
To preserve privacy: the minimum number of subjects contributing to a count before it can be included in the results. If the count is below this threshold, it will be set to `-minCellCount`.
Create only cohorts that haven't been created before?
If incremental = TRUE, specify a folder where
records are kept of which definition has been
executed. (deprecated)
Run a cohort generation for a set of cohorts and negative control outcomes. This function will also export the results of the run to the `outputFolder`.