Checks for grade 5 AEs not marked fatal (AEOUT), death not indicated (AESDTH), or no death date (AESDTHDTC)

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

Arguments

AE

Adverse Event dataframe with variables USUBJID,AETOXGR,AEOUT,AEDTHDTC,AESDTH

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Value

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

Author

Iris Zhao

Examples


 AE <- data.frame(
 USUBJID = 1:10,
 AETOXGR = c(1:5,5,5,5,5,5),
 AEDTHDTC = c(rep(NA,4),rep("2020-01-01",6)),
 AESDTH = c(rep(NA,4),rep("Y",6)),
 AEOUT = c(rep(NA,4),rep("FATAL",6)),
  AESPID = "FORMNAME-R:13/L:13XXXX"
)

check_ae_death(AE)
#> [1] TRUE
check_ae_death(AE,preproc=roche_derive_rave_row)
#> [1] TRUE

AE$AEDTHDTC[5]="NA"
AE$AEDTHDTC[6]=NA
AE$AEDTHDTC[7]=""
AE$AESDTH[8]=NA
AE$AEOUT[9]=NA

check_ae_death(AE)
#> [1] FALSE
#> attr(,"msg")
#> [1] "Total number of records with grade 5 AEs and inconsistencies among AE death variables is 5. "
#> attr(,"data")
#>   USUBJID AETOXGR AEOUT   AEDTHDTC AESDTH
#> 1       5       5 FATAL         NA      Y
#> 2       6       5 FATAL       <NA>      Y
#> 3       7       5 FATAL                 Y
#> 4       8       5 FATAL 2020-01-01   <NA>
#> 5       9       5  <NA> 2020-01-01      Y
check_ae_death(AE,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "Total number of records with grade 5 AEs and inconsistencies among AE death variables is 5. "
#> attr(,"data")
#>   USUBJID AETOXGR AEOUT   AEDTHDTC AESDTH          RAVE
#> 1       5       5 FATAL         NA      Y FORMNAME-R:13
#> 2       6       5 FATAL       <NA>      Y FORMNAME-R:13
#> 3       7       5 FATAL                 Y FORMNAME-R:13
#> 4       8       5 FATAL 2020-01-01   <NA> FORMNAME-R:13
#> 5       9       5  <NA> 2020-01-01      Y FORMNAME-R:13