conceptCohort {CohortConstructor} | R Documentation |
Create cohorts based on a concept set
Description
conceptCohort()
creates a cohort table from patient records
from the clinical tables in the OMOP CDM.
The following tables are currently supported for creating concept cohorts:
condition_occurrence
device_exposure
drug_exposure
measurement
observation
procedure_occurrence
visit_occurrence
Cohort duration is based on record start and end (e.g. condition_start_date and condition_end_date for records coming from the condition_occurrence tables). So that the resulting table satisfies the requirements of an OMOP CDM cohort table:
Overlapping records are collapsed into a single cohort entry.
If a record starts outside of an observation period it will be silently ignored.
If a record ends outside of an observation period it will be trimmed so as to end at the preceding observation period end date.
Usage
conceptCohort(cdm, conceptSet, name)
Arguments
cdm |
A cdm reference. |
conceptSet |
A conceptSet, which can either be a codelist or a conceptSetExpression. |
name |
Name of the cohort in the cdm object. |
Value
A cohort table
Examples
library(CohortConstructor)
cdm <- mockCohortConstructor(conditionOccurrence = TRUE)
cohort <- conceptCohort(cdm = cdm, conceptSet = list(a = 1), name = "cohort")
cohort |> attrition()