Learn R Programming

sdtmchecks (version 1.0.0)

check_ex_exoccur_exdose_exstdtc: Check for Invalid EXDOSE (Dose per Administration) and Missing/Incomplete EXSTDTC (Start Date) Values for valid exposures

Description

This check looks for valid exposures (EXOCCUR=Y or doesn't exist) but EXDOSE (dose per administration) is not > 0 (>= 0 in case of placebo) and/or EXSTDTC (start date/treatment date) is missing or incomplete in the EX (exposure) SDTM domain

Usage

check_ex_exoccur_exdose_exstdtc(EX)

Value

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

Arguments

EX

Exposure SDTM dataset with variables USUBJID, VISIT, VISITNUM, EXOCCUR, EXTRT, EXDOSE, EXSTDTC and EXENDTC

Author

Sara Bodach

Examples

Run this code

EX <- data.frame(USUBJID = LETTERS[1:5],
                 VISIT = paste0("Visit ", 1:5),
                 VISITNUM = 1:5,
                 EXOCCUR = c('Y', rep('', 4)),
                 EXTRT = LETTERS[1:5],
                 EXDOSE = 1:5,
                 EXSTDTC = c('2010-01-01', rep('', 4)),
                 EXENDTC = c('2010-01-01', rep('', 4)),
                 stringsAsFactors = FALSE)

EX$EXOCCUR[2] <- 'Y'
EX$EXSTDTC[2] <- '2011'
EX$EXDOSE[1] <- 0

check_ex_exoccur_exdose_exstdtc(EX)

EX$VISIT <- NULL

check_ex_exoccur_exdose_exstdtc(EX)


Run the code above in your browser using DataLab