Learn R Programming

sdtmchecks (version 1.0.0)

check_tr_trstresn_ldiam: Check for TR records with missing TRSTRESN for Longest Diameter (LDIAM)

Description

This checks looks for TR records with missing values in numeric result/finding for the Longest Diameter (TRTESTCD is LDIAM) tumor measurement. Only applies to assessments by investigator, selected based on uppercased TREVAL = "INVESTIGATOR" or missing or TREVAL variable does not exist.

Usage

check_tr_trstresn_ldiam(TR, preproc = identity, ...)

Value

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

Arguments

TR

Tumor Results SDTM dataset with variables USUBJID, TRTESTCD, TRLINKID/TRLNKID, TRDTC, VISIT, TRORRES, TRSTRESN, TREVAL (optional), TRSTAT (optional), TRSPID (optional)

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Will Harris

Examples

Run this code

TR <- data.frame(USUBJID = 1:5,
                 TRTESTCD = c("OTHER", rep("LDIAM", 4)),
                 TRLINKID = 1:5,
                 TRDTC = 1:5,
                 VISIT = LETTERS[1:5],
                 TRORRES = LETTERS[1:5],
                 TRSTRESN = 1:5,
                 TRSTAT = "",
                 TREVAL = "INVESTIGATOR",
                 TRSPID = "FORMNAME-R:19/L:19XXXX",
                 stringsAsFactors = FALSE)

check_tr_trstresn_ldiam(TR)

TR1 <- TR
TR1$TRSTAT <- NULL
TR1$TREVAL <- NULL
TR1$TRSPID <- NULL

check_tr_trstresn_ldiam(TR1)

TR2 <- TR
TR2$TRSTRESN <- c("", "NA", NA, 1, 1)

check_tr_trstresn_ldiam(TR2)
check_tr_trstresn_ldiam(TR2,preproc=roche_derive_rave_row)


Run the code above in your browser using DataLab