R/check_mh_missing_month.R
check_mh_missing_month.Rd
This check looks for partial missing dates in medical history start and end dates. That is, with only the month missing while the year and day are known
check_mh_missing_month(MH, preproc = identity, ...)
Boolean value for whether the check passed or failed, with 'msg' attribute if the check failed
MH <- data.frame(USUBJID = LETTERS[1:5],
MHTERM = LETTERS[5:1],
MHSTDTC = c("2014", NA, "2014-01", "", "2014---02"),
stringsAsFactors = FALSE)
check_mh_missing_month(MH)
#> [1] FALSE
#> attr(,"msg")
#> [1] "MH has date(s) with known year and day but missing month. "
#> attr(,"data")
#> USUBJID MHTERM MHSTDTC
#> 1 E A 2014---02
MH$MHSPID= "FORMNAME-R:2/L:2XXXX"
check_mh_missing_month(MH,preproc=roche_derive_rave_row)
#> [1] FALSE
#> attr(,"msg")
#> [1] "MH has date(s) with known year and day but missing month. "
#> attr(,"data")
#> USUBJID MHTERM MHSTDTC RAVE
#> 1 E A 2014---02 FORMNAME-R:2