
Sequential cohort filters, one set of counts, CONSORT outputs and pre-flight checks
Source:R/cohort_flow.R
cohort_flow.RdThe base population is visit_occurrence restricted to visit_concept_ids (default inpatient 9201 and
emergency-to-inpatient 262). Each step is a SQL predicate over alias v (a visit_occurrence row) and p
(person); steps apply cumulatively, so the attrition table, the final cohort and the diagram can never
disagree. The unit of analysis is the index visit (persons counts distinct people).
Arguments
- con
DuckDB DBI connection with an OMOP CDM.
- visit_concept_ids
Index visit concept ids.
- anchor
"admission"(visit_start_date) or"discharge"(visit_end_date).- follow_up_days
If set, the pre-flight verifies every row can be followed that long (or died first).
- one_visit_per_person
Keep only each person's first index visit.