check_ae_aedthdtc_ds_death {sdtmchecks}R Documentation

Check for missing AEDTHDTC where DS indicates death due to AE

Description

This check looks for missing AEDTHDTC values if a patient has a DS record where DSDECOD=DEATH and DSTERM contains ADVERSE EVENT

Usage

check_ae_aedthdtc_ds_death(AE, DS)

Arguments

AE

Adverse Events SDTM dataset with variables USUBJID, AEDTHDTC

DS

Disposition SDTM dataset with variables USUBJID, DSDECOD, DSTERM, DSSTDTC

Value

boolean value if check failed or passed with 'msg' attribute if the test failed

Author(s)

Aldrich Salva

Examples


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)



[Package sdtmchecks version 1.0.0 Index]