Learn R Programming

sdtmchecks (version 1.0.0)

check_lb_lbstresu: Check for missing lab units (LBSTRESU)

Description

This check identifies records where original lab values (LBORRES) exist but standard lab units (LBSTRESU) are not populated, excluding qualitative results (LBMETHOD) and excluding records when LBTESTCD in ("PH" "SPGRAV")

Usage

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

Value

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

Arguments

LB

Lab SDTM dataset with variables USUBJID, LBSTRESC, LBSTRESN, LBORRES, LBSTRESU, LBTESTCD, LBDTC, LBMETHOD (optional), LBSPID (optional), and VISIT (optional)

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Iris Zhao

Examples

Run this code

LB <- data.frame(
USUBJID = 1:10,
LBSTRESC = "5",
LBSTRESN = 1:10,
LBORRES = "5",
LBSTRESU = "g/L",
LBTESTCD = "ALB",
LBDTC = 1:10,
stringsAsFactors=FALSE
)

check_lb_lbstresu(LB)

LB$LBSTRESU[1]=""
check_lb_lbstresu(LB)

LB$LBSTRESU[2]="NA"
check_lb_lbstresu(LB)

LB$LBSTRESU[3]=NA
check_lb_lbstresu(LB)

LB$LBSPID= "FORMNAME-R:2/L:2XXXX"
check_lb_lbstresu(LB,preproc=roche_derive_rave_row)

LB$VISIT= "SCREENING"
check_lb_lbstresu(LB)

LB$LBSTRESU=NULL
check_lb_lbstresu(LB)

Run the code above in your browser using DataLab