R/check_ae_aeout.R
check_ae_aeout.Rd
This check looks for AEs with Death date(AEDTHDTC) but outcome (AEOUT) is not FATAL and conversely AEs with no death date (AEDTHDTC) but outcome (AEOUT) is fatal
check_ae_aeout(AE, preproc = identity, ...)
Adverse Events SDTM dataset with variables USUBJID, AEDTHDTC, AEOUT
An optional company specific preprocessing script
Other arguments passed to methods
boolean value if check failed or passed with 'msg' attribute if the test failed
AE <- data.frame(
USUBJID = 1:7,
AEDTHDTC = c(NA, "NA", "2015-03-12", "2017-01-22", "1999-11-07","",NA),
AEOUT = c("", "", "","FATAL","RECOVERED/RESOLVED","FATAL","FATAL"),
AESPID = "FORMNAME-R:13/L:13XXXX",
stringsAsFactors = FALSE
)
check_ae_aeout(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AEs with inconsistent AEDTHDTC and AEOUT found."
#> attr(,"data")
#> USUBJID AEDTHDTC AEOUT
#> 1 3 2015-03-12
#> 2 5 1999-11-07 RECOVERED/RESOLVED
#> 3 6 FATAL
#> 4 7 <NA> FATAL
check_ae_aeout(AE,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AEs with inconsistent AEDTHDTC and AEOUT found."
#> attr(,"data")
#> USUBJID AEDTHDTC AEOUT RAVE
#> 1 3 2015-03-12 FORMNAME-R:13
#> 2 5 1999-11-07 RECOVERED/RESOLVED FORMNAME-R:13
#> 3 6 FATAL FORMNAME-R:13
#> 4 7 <NA> FATAL FORMNAME-R:13
AE$AEDTHDTC <- NULL
check_ae_aeout(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE is missing the variable: AEDTHDTC"
AE$AEOUT <- NULL
check_ae_aeout(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE is missing the variables: AEDTHDTC, AEOUT"