R/check_ae_aesdth_aedthdtc.R
check_ae_aesdth_aedthdtc.Rd
This check looks for AE entries with AESDTH of "Y" but no AEDTHDTC (death date) value
check_ae_aesdth_aedthdtc(AE, preproc = identity, ...)
Adverse Event SDTM dataset with variables USUBJID, AEDTHDTC, AESDTH, AEDECOD and AESTDTC
An optional company specific preprocessing script
Other arguments passed to methods
Boolean value for whether the check passed or failed, with 'msg' attribute if the check failed
AE <- data.frame(USUBJID = c(1:5), AEDTHDTC = c(1:2, NA, "NA", 3),
AESDTH = c("", rep("Y",2), rep("", 2)),
AEDECOD = letters[1:5], AESTDTC = c(1:5),
AESPID = "FORMNAME-R:5/L:5XXXX",
stringsAsFactors=FALSE)
check_ae_aesdth_aedthdtc(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE has AESDTH equal to 'Y' where AEDTHDTC does not have a value. "
#> attr(,"data")
#> USUBJID AEDECOD AESTDTC AESDTH AEDTHDTC
#> 1 3 c 3 Y <NA>
check_ae_aesdth_aedthdtc(AE,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE has AESDTH equal to 'Y' where AEDTHDTC does not have a value. "
#> attr(,"data")
#> USUBJID AEDECOD AESTDTC AESDTH AEDTHDTC RAVE
#> 1 3 c 3 Y <NA> FORMNAME-R:5