
Track Patient Attrition Across Phenotyping Rules (CONSORT Flowchart)
Source:R/cohort.R
compute_attrition.RdApplies sequential filtering criteria step-by-step and computes patient retention metrics.
Arguments
- con
Active DuckDB DBI connection.
- cohort_id
Integer cohort ID being evaluated.
- steps
A list of named steps, each containing
step_name(character) andstep_query(character SQL). Each query after step 1 can query_step_currentto filter down from the previous step.- count_stays
If
TRUEand the steps returnvisit_occurrence_id, addsstays_retainedandstays_dropped(used bydefine_study_cohort(one_per_patient = FALSE)).