Learn R Programming

sdtmchecks (version 1.0.0)

check_cm_cmindc: Check for concomitant medication indication with text string "PROPHYL" when not given for prophylaxis

Description

This check looks for patients with text string "PROPHYL" in CMINDC when CMPROPH is not checked as "Y" in studies with given for prophylaxis variable (CMPROPH)

Usage

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

Value

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

Arguments

CM

Concomitant Medication SDTM dataset with variables USUBJID, CMTRT, CMSTDTC, CMINDC, CMPROPH, CMSPID (optional)

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Sara Bodach, Stella Banjo (HackR 2021)

Examples

Run this code

CM <- data.frame(
 USUBJID = c(rep(1,3),rep(2,3),rep(3,3)),
 CMTRT = letters[1:9],
 CMSTDTC = rep("2017-01-01",9),
 CMINDC = c(rep("INDICATION 1",2), rep("indication 2",2),
            rep("Prophylaxis",2),rep("PROPHYLACTIC",2),"PROPHYLAXIS FOR XYZ"),
 CMPROPH = c(rep("Y",3),rep(NA,2),rep("",2),"NA","."),
 CMSPID = "/F:XXX-D:12345-R:123",
 stringsAsFactors=FALSE
)

check_cm_cmindc(CM)
check_cm_cmindc(CM,preproc=roche_derive_rave_row)

CM$CMPROPH[7] = "Y"
check_cm_cmindc(CM)

CM$CMSPID = NULL
check_cm_cmindc(CM,preproc=roche_derive_rave_row)

CM$CMPROPH = NULL
check_cm_cmindc(CM)


Run the code above in your browser using DataLab