Produces one row per cohort episode, preserving cohort_row_id when a
person has recurrent membership, with demographics from the person table and
optional derived fields. Requires a cohort to be set. This is the recommended
way to retrieve cohort-indexed demographic variables because it can compute
episode-relative fields such as age at index.
Arguments
- plan
An
omop_planobject.- columns
Character vector; person-table columns to include (e.g.
"gender_concept_id","race_concept_id"). Exact birth components are not releasable; request"age_at_index"throughderivedinstead. Pass a named vector to rename columns. Unnamed entries keep their source name. Identifier columns cannot be renamed (they are stripped server-side regardless).- derived
Character vector; derived fields to compute. Supported values include
"age_at_index","prior_observation", and"future_observation".- name
Character; output name used as a key in the plan's outputs list and as the default symbol name on the server.
Examples
if (FALSE) { # \dontrun{
plan <- ds.omop.plan()
plan <- ds.omop.plan.cohort(plan, cohort_definition_id = 1)
plan <- ds.omop.plan.baseline(plan,
columns = c("gender_concept_id", "race_concept_id"),
derived = c("age_at_index", "prior_observation")
)
} # }