Skip to contents

This module produces a patient profile medical history report using ADaM datasets.

Usage

tm_t_pp_medical_history(
  label,
  dataname = "ADMH",
  parentname = "ADSL",
  patient_col = "USUBJID",
  mhterm = NULL,
  mhbodsys = NULL,
  mhdistat = NULL,
  pre_output = NULL,
  post_output = NULL,
  decorators = 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)
name of patient ID variable.

mhterm

(teal.transform::choices_selected())
object with all available choices and preselected option for the MHTERM variable from dataname.

mhbodsys

(teal.transform::choices_selected())
object with all available choices and preselected option for the MHBODSYS variable from dataname.

mhdistat

(teal.transform::choices_selected())
object with all available choices and preselected option for the MHDISTAT variable from dataname.

pre_output

(shiny.tag) optional,
with text placed before the output to put the output into context. For example a title.

post_output

(shiny.tag) optional,
with text placed after the output to put the output into context. For example the shiny::helpText() elements are useful.

decorators

[Experimental] " (list of teal_transform_module, named list of teal_transform_module or" NULL) optional, if not NULL, decorator for tables or plots included in the module. When a named list of teal_transform_module, the decorators are applied to the respective output objects.

Otherwise, the decorators are applied to all objects, which is equivalent as using the name default.

See section "Decorating Module" below for more details.

Value

a teal_module object.

Decorating Module

This module generates the following objects, which can be modified in place using decorators:

For additional details and examples of decorators, refer to the vignette vignette("decorate-modules-output", package = "teal") or the teal_transform_module() documentation.

Examples in Shinylive

example-1

Open in Shinylive

Examples

data <- teal_data()
data <- within(data, {
  ADSL <- tmc_ex_adsl
  ADMH <- tmc_ex_admh
})
join_keys(data) <- default_cdisc_join_keys[names(data)]

ADSL <- data[["ADSL"]]
ADMH <- data[["ADMH"]]

app <- init(
  data = data,
  modules = modules(
    tm_t_pp_medical_history(
      label = "Medical History",
      dataname = "ADMH",
      parentname = "ADSL",
      patient_col = "USUBJID",
      mhterm = choices_selected(
        choices = variable_choices(ADMH, c("MHTERM")),
        selected = "MHTERM"
      ),
      mhbodsys = choices_selected(
        choices = variable_choices(ADMH, "MHBODSYS"),
        selected = "MHBODSYS"
      ),
      mhdistat = choices_selected(
        choices = variable_choices(ADMH, "MHDISTAT"),
        selected = "MHDISTAT"
      )
    )
  )
)
#> Initializing tm_t_pp_medical_history
#> Initializing reporter_previewer_module
if (interactive()) {
  shinyApp(app$ui, app$server)
}