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, ...)

Arguments

MH

Medical History SDTM dataset with variables USUBJID, MHTERM and MHSTDTC

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Value

Boolean value for whether the check passed or failed, with 'msg' attribute if the check failed

Author

Chandra Mannem

Examples


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