Learn R Programming

sdtmchecks (version 1.0.0)

check_lb_lbstresn_missing: Check missing standard lab values (LBSTRESN/LBSTRESC)

Description

This check looks for missing standardized finding (LBSTRESN/LBSTRESC) when original finding (LBORRES) is not missing

Usage

check_lb_lbstresn_missing(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, LBTESTCD, LBDTC, LBORRES, LBORRESU, LBSTRESN, LBSTRESC, VISIT (optional), LBSPID (optional)

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Madeleine Ma

Examples

Run this code

LB <- data.frame(
 USUBJID = c("Patient 1","Patient 2","Patient 3"),
 LBTEST   = "Test A",
 LBTESTCD   = "TA",
 LBDTC   = "2017-01-01",
 LBORRES = c("5","6","7"),
 LBSTRESC = c("5","6","7"),
 LBORRESU = rep("mg",3),
 LBSTRESN  = c(5,6,NA),
 stringsAsFactors=FALSE
 )

check_lb_lbstresn_missing(LB)

LB$LBSTRESC[3] = ""
check_lb_lbstresn_missing(LB)

LB$LBSTRESC[1] = ""
check_lb_lbstresn_missing(LB)

LB$VISIT = "SCREENING"
check_lb_lbstresn_missing(LB)

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

LB$LBSTRESN = NULL
check_lb_lbstresn_missing(LB)

LB$LBSTRESC = NULL
check_lb_lbstresn_missing(LB)

Run the code above in your browser using DataLab