Teal Module: Patient Medical History Teal Module
Source:R/tm_t_pp_medical_history.R
tm_t_pp_medical_history.Rd
This teal module produces a patient 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
)
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.- mhterm
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)MHTERM
column of the ADMH dataset.- mhbodsys
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)MHBODSYS
column of the ADMH dataset.- mhdistat
(
teal.transform::choices_selected()
orteal.transform::data_extract_spec()
)MHDISTAT
column of the ADMH 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
library(scda)
synthetic_cdisc_data_latest <- synthetic_cdisc_data("latest")
ADSL <- synthetic_cdisc_data_latest$adsl
ADMH <- synthetic_cdisc_data_latest$admh
ADMH[["MHDISTAT"]] <- "ONGOING"
formatters::var_labels(ADMH[c("MHDISTAT")]) <- c("Status of Disease")
app <- init(
data = cdisc_data(
cdisc_dataset("ADSL", ADSL,
code = "synthetic_cdisc_data_latest <- synthetic_cdisc_data('latest')
ADSL <- synthetic_cdisc_data_latest$adsl"
),
cdisc_dataset("ADMH", ADMH,
code = "synthetic_cdisc_data_latest <- synthetic_cdisc_data('latest')
ADMH <- synthetic_cdisc_data_latest$admh
ADMH[['MHDISTAT']] <- 'ONGOING'
formatters::var_labels(ADMH[c('MHDISTAT')]) <- c('Status of Disease')"
)
),
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"
)
)
)
)
#> [INFO] 2022-10-14 09:11:05.0281 pid:3139 token:[] teal.modules.clinical Initializing tm_t_pp_medical_history
if (FALSE) {
shinyApp(app$ui, app$server)
}