This check looks for both records where height is missing as well as patients with no height records at all

check_vs_height(VS, DM)

Arguments

VS

Vital Signs SDTM dataset with variables USUBJID,VSTEST,VSTESTCD,VSSTRESN,VISIT

DM

Demographics SDTM dataset with variable USUBJID

Value

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

Author

Sara Bodach

Examples


DM <- data.frame(
 STUDYID = 1,
 USUBJID = 1:11
)

VS <- data.frame(
 STUDYID = 1,
 USUBJID = 1:10,
 VSTEST = "HEIGHT",
 VSTESTCD = "HEIGHT",
 VSSTRESN = 1:10,
 VISIT = 1:10
)

VS$VSSTRESN[1] = NA
VS$VSSTRESN[2] = "NA"
VS$VSSTRESN[3] = ""
VS$VSSTRESN[4] = "."

check_vs_height(VS,DM)
#> [1] FALSE
#> attr(,"msg")
#> [1] "There are 5 patients with no recorded height at any visit. "
#> attr(,"data")
#>   USUBJID
#> 1       1
#> 2       2
#> 3       3
#> 4       4
#> 5      11