Attaches a cohort definition to the plan, restricting all downstream
outputs to the selected cohort episodes. A person may therefore contribute
multiple episodes under the same definition, including overlapping episodes.
Exactly one of
cohort_definition_id or spec must be provided. Use
cohort_definition_id to reference an existing cohort definition,
or spec to define a cohort inline using the DSL.
Examples
if (FALSE) { # \dontrun{
plan <- ds.omop.plan()
plan <- ds.omop.plan.cohort(plan, cohort_definition_id = 42)
# Or with an inline spec
plan <- ds.omop.plan.cohort(plan, spec = list(
sex = "Female", age_range = c(40, 65)
))
} # }