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)

Arguments

SS

Subject Status SDTM dataset with variables USUBJID, SSDTC, SSSTRESC, VISIT

DM

Demographics SDTM dataset with variables USUBJID, DTHDTC

Value

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

Author

Vira Vrakina

Examples


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