This checks that if there is an AE with AEACN="DRUG WITHDRAWN" then there should be a treatment discontinuation record indicated by DS.DSSCAT

check_ae_withdr_ds_discon(AE, DS, TS, preproc = identity, ...)

Arguments

AE

Adverse Events SDTM dataset with variables USUBJID, AEACN

DS

Disposition SDTM dataset with variables USUBJID, DSCAT, DSSCAT

TS

Trial Summary SDTM dataset with variables TSPARMCD, TSVAL

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

Yuliia Bahatska

Examples


AE <- data.frame(
 USUBJID = 1:6,
 AEACN = c("DRUG WITHDRAWN",NA,NA,NA,NA,NA),
 AETOXGR = c(NA,NA,NA,NA,"5",NA),
 AEDECOD=c("NAUSEA","HEADACHE"),
 AESPID = "FORMNAME-R:5/L:5XXXX"
)
DS <- data.frame(
 USUBJID = 1:3,
 DSCAT="DISPOSITION EVENT",
 DSSCAT="STUDY TREATMENT",
 DSDECOD=c("COMPLETED","ADVERSE EVENT","DEATH")
)

 TS <- data.frame(
 TSPARMCD="TRT",
 TSVAL="CHECK"
)

check_ae_withdr_ds_discon(AE,DS,TS)
#> [1] FALSE
#> attr(,"msg")
#> [1] "There are 1 patient(s) where AE data treatment discontinuation but no treatment discontinuation record in DS. "
#> attr(,"data")
#>   USUBJID DSSCAT DSCAT          AEACN AEDECOD
#> 1       1   <NA>  <NA> DRUG WITHDRAWN  NAUSEA
check_ae_withdr_ds_discon(AE,DS,TS,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "There are 1 patient(s) where AE data treatment discontinuation but no treatment discontinuation record in DS. "
#> attr(,"data")
#>   USUBJID DSSCAT DSCAT          AEACN AEDECOD         RAVE
#> 1       1   <NA>  <NA> DRUG WITHDRAWN  NAUSEA FORMNAME-R:5

DS$DSSCAT = NULL

check_ae_withdr_ds_discon(AE,DS,TS)
#> [1] FALSE
#> attr(,"msg")
#> [1] "DS is missing the variable: DSSCAT"