add_death_flag
add_death_flag(
table,
cdm,
*,
index_date='cohort_start_date',
censor_date=None,
window=(0, float('inf')),
death_flag_name='death',
)
Add flag for death within window (1/0).
Parameters
| table |
Any |
Ibis table with person_id or subject_id and index_date. |
required |
| cdm |
Cdm |
CDM reference (death, observation_period). |
required |
| index_date |
str |
Column name for index date (default “cohort_start_date”). |
'cohort_start_date' |
| censor_date |
str or None |
Optional censor date column name. |
None |
| window |
tuple |
(low, high) days from index_date (default (0, inf)). |
(0, float('inf')) |
| death_flag_name |
str |
Output column name (default “death”). |
'death' |
Returns
|
ibis.expr.types.Table |
Table with death column (1 if death in window, 0 otherwise). |