This check looks for AE entries with an AEDTHDTC (death date) value and AESDTH not equal to "Y"

check_ae_aedthdtc_aesdth(AE, preproc = identity, ...)

Arguments

AE

Adverse Event SDTM dataset with variables USUBJID, AEDTHDTC, AESDTH, AEDECOD, and AESTDTC

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Value

Boolean value for whether the check passed or failed, with 'msg' attribute if the check failed

Author

Shumei Chi

Examples



AE <- data.frame(USUBJID = c(1:5),
                 AEDTHDTC = c(rep("2020-01-01",3), "NA", NA),
                 AESDTH = c(rep("", 2), "Y", rep("", 2)),
                 AEDECOD = letters[1:5],
                 AESTDTC = "2020-01-01",
                 AESPID = "FORMNAME-R:13/L:13XXXX",
                 stringsAsFactors=FALSE)

check_ae_aedthdtc_aesdth(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE has AESDTH not equal to 'Y' where AEDTHDTC has a value. "
#> attr(,"data")
#>   USUBJID AEDECOD    AESTDTC   AEDTHDTC AESDTH
#> 1       1       a 2020-01-01 2020-01-01       
#> 2       2       b 2020-01-01 2020-01-01       
check_ae_aedthdtc_aesdth(AE,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "AE has AESDTH not equal to 'Y' where AEDTHDTC has a value. "
#> attr(,"data")
#>   USUBJID AEDECOD    AESTDTC   AEDTHDTC AESDTH          RAVE
#> 1       1       a 2020-01-01 2020-01-01        FORMNAME-R:13
#> 2       2       b 2020-01-01 2020-01-01        FORMNAME-R:13