Learn R Programming

sdtmchecks (version 1.0.0)

check_ex_exstdtc_after_dd: Check for EX dates occurring after death date

Description

This check looks for EX dates that occur after death date

Usage

check_ex_exstdtc_after_dd(AE, DS, EX)

Value

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

Arguments

AE

Adverse Event SDTM dataset with variables USUBJID, AEDTHDTC, AESTDTC, AEDECOD, and AETERM

DS

Disposition SDTM dataset with variables USUBJID, DSSTDTC, DSDECOD, and DSTERM

EX

Exposure SDTM dataset with variables USUBJID, EXSTDTC, EXTRT, and EXDOSE

Author

Nina Ting Qi

Examples

Run this code

AE <- data.frame(STUDYID = 1:5, USUBJID = LETTERS[1:5],
                 AEDTHDTC = c(rep("", 4), "2016-01-01"),
                 AESTDTC = rep("2016-01-01", 5),
                 AEDECOD = LETTERS[1:5], AETERM = LETTERS[1:5],
                 stringsAsFactors = FALSE)

DS <- data.frame(STUDYID = 1:5, USUBJID = LETTERS[1:5],
                 DSSTDTC = rep("2016-01-02", 5),
                 DSDECOD = c(LETTERS[1:4], "death"),
                 DSTERM = letters[1:5],
                 stringsAsFactors = FALSE)

EX <- data.frame(STUDYID = 1:5, USUBJID = LETTERS[1:5],
                 EXSTDTC = rep("2015-12-31", 5),
                 EXTRT = LETTERS[1:5],
                 EXDOSE = 1:5,
                 stringsAsFactors = FALSE)

check_ex_exstdtc_after_dd(AE, DS, EX)

EX$EXSTDTC[1] <- "2016-01-03"
EX$USUBJID[1] <- EX$USUBJID[5]

check_ex_exstdtc_after_dd(AE, DS, EX)


Run the code above in your browser using DataLab