R/check_ae_aeacn_ds_disctx_covid.R
check_ae_aeacn_ds_disctx_covid.Rd
This checks for a COVID-19 AE reported with Action Taken (AEACN*==DRUG WITHDRAWN) but without a corresponding DS record indicating DS.DSDECOD with "ADVERSE EVENT" on any Treatment Discontinuation form. This relies on DSSPID with the string "DISCTX" when DSCAT == "DISPOSITION EVENT" to select Treatment Discontinuation records in DS, as DSSCAT typically includes a text string referring to specific study drug(s).
check_ae_aeacn_ds_disctx_covid(AE, DS, covid_df = NULL)
Adverse Events SDTM dataset with variables USUBJID, AETERM, AEDECOD, AESTDTC, AEACNx
Disposition SDTM dataset with variables USUBJID, DSSPID, DSCAT, DSDECOD
Dataframe of AE preferred terms for COVID-19, containing the variable REFTERM
boolean value if check returns 0 obs, otherwise return subset dataframe.
Other COVID:
check_ae_aeacnoth_ds_stddisc_covid()
,
check_dv_ae_aedecod_covid()
,
check_dv_covid()
covid_df = data.frame(REFTERM = c("COVID-19",
"CORONAVIRUS POSITIVE"
)
)
AE <- data.frame(
STUDYID = 1,
USUBJID = c(1,2,3,1,2,3),
AESTDTC = '2020-05-05',
AETERM = c("abc Covid-19", "covid TEST POSITIVE",rep("other AE",4)),
AEDECOD = c("COVID-19", "CORONAVIRUS POSITIVE", rep("OTHER AE",4)),
AEACN = c("DRUG WITHDRAWN", rep("DOSE NOT CHANGED",5)),
stringsAsFactors = FALSE
)
DS <- data.frame(
USUBJID = c(1,1,2,3,4),
DSSPID = 'XXX-DISCTX-XXX',
DSCAT = "DISPOSITION EVENT",
DSDECOD = "REASON",
stringsAsFactors = FALSE
)
check_ae_aeacn_ds_disctx_covid(AE, DS, covid_df)
#> [1] FALSE
#> attr(,"msg")
#> [1] "1 patient(s) with COVID-19 AE indicating drug withdrawn but no Treatment Discon form indicating AE. "
#> attr(,"data")
#> USUBJID AEDECOD AESTDTC AEACN
#> 1 1 COVID-19 2020-05-05 DRUG WITHDRAWN
DS[1, "DSDECOD"] <- 'ADVERSE EVENT'
check_ae_aeacn_ds_disctx_covid(AE, DS, covid_df)
#> [1] TRUE