Learn R Programming

sdtmchecks (version 1.0.0)

check_cm_cmdecod: Check for missing CMDECOD values

Description

This check looks for missing CMDECOD values

Usage

check_cm_cmdecod(CM, preproc = identity, ...)

Value

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

Arguments

CM

Concomitant Medications SDTM dataset with variables USUBJID, CMTRT, CMDECOD

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Lei Zhao, Stella Banjo (HackR 2021)

Examples

Run this code

CM <- data.frame(
 USUBJID = 1:5,
 DOMAIN = rep("CM", 5),
 CMTRT = rep("DRUG TERM", 5),
 CMDECOD = rep("CODED DRUG TERM", 5),
 CMSTDTC = 1:5,
 CMENDTC = 1:5,
 CMCAT = "CONCOMITANT MEDICATIONS",
 CMSPID = c("FORMNAME-R:13/L:13XXXX",
             "FORMNAME-R:16/L:16XXXX",
             "FORMNAME-R:2/L:2XXXX",
             "FORMNAME-R:19/L:19XXXX",
             "FORMNAME-R:5/L:5XXXX"),
 stringsAsFactors=FALSE
)

check_cm_cmdecod(CM)

CM$CMDECOD[1] = NA
CM$CMDECOD[2] = "NA"
CM$CMDECOD[3:5] = ""
check_cm_cmdecod(CM)
check_cm_cmdecod(CM,preproc=roche_derive_rave_row)

CM$CMDECOD <- NULL
check_cm_cmdecod(CM)

Run the code above in your browser using DataLab