AE <- data.frame(
USUBJID = 1:3,
AEDTHDTC = c(NA,NA,1)
)
# older mapping
DS <- data.frame(
USUBJID = 1:4,
DSTERM = c("DEATH DUE TO ADVERSE EVENT","DEATH DUE TO PROGRESSIVE DISEASE",
"DEATH DUE TO ADVERSE EVENT","DEATH DUE TO ADVERSE EVENT")
,
DSDECOD = rep("DEATH",4),
DSSTDTC = "2020-01-01"
)
check_ae_aedthdtc_ds_death(AE,DS)
DS$DSSTDTC = NULL
check_ae_aedthdtc_ds_death(AE,DS)
# newer mapping that
DS <- data.frame(
USUBJID = 1:4,
DSTERM = c("DEATH DUE TO MYOCARDIAL INFARCTION","DEATH DUE TO PROGRESSIVE DISEASE",
"DEATH DUE TO COVID-19","DEATH")
,
DSDECOD = rep("DEATH",4),
DSSTDTC = "2020-01-01"
)
# pass for study with newer mapping, as another function (check_dd_death_date.R) covers this
check_ae_aedthdtc_ds_death(AE,DS)
Run the code above in your browser using DataLab