Learn R Programming

sdtmchecks (version 1.0.0)

check_lb_missing_month: Check for lab dates with year and day known but month unknown

Description

Check for missing month when lab specimen collection date (LBDTC) has known year and day

Usage

check_lb_missing_month(LB, preproc = identity, ...)

Value

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

Arguments

LB

Laboratory data SDTM dataset with variables USUBJID,LBTEST,LBDTC,VISIT

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Sara Bodach

Examples

Run this code

LB <- data.frame(
 USUBJID = 1:4,
 LBTEST = c("TEST1","TEST2","TEST3","TEST3"),
 LBDTC = c("2017-01-01","2017-02-01","2017---01", "2017----01"),
 VISIT = c("VISIT1","VISIT2","VISIT3","VISIT3"),
 stringsAsFactors=FALSE
)

check_lb_missing_month(LB)

LB$LBSPID= "FORMNAME-R:2/L:2XXXX"

check_lb_missing_month(LB,preproc=roche_derive_rave_row)

LB$LBDTC = NULL

check_lb_missing_month(LB)

Run the code above in your browser using DataLab