Teal Module: Patient Prior Medication Teal Module
Source:R/tm_t_pp_prior_medication.R
tm_t_pp_prior_medication.Rd
This teal module produces a patient prior medication report using ADaM datasets.
Usage
tm_t_pp_prior_medication(
label,
dataname = "ADCM",
parentname = "ADSL",
patient_col = "USUBJID",
atirel = NULL,
cmdecod = NULL,
cmindc = NULL,
cmstdy = NULL,
pre_output = NULL,
post_output = NULL
)
Arguments
- label
(
character
)
menu item label of the module in the teal app.- dataname
(
character
)
analysis data used in teal module.- parentname
(
character
)
parent analysis data used in teal module, usually this refers toADSL
.- patient_col
(
character
)
patient ID column to be used.- atirel
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)ATIREL
column of the ADCM dataset.- cmdecod
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)CMDECOD
column of the ADCM dataset.- cmindc
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)CMINDC
column of the ADCM dataset.- cmstdy
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)CMSTDY
column of the ADCM dataset.- pre_output
optional, (
shiny.tag
)
with text placed before the output to put the output into context. For example a title.- post_output
optional, (
shiny.tag
)
with text placed after the output to put the output into context. For example theshiny::helpText()
elements are useful.
Examples
adcm <- tmc_ex_adcm
adsl <- tmc_ex_adsl %>% dplyr::filter(USUBJID %in% adcm$USUBJID)
adcm$CMASTDTM <- adcm$ASTDTM
adcm$CMAENDTM <- adcm$AENDTM
adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4")
app <- init(
data = cdisc_data(
cdisc_dataset("ADSL", adsl),
cdisc_dataset("ADCM", adcm, keys = adcm_keys)
),
modules = modules(
tm_t_pp_prior_medication(
label = "Prior Medication",
dataname = "ADCM",
parentname = "ADSL",
patient_col = "USUBJID",
atirel = choices_selected(
choices = variable_choices(adcm, "ATIREL"),
selected = "ATIREL"
),
cmdecod = choices_selected(
choices = variable_choices(adcm, "CMDECOD"),
selected = "CMDECOD"
),
cmindc = choices_selected(
choices = variable_choices(adcm, "CMINDC"),
selected = "CMINDC"
),
cmstdy = choices_selected(
choices = variable_choices(adcm, "ASTDY"),
selected = "ASTDY"
)
)
)
)
#> [INFO] 2023-05-31 23:41:47.9823 pid:3043 token:[] teal.modules.clinical Initializing tm_t_pp_prior_medication
if (interactive()) {
shinyApp(app$ui, app$server)
}