This check looks for missing TUDTC values and returns a data frame. Only applies to assessments by investigator.
check_tu_tudtc(TU, preproc = identity, ...)
boolean value if check failed or passed with 'msg' attribute if the test failed
TU <- data.frame(
USUBJID = "1001",
TUDTC = "2020-05-05",
VISIT = "C1D1",
TUORRES = 1:10,
TUSPID = "FORMNAME-R:19/L:19XXXX",
TUEVAL = "INVESTIGATOR",
TUTESTCD = "TUMIDENT",
stringsAsFactors = FALSE
)
TU$TUDTC[1]=""
TU$TUDTC[2]="NA"
TU$TUDTC[3]=NA
check_tu_tudtc(TU,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "TU has 1 patient(s) with 3 record(s) with missing TUDTC. "
#> attr(,"data")
#> USUBJID VISIT TUDTC TUORRES TUEVAL TUTESTCD RAVE
#> 1 1001 C1D1 1 INVESTIGATOR TUMIDENT FORMNAME-R:19
#> 2 1001 C1D1 NA 2 INVESTIGATOR TUMIDENT FORMNAME-R:19
#> 3 1001 C1D1 <NA> 3 INVESTIGATOR TUMIDENT FORMNAME-R:19
TU$TUEVAL[1]=""
TU$TUTESTCD=NULL
check_tu_tudtc(TU,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "TU has 1 patient(s) with 3 record(s) with missing TUDTC. "
#> attr(,"data")
#> USUBJID VISIT TUDTC TUORRES TUEVAL RAVE
#> 1 1001 C1D1 1 FORMNAME-R:19
#> 2 1001 C1D1 NA 2 INVESTIGATOR FORMNAME-R:19
#> 3 1001 C1D1 <NA> 3 INVESTIGATOR FORMNAME-R:19
TU$TUEVAL[2]="INDEPENDENT ASSESSOR"
TU$TUEVAL[3]="INDEPENDENT ASSESSOR"
TU$TUDTC[4]=""
check_tu_tudtc(TU)
#> [1] FALSE
#> attr(,"msg")
#> [1] "TU has 1 patient(s) with 2 record(s) with missing TUDTC. "
#> attr(,"data")
#> USUBJID VISIT TUDTC TUORRES TUEVAL
#> 1 1001 C1D1 1
#> 2 1001 C1D1 4 INVESTIGATOR
TU$TUSPID=NULL
check_tu_tudtc(TU)
#> [1] FALSE
#> attr(,"msg")
#> [1] "TU has 1 patient(s) with 2 record(s) with missing TUDTC. "
#> attr(,"data")
#> USUBJID VISIT TUDTC TUORRES TUEVAL
#> 1 1001 C1D1 1
#> 2 1001 C1D1 4 INVESTIGATOR
TU$VISIT=NULL
check_tu_tudtc(TU)
#> [1] FALSE
#> attr(,"msg")
#> [1] "TU is missing the variable: VISIT"