Learn R Programming

sdtmchecks (version 1.0.0)

check_ds_ex_after_discon: Check for patients who had Start/End date of treatment after study discontinuation date

Description

Check for patients who had Start/End date of treatment after study discontinuation date in the DS and EX domains.

Usage

check_ds_ex_after_discon(DS, EX)

Value

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

Arguments

DS

Disposition SDTM dataset with variables USUBJID, DSSCAT, DSCAT and DSSTDTC

EX

Exposure SDTM dataset with variables USUBJID, EXSTDTC, EXENDTC, EXTRT, EXDOSE and EXOCCUR (if available)

Author

Saibah Chohan, Ashley Mao, Tina Cho (HackR 2021 Team STA-R)

Examples

Run this code

DS <- data.frame(
 USUBJID = c(rep(1,2), rep(2,2)),
 DSSCAT= rep(c("STUDY COMPLETION/EARLY DISCONTINUATION", "ADVERSE EVENT"),2),
 DSCAT = rep(c("DISPOSITION EVENT", "OTHER"),2),
 DSSTDTC = c("2019-12-29", "2019-12-20", "2019-12-10", "2019-12-01"),
 stringsAsFactors = FALSE
 )

EX <- data.frame(
 USUBJID = c(rep(1,2), rep(2,2)),
 EXSTDTC = c("2019-12-20", "2019-12-28", "2019-12-26", "2019-12-27"),
 EXENDTC = c("2019-12-10", "2019-12-23", "2019-12-30", "2019-12-27"),
 EXTRT = c(rep("SOME DRUG", 2), rep("PLACEBO",2)),
 EXDOSE = c(10,10,0,0),
 stringsAsFactors = FALSE
 )

check_ds_ex_after_discon(DS, EX)

DS <- data.frame(
 USUBJID = c(rep(1,2), rep(2,2)),
 DSSCAT= rep(c("STUDY COMPLETION/EARLY DISCONTINUATION", "ADVERSE EVENT"),2),
 DSCAT = rep(c("DISPOSITION EVENT", "OTHER"),2),
 DSSTDTC = c("2019-12-29", "2019-12-20", "2019-12-10", "2019-12-01"),
 stringsAsFactors = FALSE
 )

EX <- data.frame(
 USUBJID = c(rep(1,2), rep(2,2)),
 EXSTDTC = c("2019-12-20", "2019-12-28", "2019-12-01", "2019-12-02"),
 EXENDTC = c("2019-12-10", "2019-12-23", "2020", "2020"),
 EXTRT = c(rep("SOME DRUG", 2), rep("PLACEBO",2)),
 EXDOSE = c(10,10,0,0),
 stringsAsFactors = FALSE
 )

check_ds_ex_after_discon(DS, EX)



Run the code above in your browser using DataLab