cohort_collapse
cohort_collapse(x)Collapse overlapping cohort periods per (cohort_definition_id, subject_id) into contiguous intervals.
Expects columns cohort_definition_id, subject_id, cohort_start_date, cohort_end_date. Orders by cohort_start_date and duration, then merges overlapping/adjacent periods.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | Ibis table or pandas DataFrame | Cohort-like table with required columns. | required |
Returns
| Name | Type | Description |
|---|---|---|
| pandas.DataFrame | Collapsed cohort with columns cohort_definition_id, subject_id, cohort_start_date, cohort_end_date. |