Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds decorators to
tm_t_pp_prior_medication
(#1288)
Part of insightsengineering/teal#1371 <details> <summary>Working example</summary> ```r # Load packages pkgload::load_all("../teal.modules.clinical", export_all = FALSE) # Example below rlisting_footer <- function(default_footer = "I am a good footer", .var_to_replace = "table_listing") { teal_transform_module( label = "New row", ui = function(id) shiny::textInput(shiny::NS(id, "footer"), "footer", value = default_footer), server = make_teal_transform_server( substitute({ rlistings::main_footer(.var_to_replace) <- footer }, env = list(.var_to_replace = as.name(.var_to_replace))) ) ) } library(dplyr) data <- teal_data() data <- within(data, { ADCM <- tmc_ex_adcm ADSL <- tmc_ex_adsl %>% filter(USUBJID %in% ADCM$USUBJID) ADCM$CMASTDTM <- ADCM$ASTDTM ADCM$CMAENDTM <- ADCM$AENDTM }) join_keys(data) <- default_cdisc_join_keys[names(data)] adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") join_keys(data)["ADCM", "ADCM"] <- adcm_keys ADSL <- data[["ADSL"]] ADCM <- data[["ADCM"]] init( data = data, 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" ), decorators = list( table = rlisting_footer(.var_to_replace = "table") ) ) ) ) |> shiny::runApp() ``` </details>
- Loading branch information