Learn R Programming

sdtmchecks (version 1.0.0)

check_dm_ae_ds_death: Check if death reported in DM then death indicator also present in DS or AE

Description

This checks that when death is indicated in DM with either of DTHFL or DTHDTC then there should be death indicated in either AE or DS.

Usage

check_dm_ae_ds_death(DM, DS, AE)

Value

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

Arguments

DM

Demographics SDTM dataset with variables USUBJID, DTHFL, DTHDTC

DS

Disposition SDTM dataset with variables USUBJID, DSDECOD, DSSTDTC

AE

Adverse Events SDTM dataset with variables USUBJID, AEDTHDTC, AESDTH, AEOUT

Author

Sara Bodach

Examples

Run this code

AE <- data.frame(
 STUDYID = 1,
 USUBJID = 1:3,
 AEDTHDTC = c(NA,1,NA),
 AESDTH = c(NA,"Y",NA),
 AEOUT = c(NA,"FATAL",NA),
 AETOXGR = c(NA,"5",NA)
)

DS <- data.frame(
 STUDYID = 1,
 USUBJID = 1:3,
 DSDECOD = c(NA,"DEATH",NA),
 DSSTDTC = c(NA,"DSDATE",NA)
)

DM <- data.frame(
 STUDYID = 1,
 USUBJID = 1:3,
 DTHFL=c(NA,"Y","Y"),
 DTHDTC = c(NA,"DMDATE","DMDATE")
 )

check_dm_ae_ds_death(DM,DS,AE)

DS$DSDECOD = NULL

check_dm_ae_ds_death(DM,DS,AE)

Run the code above in your browser using DataLab