R/check_dv_ae_aedecod_covid.R
check_dv_ae_aedecod_covid.Rd
If a patient has a DV record indicating COVID-19 then they should also have COVID-related AE where AE.AEDECOD matches covid.REFTERM.
check_dv_ae_aedecod_covid(
AE,
DV,
covid_terms = c("COVID-19", "CORONAVIRUS POSITIVE")
)
boolean value if check returns 0 obs, otherwise return subset dataframe.
Other COVID:
check_ae_aeacn_ds_disctx_covid()
,
check_ae_aeacnoth_ds_stddisc_covid()
,
check_dv_covid()
AE <- data.frame(
USUBJID = 1:6,
AEDECOD = c("pandemic", "covid-19","some AE","some AE","CORONAVIRUS POSITIVE","UNMAPPED")
)
DV <- data.frame(
USUBJID = 1:6,
DVREAS=c("SUSPECTED EPIDEMIC/PANDEMIC INFECTION",
"UNKNOWN",
"SUSPECTED EPIDEMIC/PANDEMIC INFECTION",
"OTHER",
"SUSPECTED EPIDEMIC/PANDEMIC INFECTION",
"SUSPECTED EPIDEMIC/PANDEMIC INFECTION")
)
check_dv_ae_aedecod_covid(AE,DV)
#> [1] FALSE
#> attr(,"msg")
#> [1] "Found 3 patient(s) with COVID-related Protocol Deviation, but no AE record with COVID terms. Default terms used for identifying Covid AEs: COVID-19,CORONAVIRUS POSITIVE"
#> attr(,"data")
#> USUBJID DVREAS AEDECOD
#> 1 1 SUSPECTED EPIDEMIC/PANDEMIC INFECTION <NA>
#> 2 3 SUSPECTED EPIDEMIC/PANDEMIC INFECTION <NA>
#> 4 6 SUSPECTED EPIDEMIC/PANDEMIC INFECTION <NA>
# Pass specific covid terms
check_dv_ae_aedecod_covid(AE,DV,covid_terms=c("COVID-19", "CORONAVIRUS POSITIVE","PANDEMIC"))
#> [1] FALSE
#> attr(,"msg")
#> [1] "Found 2 patient(s) with COVID-related Protocol Deviation, but no AE record with COVID terms. "
#> attr(,"data")
#> USUBJID DVREAS AEDECOD
#> 2 3 SUSPECTED EPIDEMIC/PANDEMIC INFECTION <NA>
#> 4 6 SUSPECTED EPIDEMIC/PANDEMIC INFECTION <NA>