R/check_ss_ssdtc_dead_dthdtc.R
check_ss_ssdtc_dead_dthdtc.Rd
This check looks for non-missing SS.SSDTC when SS.SSSTRESC='DEAD' and Subject Status Date/Time of Assessments is less than Start Date/Time of Disposition Event(SS.SSDTC < DS.DSSTDTC)
check_ss_ssdtc_dead_dthdtc(SS, DM)
Subject Status SDTM dataset with variables USUBJID, SSDTC, SSSTRESC, VISIT
Demographics SDTM dataset with variables USUBJID, DTHDTC
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 = "DAY 10"
)
DM <- data.frame(
USUBJID = 1:5,
DTHDTC = "2020-01-02"
)
check_ss_ssdtc_dead_dthdtc(SS, DM)
#> [1] TRUE
SS <- data.frame(
USUBJID = 1:5,
SSDTC = "2020-01-02",
SSSTRESC = c("DEAD","DEAD","ALIVE","DEAD","ALIVE"),
VISIT = "FOLLOW-UP"
)
DM <- data.frame(
USUBJID = 1:5,
DTHDTC = c("2020-01-01","2020-01-02","2020-01-03","2020-01-04","2020-01-02")
)
check_ss_ssdtc_dead_dthdtc(SS, DM)
#> [1] FALSE
#> attr(,"msg")
#> [1] "1 patient(s) with DEAD status where in SS domain where SS date is less than death date in DM domain. "
#> attr(,"data")
#> USUBJID SSDTC SSSTRESC VISIT DTHDTC
#> 1 4 2020-01-02 DEAD FOLLOW-UP 2020-01-04