R/check_ss_ssdtc_dead_ds.R
check_ss_ssdtc_dead_ds.Rd
This check looks for missing death date in DS dataset if there is DEAD status date in SS dataset or if Subject Status Date/Time of Assessments is less than Start Date/Time of Disposition Event(SS.SSDTC < DS.DSSTDTC)
check_ss_ssdtc_dead_ds(SS, DS, preproc = identity, ...)
boolean value if check failed or passed with 'msg' attribute if the test failed
SS <- data.frame(
USUBJID = 1:5,
SSDTC = "2020-01-02",
SSSTRESC = c("DEAD","DEAD","ALIVE","DEAD","ALIVE"),
VISIT = "FOLLOW-UP",
SSSPID = "FORMNAME-R:13/L:13XXXX"
)
DS <- data.frame(
USUBJID = 1:5,
DSSTDTC = c("2020-01-02","2020-01-02", "2020-01-01", "2020-01-03", "2020-01-01"),
DSDECOD = c(rep('DEATH', 5)),
DSSPID = "FORMNAME-R:13/L:13XXXX",
DSCAT = c("OTHER EVENT", rep("DISPOSITION EVENT", 4))
)
check_ss_ssdtc_dead_ds(SS, DS)
#> [1] FALSE
#> attr(,"msg")
#> [1] "2 patient(s) with death information in SS domain but no death information in DS domain or date with DEAD status in SS dataset is less than death date in DS dataset. "
#> attr(,"data")
#> USUBJID SSDTC SSSTRESC VISIT DSSTDTC DSDECOD DSCAT
#> 1 1 2020-01-02 DEAD FOLLOW-UP <NA> <NA> <NA>
#> 2 4 2020-01-02 DEAD FOLLOW-UP 2020-01-03 DEATH DISPOSITION EVENT
check_ss_ssdtc_dead_ds(SS, DS, preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "2 patient(s) with death information in SS domain but no death information in DS domain or date with DEAD status in SS dataset is less than death date in DS dataset. "
#> attr(,"data")
#> USUBJID SSDTC SSSTRESC VISIT SS_RAVE DSSTDTC DSDECOD
#> 1 1 2020-01-02 DEAD FOLLOW-UP FORMNAME-R:13 <NA> <NA>
#> 2 4 2020-01-02 DEAD FOLLOW-UP FORMNAME-R:13 2020-01-03 DEATH
#> DSCAT DS_RAVE
#> 1 <NA> <NA>
#> 2 DISPOSITION EVENT FORMNAME-R:13
SS <- data.frame(
USUBJID = 1:5,
SSDTC = "2020-01-02",
SSSTRESC = c( rep("DEAD", 5)),
VISIT = "FOLLOW-UP",
SSSPID = "FORMNAME-R:13/L:13XXXX"
)
DS <- data.frame(
USUBJID = 1:5,
DSSTDTC = c("2020-01-02","2020-01-02", "2020-01-01", "2020-01-03", "2020-01-01"),
DSDECOD = c(rep('DEATH', 5)),
DSSPID = "FORMNAME-R:13/L:13XXXX",
DSCAT = c(rep("DISPOSITION EVENT", 5))
)
check_ss_ssdtc_dead_ds(SS, DS)
#> [1] FALSE
#> attr(,"msg")
#> [1] "1 patient(s) with death information in SS domain but no death information in DS domain or date with DEAD status in SS dataset is less than death date in DS dataset. "
#> attr(,"data")
#> USUBJID SSDTC SSSTRESC VISIT DSSTDTC DSDECOD DSCAT
#> 1 4 2020-01-02 DEAD FOLLOW-UP 2020-01-03 DEATH DISPOSITION EVENT
check_ss_ssdtc_dead_ds(SS, DS, preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "1 patient(s) with death information in SS domain but no death information in DS domain or date with DEAD status in SS dataset is less than death date in DS dataset. "
#> attr(,"data")
#> USUBJID SSDTC SSSTRESC VISIT SS_RAVE DSSTDTC DSDECOD
#> 1 4 2020-01-02 DEAD FOLLOW-UP FORMNAME-R:13 2020-01-03 DEATH
#> DSCAT DS_RAVE
#> 1 DISPOSITION EVENT FORMNAME-R:13
SS <- data.frame(
USUBJID = 1:5,
SSDTC = "2020-01-02",
SSSTRESC = c(rep("DEAD", 5)),
VISIT = "FOLLOW-UP",
SSSPID = "FORMNAME-R:13/L:13XXXX"
)
DS <- data.frame(
USUBJID = 1:5,
DSSTDTC = 2,
DSDECOD = c(rep('DEATH', 5)),
DSSPID = "FORMNAME-R:13/L:13XXXX",
DSCAT = c(rep("DISPOSITION EVENT", 5))
)
check_ss_ssdtc_dead_ds(SS, DS)
#> [1] TRUE