Skip to contents

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 to ADSL.

patient_col

(character)
patient ID column to be used.

atirel

(teal.transform::choices_selected() or teal.transform::data_extract_spec())
ATIREL column of the ADCM dataset.

cmdecod

(teal.transform::choices_selected() or teal.transform::data_extract_spec())
CMDECOD column of the ADCM dataset.

cmindc

(teal.transform::choices_selected() or teal.transform::data_extract_spec())
CMINDC column of the ADCM dataset.

cmstdy

(teal.transform::choices_selected() or teal.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 the shiny::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-08-14 14:44:23.9100 pid:1183 token:[] teal.modules.clinical Initializing tm_t_pp_prior_medication
if (interactive()) {
  shinyApp(app$ui, app$server)
}