From 2e85653d0f5de490f31ae03ec533635a6dad29c8 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 13 Mar 2024 17:25:50 +0100 Subject: [PATCH 01/27] use restoreInput in update functions --- R/tm_a_gee.R | 5 ++++- R/tm_a_mmrm.R | 5 ++++- R/tm_g_forest_rsp.R | 5 ++++- R/tm_g_pp_adverse_events.R | 18 ++++++++++++------ R/tm_g_pp_patient_timeline.R | 18 ++++++++++++------ R/tm_g_pp_therapy.R | 19 +++++++++++++------ R/tm_g_pp_vitals.R | 18 ++++++++++++------ R/tm_t_abnormality.R | 5 ++++- R/tm_t_abnormality_by_worst_grade.R | 5 ++++- R/tm_t_ancova.R | 5 ++++- R/tm_t_binary_outcome.R | 5 ++++- R/tm_t_events_patyear.R | 5 ++++- R/tm_t_logistic.R | 5 ++++- R/tm_t_pp_basic_info.R | 18 ++++++++++++------ R/tm_t_pp_laboratory.R | 20 +++++++++++++------- R/tm_t_pp_medical_history.R | 19 +++++++++++++------ R/tm_t_pp_prior_medication.R | 18 ++++++++++++------ R/tm_t_shift_by_arm.R | 5 ++++- R/tm_t_shift_by_arm_by_worst.R | 5 ++++- 19 files changed, 143 insertions(+), 60 deletions(-) diff --git a/R/tm_a_gee.R b/R/tm_a_gee.R index 11538e9cd4..7d6bba2675 100644 --- a/R/tm_a_gee.R +++ b/R/tm_a_gee.R @@ -390,6 +390,9 @@ srv_gee <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + ## split_covariates ---- shiny::observeEvent(input[[extract_input("cov_var", dataname)]], ignoreNULL = FALSE, @@ -408,7 +411,7 @@ srv_gee <- function(id, teal.widgets::updateOptionalSelectInput( session, inputId = extract_input("split_covariates", dataname), - selected = split_covariates_selected + selected = shiny::restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) ) } ) diff --git a/R/tm_a_mmrm.R b/R/tm_a_mmrm.R index dea651dbb0..1e8f6384d4 100644 --- a/R/tm_a_mmrm.R +++ b/R/tm_a_mmrm.R @@ -846,6 +846,9 @@ srv_mmrm <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + # Reactive responsible for sending a disable/enable signal # to show R code and debug info buttons disable_r_code <- shiny::reactiveVal(FALSE) @@ -863,7 +866,7 @@ srv_mmrm <- function(id, teal.widgets::updateOptionalSelectInput( session, inputId = extract_input("split_covariates", dataname), - selected = split_covariates_selected + selected = shiny::restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) ) }) diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index 35f8b0f122..aa55a71ee5 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -509,6 +509,9 @@ srv_g_forest_rsp <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + # Setup arm variable selection, default reference arms, and default # comparison arms for encoding panel iv_arm_ref <- arm_ref_comp_observer( @@ -609,7 +612,7 @@ srv_g_forest_rsp <- function(id, shiny::updateSelectInput( session, "responders", choices = responder_choices, - selected = intersect(responder_choices, common_rsp) + selected = shiny::restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) ) } ) diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 2325413097..884d2680b5 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -443,6 +443,9 @@ srv_g_adverse_events <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init @@ -451,7 +454,7 @@ srv_g_adverse_events <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -460,11 +463,14 @@ srv_g_adverse_events <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInput( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index d1ce18dc5e..9fd87ec7f8 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -714,6 +714,9 @@ srv_g_patient_timeline <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init @@ -722,7 +725,7 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -731,11 +734,14 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index b29f59500f..d8d556278c 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -559,13 +559,17 @@ srv_g_therapy <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init patient_data_base <- shiny::reactive(unique(data()[[parentname]][[patient_col]])) teal.widgets::updateOptionalSelectInput( session, "patient_id", - choices = patient_data_base(), selected = patient_data_base()[1] + choices = patient_data_base(), + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -574,11 +578,14 @@ srv_g_therapy <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index b489af7562..436f9e0eab 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -412,6 +412,9 @@ srv_g_vitals <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init @@ -420,7 +423,7 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -429,11 +432,14 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index 9cb509b243..83995d2a12 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -506,6 +506,9 @@ srv_t_abnormality <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list( arm_var = arm_var, @@ -544,7 +547,7 @@ srv_t_abnormality <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = resolved$selected + selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 5b886d3cc6..9c02bf1232 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -504,13 +504,16 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + shiny::isolate({ resolved <- teal.transform::resolve_delayed(worst_flag_indicator, as.list(data()@env)) teal.widgets::updateOptionalSelectInput( session = session, inputId = "worst_flag_indicator", choices = resolved$choices, - selected = resolved$selected + selected = rshiny::restoreInputns(ns("worst_flag_indicator"), esolved$selected) ) }) diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index 490a135101..a66db729fe 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -697,6 +697,9 @@ srv_ancova <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + # Setup arm variable selection, default reference arms, and default # comparison arms for encoding panel. iv_arco <- arm_ref_comp_observer( @@ -796,7 +799,7 @@ srv_ancova <- function(id, session, "interact_y", selected = interact_select, - choices = interact_choices + choices = shiny::restoreInputns(ns("interact_y"), interact_choices) ) } } diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index d1383a0415..dab37d8778 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -712,6 +712,9 @@ srv_t_binary_outcome <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + # Setup arm variable selection, default reference arms, and default # comparison arms for encoding panel iv_arm_ref <- arm_ref_comp_observer( @@ -804,7 +807,7 @@ srv_t_binary_outcome <- function(id, shiny::updateSelectInput( session, "responders", choices = responder_choices, - selected = intersect(responder_choices, common_rsp) + selected = shiny::restoreInputns(ns("responders"), intersect(responder_choices, common_rsp)) ) } ) diff --git a/R/tm_t_events_patyear.R b/R/tm_t_events_patyear.R index 0e32c9269d..9ae6e23d16 100644 --- a/R/tm_t_events_patyear.R +++ b/R/tm_t_events_patyear.R @@ -402,6 +402,9 @@ srv_events_patyear <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + shiny::observeEvent(anl_q(), { data_anl <- merged$anl_q()[["ANL"]] aval_unit_var <- merged$anl_input_r()$columns_source$avalu_var @@ -413,7 +416,7 @@ srv_events_patyear <- function(id, session, "input_time_unit", choices = choices, - selected = choices[1] + selected = shiny::restoreInputns(ns("input_time_unit"), choices[1]) ) } }) diff --git a/R/tm_t_logistic.R b/R/tm_t_logistic.R index 72ff4c82de..c1d82cd1f3 100644 --- a/R/tm_t_logistic.R +++ b/R/tm_t_logistic.R @@ -451,6 +451,9 @@ srv_t_logistic <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + # Observer to update reference and comparison arm input options. iv_arco <- arm_ref_comp_observer( session, @@ -554,7 +557,7 @@ srv_t_logistic <- function(id, shiny::updateSelectInput( session, "responders", choices = responder_choices, - selected = responder_sel + selected = shiny::restoreInputns(ns("responders"), responder_sel) ) }) diff --git a/R/tm_t_pp_basic_info.R b/R/tm_t_pp_basic_info.R index 09b8928019..3bec0b2da9 100644 --- a/R/tm_t_pp_basic_info.R +++ b/R/tm_t_pp_basic_info.R @@ -181,6 +181,9 @@ srv_t_basic_info <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init @@ -189,7 +192,7 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -198,11 +201,14 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_t_pp_laboratory.R b/R/tm_t_pp_laboratory.R index da4ec434ad..53fffaaa66 100644 --- a/R/tm_t_pp_laboratory.R +++ b/R/tm_t_pp_laboratory.R @@ -377,6 +377,9 @@ srv_g_laboratory <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init @@ -385,7 +388,7 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -394,11 +397,14 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE @@ -413,7 +419,7 @@ srv_g_laboratory <- function(id, session, "round_value", choices = seq(0, max_decimal), - selected = min(4, max_decimal) + selected = shiny::restoreInputns(ns("round_value"), min(4, max_decimal)) ) # Laboratory values tab ---- diff --git a/R/tm_t_pp_medical_history.R b/R/tm_t_pp_medical_history.R index 326f8802f9..e4c4731fbe 100644 --- a/R/tm_t_pp_medical_history.R +++ b/R/tm_t_pp_medical_history.R @@ -245,13 +245,17 @@ srv_t_medical_history <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) # Init patient_data_base <- shiny::reactive(unique(data()[[parentname]][[patient_col]])) teal.widgets::updateOptionalSelectInput( session, "patient_id", - choices = patient_data_base(), selected = patient_data_base()[1] + choices = patient_data_base(), + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -260,11 +264,14 @@ srv_t_medical_history <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_t_pp_prior_medication.R b/R/tm_t_pp_prior_medication.R index 1c473d412d..0ca4e6967d 100644 --- a/R/tm_t_pp_prior_medication.R +++ b/R/tm_t_pp_prior_medication.R @@ -243,6 +243,9 @@ srv_t_prior_medication <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + patient_id <- shiny::reactive(input$patient_id) selector_list <- teal.transform::data_extract_multiple_srv( @@ -273,7 +276,7 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = patient_data_base()[1] + selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -282,11 +285,14 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } + selected = shiny::restoreInputns( + ns("patient_id"), + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + ) ) }, ignoreInit = TRUE diff --git a/R/tm_t_shift_by_arm.R b/R/tm_t_shift_by_arm.R index f53365a476..678788c3ab 100644 --- a/R/tm_t_shift_by_arm.R +++ b/R/tm_t_shift_by_arm.R @@ -437,6 +437,9 @@ srv_shift_by_arm <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list( arm_var = arm_var, @@ -465,7 +468,7 @@ srv_shift_by_arm <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = resolved$selected + selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_shift_by_arm_by_worst.R b/R/tm_t_shift_by_arm_by_worst.R index c4e97e977f..eeb1a0e13b 100644 --- a/R/tm_t_shift_by_arm_by_worst.R +++ b/R/tm_t_shift_by_arm_by_worst.R @@ -457,6 +457,9 @@ srv_shift_by_arm_by_worst <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { + + ns <- session$ns + selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list( arm_var = arm_var, @@ -485,7 +488,7 @@ srv_shift_by_arm_by_worst <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = resolved$selected + selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) ) }) From b49a4b18e128a86b0d5edcab091d9f53c90fe90f Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Fri, 15 Mar 2024 16:39:17 +0100 Subject: [PATCH 02/27] fix typo --- R/tm_t_abnormality_by_worst_grade.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 9c02bf1232..874c9480e7 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -513,7 +513,7 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. session = session, inputId = "worst_flag_indicator", choices = resolved$choices, - selected = rshiny::restoreInputns(ns("worst_flag_indicator"), esolved$selected) + selected = rshiny::restoreInputns(ns("worst_flag_indicator"), resolved$selected) ) }) From 8c374589ead6cbfeeca8793564c1ae853077d89e Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Fri, 15 Mar 2024 16:39:58 +0100 Subject: [PATCH 03/27] fix typo ctd. --- R/tm_t_abnormality_by_worst_grade.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 874c9480e7..e518120d0a 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -513,7 +513,7 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. session = session, inputId = "worst_flag_indicator", choices = resolved$choices, - selected = rshiny::restoreInputns(ns("worst_flag_indicator"), resolved$selected) + selected = shiny::restoreInputns(ns("worst_flag_indicator"), resolved$selected) ) }) From a0e345d55e4c9560d4ec6ceadaf33ab0a5e8c49d Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Fri, 15 Mar 2024 16:41:40 +0100 Subject: [PATCH 04/27] styling --- R/tm_a_gee.R | 1 - R/tm_a_mmrm.R | 1 - R/tm_g_forest_rsp.R | 1 - R/tm_g_pp_adverse_events.R | 1 - R/tm_g_pp_patient_timeline.R | 1 - R/tm_g_pp_therapy.R | 1 - R/tm_g_pp_vitals.R | 1 - R/tm_t_abnormality.R | 1 - R/tm_t_abnormality_by_worst_grade.R | 1 - R/tm_t_ancova.R | 1 - R/tm_t_binary_outcome.R | 1 - R/tm_t_events_patyear.R | 1 - R/tm_t_logistic.R | 1 - R/tm_t_pp_basic_info.R | 1 - R/tm_t_pp_laboratory.R | 1 - R/tm_t_pp_medical_history.R | 1 - R/tm_t_pp_prior_medication.R | 1 - R/tm_t_shift_by_arm.R | 1 - R/tm_t_shift_by_arm_by_worst.R | 1 - 19 files changed, 19 deletions(-) diff --git a/R/tm_a_gee.R b/R/tm_a_gee.R index 7d6bba2675..3e99d28655 100644 --- a/R/tm_a_gee.R +++ b/R/tm_a_gee.R @@ -390,7 +390,6 @@ srv_gee <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns ## split_covariates ---- diff --git a/R/tm_a_mmrm.R b/R/tm_a_mmrm.R index e7d29f34ce..4ddf1fb108 100644 --- a/R/tm_a_mmrm.R +++ b/R/tm_a_mmrm.R @@ -846,7 +846,6 @@ srv_mmrm <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns # Reactive responsible for sending a disable/enable signal diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index a427a27cfa..3bd86f6d04 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -509,7 +509,6 @@ srv_g_forest_rsp <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns # Setup arm variable selection, default reference arms, and default diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 884d2680b5..9936a80fc8 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -443,7 +443,6 @@ srv_g_adverse_events <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index 9fd87ec7f8..e85138fd70 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -714,7 +714,6 @@ srv_g_patient_timeline <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index d8d556278c..e6dd636719 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -559,7 +559,6 @@ srv_g_therapy <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index 436f9e0eab..89b023676b 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -412,7 +412,6 @@ srv_g_vitals <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index 83995d2a12..d53075575b 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -506,7 +506,6 @@ srv_t_abnormality <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index e518120d0a..f5c40a134c 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -504,7 +504,6 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns shiny::isolate({ diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index a66db729fe..6a01f98152 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -697,7 +697,6 @@ srv_ancova <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns # Setup arm variable selection, default reference arms, and default diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index dab37d8778..63f881f5b4 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -712,7 +712,6 @@ srv_t_binary_outcome <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns # Setup arm variable selection, default reference arms, and default diff --git a/R/tm_t_events_patyear.R b/R/tm_t_events_patyear.R index 9ae6e23d16..147e355dc5 100644 --- a/R/tm_t_events_patyear.R +++ b/R/tm_t_events_patyear.R @@ -402,7 +402,6 @@ srv_events_patyear <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns shiny::observeEvent(anl_q(), { diff --git a/R/tm_t_logistic.R b/R/tm_t_logistic.R index c1d82cd1f3..63ba16c4e6 100644 --- a/R/tm_t_logistic.R +++ b/R/tm_t_logistic.R @@ -451,7 +451,6 @@ srv_t_logistic <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns # Observer to update reference and comparison arm input options. diff --git a/R/tm_t_pp_basic_info.R b/R/tm_t_pp_basic_info.R index 3bec0b2da9..4b24b302ba 100644 --- a/R/tm_t_pp_basic_info.R +++ b/R/tm_t_pp_basic_info.R @@ -181,7 +181,6 @@ srv_t_basic_info <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_t_pp_laboratory.R b/R/tm_t_pp_laboratory.R index 53fffaaa66..ef192d6e8a 100644 --- a/R/tm_t_pp_laboratory.R +++ b/R/tm_t_pp_laboratory.R @@ -377,7 +377,6 @@ srv_g_laboratory <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_t_pp_medical_history.R b/R/tm_t_pp_medical_history.R index e4c4731fbe..923b792fb8 100644 --- a/R/tm_t_pp_medical_history.R +++ b/R/tm_t_pp_medical_history.R @@ -245,7 +245,6 @@ srv_t_medical_history <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_t_pp_prior_medication.R b/R/tm_t_pp_prior_medication.R index 0ca4e6967d..16e447aa20 100644 --- a/R/tm_t_pp_prior_medication.R +++ b/R/tm_t_pp_prior_medication.R @@ -243,7 +243,6 @@ srv_t_prior_medication <- function(id, checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns patient_id <- shiny::reactive(input$patient_id) diff --git a/R/tm_t_shift_by_arm.R b/R/tm_t_shift_by_arm.R index 678788c3ab..72c42d4e9c 100644 --- a/R/tm_t_shift_by_arm.R +++ b/R/tm_t_shift_by_arm.R @@ -437,7 +437,6 @@ srv_shift_by_arm <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_shift_by_arm_by_worst.R b/R/tm_t_shift_by_arm_by_worst.R index eeb1a0e13b..29b3037493 100644 --- a/R/tm_t_shift_by_arm_by_worst.R +++ b/R/tm_t_shift_by_arm_by_worst.R @@ -457,7 +457,6 @@ srv_shift_by_arm_by_worst <- function(id, checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") shiny::moduleServer(id, function(input, output, session) { - ns <- session$ns selector_list <- teal.transform::data_extract_multiple_srv( From bcc5d75d703a1460b8dc431b998515afec8f8e9a Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Fri, 15 Mar 2024 16:56:35 +0100 Subject: [PATCH 05/27] fix typos 3 --- R/tm_g_pp_patient_timeline.R | 4 ++-- R/tm_g_pp_therapy.R | 4 ++-- R/tm_g_pp_vitals.R | 4 ++-- R/tm_t_abnormality.R | 2 +- R/tm_t_abnormality_by_worst_grade.R | 2 +- R/tm_t_ancova.R | 2 +- R/tm_t_binary_outcome.R | 2 +- R/tm_t_events_patyear.R | 2 +- R/tm_t_logistic.R | 2 +- R/tm_t_pp_basic_info.R | 4 ++-- R/tm_t_pp_laboratory.R | 6 +++--- R/tm_t_pp_medical_history.R | 4 ++-- R/tm_t_pp_prior_medication.R | 4 ++-- R/tm_t_shift_by_arm.R | 2 +- R/tm_t_shift_by_arm_by_worst.R | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index e85138fd70..6b96976136 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -724,7 +724,7 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -733,7 +733,7 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index e6dd636719..92ae6e8c26 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -568,7 +568,7 @@ srv_g_therapy <- function(id, teal.widgets::updateOptionalSelectInput( session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -577,7 +577,7 @@ srv_g_therapy <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index 89b023676b..6711406dac 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -422,7 +422,7 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -431,7 +431,7 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index d53075575b..78c98b7218 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -546,7 +546,7 @@ srv_t_abnormality <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) + selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index f5c40a134c..ae80390613 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -512,7 +512,7 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. session = session, inputId = "worst_flag_indicator", choices = resolved$choices, - selected = shiny::restoreInputns(ns("worst_flag_indicator"), resolved$selected) + selected = shiny::restoreInput(ns("worst_flag_indicator"), resolved$selected) ) }) diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index 6a01f98152..094bbd1b02 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -798,7 +798,7 @@ srv_ancova <- function(id, session, "interact_y", selected = interact_select, - choices = shiny::restoreInputns(ns("interact_y"), interact_choices) + choices = shiny::restoreInput(ns("interact_y"), interact_choices) ) } } diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index 63f881f5b4..508e9b6cf2 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -806,7 +806,7 @@ srv_t_binary_outcome <- function(id, shiny::updateSelectInput( session, "responders", choices = responder_choices, - selected = shiny::restoreInputns(ns("responders"), intersect(responder_choices, common_rsp)) + selected = shiny::restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) ) } ) diff --git a/R/tm_t_events_patyear.R b/R/tm_t_events_patyear.R index 147e355dc5..068d6f0c63 100644 --- a/R/tm_t_events_patyear.R +++ b/R/tm_t_events_patyear.R @@ -415,7 +415,7 @@ srv_events_patyear <- function(id, session, "input_time_unit", choices = choices, - selected = shiny::restoreInputns(ns("input_time_unit"), choices[1]) + selected = shiny::restoreInput(ns("input_time_unit"), choices[1]) ) } }) diff --git a/R/tm_t_logistic.R b/R/tm_t_logistic.R index 63ba16c4e6..762318f3df 100644 --- a/R/tm_t_logistic.R +++ b/R/tm_t_logistic.R @@ -556,7 +556,7 @@ srv_t_logistic <- function(id, shiny::updateSelectInput( session, "responders", choices = responder_choices, - selected = shiny::restoreInputns(ns("responders"), responder_sel) + selected = shiny::restoreInput(ns("responders"), responder_sel) ) }) diff --git a/R/tm_t_pp_basic_info.R b/R/tm_t_pp_basic_info.R index 4b24b302ba..edacc1e1e0 100644 --- a/R/tm_t_pp_basic_info.R +++ b/R/tm_t_pp_basic_info.R @@ -191,7 +191,7 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -200,7 +200,7 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_pp_laboratory.R b/R/tm_t_pp_laboratory.R index ef192d6e8a..36d705d897 100644 --- a/R/tm_t_pp_laboratory.R +++ b/R/tm_t_pp_laboratory.R @@ -387,7 +387,7 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -396,7 +396,7 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() @@ -418,7 +418,7 @@ srv_g_laboratory <- function(id, session, "round_value", choices = seq(0, max_decimal), - selected = shiny::restoreInputns(ns("round_value"), min(4, max_decimal)) + selected = shiny::restoreInput(ns("round_value"), min(4, max_decimal)) ) # Laboratory values tab ---- diff --git a/R/tm_t_pp_medical_history.R b/R/tm_t_pp_medical_history.R index 923b792fb8..4eb1b1a79e 100644 --- a/R/tm_t_pp_medical_history.R +++ b/R/tm_t_pp_medical_history.R @@ -254,7 +254,7 @@ srv_t_medical_history <- function(id, teal.widgets::updateOptionalSelectInput( session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -263,7 +263,7 @@ srv_t_medical_history <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_pp_prior_medication.R b/R/tm_t_pp_prior_medication.R index 16e447aa20..e4ef245ca7 100644 --- a/R/tm_t_pp_prior_medication.R +++ b/R/tm_t_pp_prior_medication.R @@ -275,7 +275,7 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns(ns("patient_id"), patient_data_base()[1]) + selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) ) shiny::observeEvent(patient_data_base(), @@ -284,7 +284,7 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInputns( + selected = shiny::restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_shift_by_arm.R b/R/tm_t_shift_by_arm.R index 72c42d4e9c..032c5b6a57 100644 --- a/R/tm_t_shift_by_arm.R +++ b/R/tm_t_shift_by_arm.R @@ -467,7 +467,7 @@ srv_shift_by_arm <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) + selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_shift_by_arm_by_worst.R b/R/tm_t_shift_by_arm_by_worst.R index 29b3037493..2f8ab93dfd 100644 --- a/R/tm_t_shift_by_arm_by_worst.R +++ b/R/tm_t_shift_by_arm_by_worst.R @@ -487,7 +487,7 @@ srv_shift_by_arm_by_worst <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInputns(ns("treatment_flag"), resolved$selected) + selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) ) }) From 3612335849066fb3f9f4bd703ef98863924ea619 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Mon, 18 Mar 2024 18:38:32 +0100 Subject: [PATCH 06/27] trigger From 19cca0a71c6f9442d9a2b0a23d2e2dd80e725810 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 20 Mar 2024 16:38:37 +0100 Subject: [PATCH 07/27] remove shiny prefixes --- R/tm_a_gee.R | 2 +- R/tm_a_mmrm.R | 2 +- R/tm_g_forest_rsp.R | 2 +- R/tm_g_pp_adverse_events.R | 4 ++-- R/tm_g_pp_patient_timeline.R | 4 ++-- R/tm_g_pp_therapy.R | 4 ++-- R/tm_g_pp_vitals.R | 4 ++-- R/tm_t_abnormality.R | 2 +- R/tm_t_abnormality_by_worst_grade.R | 4 ++-- R/tm_t_ancova.R | 14 +++++++------- R/tm_t_binary_outcome.R | 4 ++-- R/tm_t_coxreg.R | 4 ++-- R/tm_t_events.R | 2 +- R/tm_t_events_by_grade.R | 2 +- R/tm_t_events_patyear.R | 4 ++-- R/tm_t_events_summary.R | 2 +- R/tm_t_exposure.R | 2 +- R/tm_t_logistic.R | 6 +++--- R/tm_t_mult_events.R | 2 +- R/tm_t_pp_basic_info.R | 6 +++--- R/tm_t_pp_laboratory.R | 8 ++++---- R/tm_t_pp_medical_history.R | 6 +++--- R/tm_t_pp_prior_medication.R | 6 +++--- R/tm_t_shift_by_arm.R | 4 ++-- R/tm_t_shift_by_arm_by_worst.R | 4 ++-- R/tm_t_shift_by_grade.R | 2 +- R/tm_t_smq.R | 2 +- R/tm_t_summary.R | 2 +- R/tm_t_summary_by.R | 4 ++-- R/tm_t_tte.R | 4 ++-- R/validate_standard_inputs.R | 2 +- 31 files changed, 60 insertions(+), 60 deletions(-) diff --git a/R/tm_a_gee.R b/R/tm_a_gee.R index 7ca942bcdb..e833b74f32 100644 --- a/R/tm_a_gee.R +++ b/R/tm_a_gee.R @@ -410,7 +410,7 @@ srv_gee <- function(id, teal.widgets::updateOptionalSelectInput( session, inputId = extract_input("split_covariates", dataname), - selected = shiny::restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) + selected = restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) ) } ) diff --git a/R/tm_a_mmrm.R b/R/tm_a_mmrm.R index ffcea15d47..f3e8bcfa0f 100644 --- a/R/tm_a_mmrm.R +++ b/R/tm_a_mmrm.R @@ -865,7 +865,7 @@ srv_mmrm <- function(id, teal.widgets::updateOptionalSelectInput( session, inputId = extract_input("split_covariates", dataname), - selected = shiny::restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) + selected = restoreInput(ns(extract_input("split_covariates", dataname)), split_covariates_selected) ) }) diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index 8665c85ab5..8018c594ff 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -611,7 +611,7 @@ srv_g_forest_rsp <- function(id, updateSelectInput( session, "responders", choices = responder_choices, - selected = shiny::restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) + selected = restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) ) } ) diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 32d2477a74..11f2004f96 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -453,7 +453,7 @@ srv_g_adverse_events <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -462,7 +462,7 @@ srv_g_adverse_events <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index ad9de913af..a26c533e26 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -724,7 +724,7 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -733,7 +733,7 @@ srv_g_patient_timeline <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index e348a45a30..83ead79c67 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -568,7 +568,7 @@ srv_g_therapy <- function(id, teal.widgets::updateOptionalSelectInput( session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -577,7 +577,7 @@ srv_g_therapy <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index dfe8c3a160..d045942586 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -422,7 +422,7 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -431,7 +431,7 @@ srv_g_vitals <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index 43de5c4d68..34ac515da0 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -546,7 +546,7 @@ srv_t_abnormality <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) + selected = restoreInput(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 0289250574..2febb68631 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -501,7 +501,7 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -512,7 +512,7 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. session = session, inputId = "worst_flag_indicator", choices = resolved$choices, - selected = shiny::restoreInput(ns("worst_flag_indicator"), resolved$selected) + selected = restoreInput(ns("worst_flag_indicator"), resolved$selected) ) }) diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index 6f6892c013..460d33abf6 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -694,7 +694,7 @@ srv_ancova <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -798,7 +798,7 @@ srv_ancova <- function(id, session, "interact_y", selected = interact_select, - choices = shiny::restoreInput(ns("interact_y"), interact_choices) + choices = restoreInput(ns("interact_y"), interact_choices) ) } } @@ -836,12 +836,12 @@ srv_ancova <- function(id, do.call(what = "validate_standard_inputs", validate_args) # Other validations. - validate(shiny::need( + validate(need( length(unique(adsl_filtered[[input_arm_var]])) > 1, "ANCOVA table needs at least 2 arm groups to make comparisons." )) # check that there is at least one record with no missing data - validate(shiny::need( + validate(need( !all(is.na(merged$anl_q()[["ANL"]][[input_aval_var]])), "ANCOVA table cannot be calculated as all values are missing." )) @@ -849,14 +849,14 @@ srv_ancova <- function(id, all_NA_dataset <- merged$anl_q()[["ANL"]] %>% # nolint: object_name. dplyr::group_by(dplyr::across(dplyr::all_of(c(input_avisit, input_arm_var)))) %>% dplyr::summarize(all_NA = all(is.na(.data[[input_aval_var]]))) - validate(shiny::need( + validate(need( !any(all_NA_dataset$all_NA), "ANCOVA table cannot be calculated as all values are missing for one visit for (at least) one arm." )) if (input$include_interact) { if (!is.null(input_interact_var) && length(input_interact_var) > 0) { - validate(shiny::need( + validate(need( !input_interact_var %in% c(input_avisit, input_paramcd) && length(as.vector(unique(anl_filtered[[input_interact_var]]))) > 1, paste( @@ -865,7 +865,7 @@ srv_ancova <- function(id, ) )) if (!all(is.numeric(as.vector(unique(anl_filtered[[input_interact_var]]))))) { - validate(shiny::need( + validate(need( !is.null(input$interact_y), paste( "Interaction y must be selected when a discrete variable is chosen for interact variable.", diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index 5b95fa805b..9d2153eb5b 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -709,7 +709,7 @@ srv_t_binary_outcome <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -806,7 +806,7 @@ srv_t_binary_outcome <- function(id, updateSelectInput( session, "responders", choices = responder_choices, - selected = shiny::restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) + selected = restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) ) } ) diff --git a/R/tm_t_coxreg.R b/R/tm_t_coxreg.R index d71ff7ba19..ea2ce1ac6c 100644 --- a/R/tm_t_coxreg.R +++ b/R/tm_t_coxreg.R @@ -714,7 +714,7 @@ srv_t_coxreg <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { # Observer to update reference and comparison arm input options. @@ -903,7 +903,7 @@ srv_t_coxreg <- function(id, } else { c(sum(arm_n[unlist(input$buckets$Ref)]), arm_n[unlist(input$buckets$Comp)]) } - validate(shiny::need( + validate(need( all(anl_arm_n >= 2), "Each treatment group should have at least 2 records." )) diff --git a/R/tm_t_events.R b/R/tm_t_events.R index 8e02434fce..45ffc231b0 100644 --- a/R/tm_t_events.R +++ b/R/tm_t_events.R @@ -675,7 +675,7 @@ srv_t_events_byterm <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_events_by_grade.R b/R/tm_t_events_by_grade.R index e393bf62c7..c4b8271c16 100644 --- a/R/tm_t_events_by_grade.R +++ b/R/tm_t_events_by_grade.R @@ -1019,7 +1019,7 @@ srv_t_events_by_grade <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_events_patyear.R b/R/tm_t_events_patyear.R index 218c8531f1..ba3bbfe7b3 100644 --- a/R/tm_t_events_patyear.R +++ b/R/tm_t_events_patyear.R @@ -399,7 +399,7 @@ srv_events_patyear <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -415,7 +415,7 @@ srv_events_patyear <- function(id, session, "input_time_unit", choices = choices, - selected = shiny::restoreInput(ns("input_time_unit"), choices[1]) + selected = restoreInput(ns("input_time_unit"), choices[1]) ) } }) diff --git a/R/tm_t_events_summary.R b/R/tm_t_events_summary.R index b420f7c6d5..5298cfc1fd 100644 --- a/R/tm_t_events_summary.R +++ b/R/tm_t_events_summary.R @@ -807,7 +807,7 @@ srv_t_events_summary <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { data_extract_vars <- list( diff --git a/R/tm_t_exposure.R b/R/tm_t_exposure.R index f8e8116686..d09376351c 100644 --- a/R/tm_t_exposure.R +++ b/R/tm_t_exposure.R @@ -484,7 +484,7 @@ srv_t_exposure <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { rule_intersection <- function(other) { function(value) { diff --git a/R/tm_t_logistic.R b/R/tm_t_logistic.R index f01c1a8d9c..6500355656 100644 --- a/R/tm_t_logistic.R +++ b/R/tm_t_logistic.R @@ -448,7 +448,7 @@ srv_t_logistic <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -556,7 +556,7 @@ srv_t_logistic <- function(id, updateSelectInput( session, "responders", choices = responder_choices, - selected = shiny::restoreInput(ns("responders"), responder_sel) + selected = restoreInput(ns("responders"), responder_sel) ) }) @@ -634,7 +634,7 @@ srv_t_logistic <- function(id, } else { c(sum(arm_n[unlist(input$buckets$Ref)]), arm_n[unlist(input$buckets$Comp)]) } - validate(shiny::need( + validate(need( all(anl_arm_n >= 2), "Each treatment group should have at least 2 records." )) diff --git a/R/tm_t_mult_events.R b/R/tm_t_mult_events.R index 15c41951db..aa09a1220e 100644 --- a/R/tm_t_mult_events.R +++ b/R/tm_t_mult_events.R @@ -477,7 +477,7 @@ srv_t_mult_events_byterm <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_pp_basic_info.R b/R/tm_t_pp_basic_info.R index 60bf03b070..73396962d9 100644 --- a/R/tm_t_pp_basic_info.R +++ b/R/tm_t_pp_basic_info.R @@ -178,7 +178,7 @@ srv_t_basic_info <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -191,7 +191,7 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -200,7 +200,7 @@ srv_t_basic_info <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_pp_laboratory.R b/R/tm_t_pp_laboratory.R index 3eee3dbfe4..ed99664fa4 100644 --- a/R/tm_t_pp_laboratory.R +++ b/R/tm_t_pp_laboratory.R @@ -374,7 +374,7 @@ srv_g_laboratory <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -387,7 +387,7 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -396,7 +396,7 @@ srv_g_laboratory <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() @@ -418,7 +418,7 @@ srv_g_laboratory <- function(id, session, "round_value", choices = seq(0, max_decimal), - selected = shiny::restoreInput(ns("round_value"), min(4, max_decimal)) + selected = restoreInput(ns("round_value"), min(4, max_decimal)) ) # Laboratory values tab ---- diff --git a/R/tm_t_pp_medical_history.R b/R/tm_t_pp_medical_history.R index 062396be9e..a236a51bb8 100644 --- a/R/tm_t_pp_medical_history.R +++ b/R/tm_t_pp_medical_history.R @@ -242,7 +242,7 @@ srv_t_medical_history <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -254,7 +254,7 @@ srv_t_medical_history <- function(id, teal.widgets::updateOptionalSelectInput( session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -263,7 +263,7 @@ srv_t_medical_history <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_pp_prior_medication.R b/R/tm_t_pp_prior_medication.R index d275ee2654..a60f18dc34 100644 --- a/R/tm_t_pp_prior_medication.R +++ b/R/tm_t_pp_prior_medication.R @@ -240,7 +240,7 @@ srv_t_prior_medication <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -275,7 +275,7 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput(ns("patient_id"), patient_data_base()[1]) + selected = restoreInput(ns("patient_id"), patient_data_base()[1]) ) observeEvent(patient_data_base(), @@ -284,7 +284,7 @@ srv_t_prior_medication <- function(id, session, "patient_id", choices = patient_data_base(), - selected = shiny::restoreInput( + selected = restoreInput( ns("patient_id"), if (length(patient_data_base()) == 1) { patient_data_base() diff --git a/R/tm_t_shift_by_arm.R b/R/tm_t_shift_by_arm.R index 1d22dd4ad0..be035709f9 100644 --- a/R/tm_t_shift_by_arm.R +++ b/R/tm_t_shift_by_arm.R @@ -435,7 +435,7 @@ srv_shift_by_arm <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -467,7 +467,7 @@ srv_shift_by_arm <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) + selected = restoreInput(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_shift_by_arm_by_worst.R b/R/tm_t_shift_by_arm_by_worst.R index 89b676b887..9103587d1e 100644 --- a/R/tm_t_shift_by_arm_by_worst.R +++ b/R/tm_t_shift_by_arm_by_worst.R @@ -455,7 +455,7 @@ srv_shift_by_arm_by_worst <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { ns <- session$ns @@ -487,7 +487,7 @@ srv_shift_by_arm_by_worst <- function(id, session = session, inputId = "treatment_flag", choices = resolved$choices, - selected = shiny::restoreInput(ns("treatment_flag"), resolved$selected) + selected = restoreInput(ns("treatment_flag"), resolved$selected) ) }) diff --git a/R/tm_t_shift_by_grade.R b/R/tm_t_shift_by_grade.R index ce05337039..1781af938c 100644 --- a/R/tm_t_shift_by_grade.R +++ b/R/tm_t_shift_by_grade.R @@ -752,7 +752,7 @@ srv_t_shift_by_grade <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( diff --git a/R/tm_t_smq.R b/R/tm_t_smq.R index d7fc866057..0e4e084555 100644 --- a/R/tm_t_smq.R +++ b/R/tm_t_smq.R @@ -542,7 +542,7 @@ srv_t_smq <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list( diff --git a/R/tm_t_summary.R b/R/tm_t_summary.R index 326556afc6..a09420cc4c 100644 --- a/R/tm_t_summary.R +++ b/R/tm_t_summary.R @@ -403,7 +403,7 @@ srv_summary <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { selector_list <- teal.transform::data_extract_multiple_srv( data_extract = list(arm_var = arm_var, summarize_vars = summarize_vars), diff --git a/R/tm_t_summary_by.R b/R/tm_t_summary_by.R index 3d1b4fda7e..cd8f979395 100644 --- a/R/tm_t_summary_by.R +++ b/R/tm_t_summary_by.R @@ -596,7 +596,7 @@ srv_summary_by <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { vars <- list(arm_var = arm_var, id_var = id_var, summarize_vars = summarize_vars, by_vars = by_vars) @@ -673,7 +673,7 @@ srv_summary_by <- function(id, ) if (input$parallel_vars) { - validate(shiny::need( + validate(need( all(vapply(anl_filtered[input_summarize_vars], is.numeric, logical(1))), "Summarize variables must all be numeric to display in parallel columns." )) diff --git a/R/tm_t_tte.R b/R/tm_t_tte.R index e4fc6f5b91..b444c913f0 100644 --- a/R/tm_t_tte.R +++ b/R/tm_t_tte.R @@ -753,7 +753,7 @@ srv_t_tte <- function(id, with_reporter <- !missing(reporter) && inherits(reporter, "Reporter") with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI") checkmate::assert_class(data, "reactive") - checkmate::assert_class(shiny::isolate(data()), "teal_data") + checkmate::assert_class(isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { # Setup arm variable selection, default reference arms, and default # comparison arms for encoding panel @@ -885,7 +885,7 @@ srv_t_tte <- function(id, do.call(what = "validate_standard_inputs", validate_args) # check that there is at least one record with no missing data - validate(shiny::need( + validate(need( !all(is.na(anl[[input_aval_var]])), "ANCOVA table cannot be calculated as all values are missing." )) diff --git a/R/validate_standard_inputs.R b/R/validate_standard_inputs.R index 9d70e60d9c..467a7ca5d0 100644 --- a/R/validate_standard_inputs.R +++ b/R/validate_standard_inputs.R @@ -76,7 +76,7 @@ validate_standard_inputs <- function(adsl, #' @keywords internal #' validate_arm <- function(arm_vec) { - validate(shiny::need(is.factor(arm_vec), "Treatment variable is not a factor")) + validate(need(is.factor(arm_vec), "Treatment variable is not a factor")) validate( need( all(trimws(levels(arm_vec)) != ""), From 4c4b07c69572123801092eff9363b1be7f4d6c93 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 10:14:47 +0100 Subject: [PATCH 08/27] bookmarkable flag: tm_g_barchart_simple --- R/tm_g_barchart_simple.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/tm_g_barchart_simple.R b/R/tm_g_barchart_simple.R index 7761c364c4..14ca4ef4da 100644 --- a/R/tm_g_barchart_simple.R +++ b/R/tm_g_barchart_simple.R @@ -174,7 +174,7 @@ tm_g_barchart_simple <- function(x = NULL, ) ui_args <- as.list(environment()) - module( + ans <- module( label = label, server = srv_g_barchart_simple, ui = ui_g_barchart_simple, @@ -190,6 +190,8 @@ tm_g_barchart_simple <- function(x = NULL, ), datanames = "all" ) + attr(ans, "teal_bookmarkable") <- TRUE + ans } #' @keywords internal From 3f748ce9362ec4f9c3c0c2b49b8fc0e2897420da Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 10:17:27 +0100 Subject: [PATCH 09/27] bookmarkable flag: tm_g_ci --- R/tm_g_ci.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/tm_g_ci.R b/R/tm_g_ci.R index a13d089689..34393f28bf 100644 --- a/R/tm_g_ci.R +++ b/R/tm_g_ci.R @@ -295,7 +295,7 @@ tm_g_ci <- function(label, args <- as.list(environment()) - module( + ans <- module( label = label, server = srv_g_ci, server_args = list( @@ -311,6 +311,8 @@ tm_g_ci <- function(label, ui_args = args, datanames = "all" ) + attr(ans, "teal_bookmarkable") <- TRUE + ans } #' @keywords internal From c4833c5feca79d66313ee63779aed0231ecddbf0 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 10:19:00 +0100 Subject: [PATCH 10/27] bookmarkable flag: tm_a_gee --- R/tm_a_gee.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/tm_a_gee.R b/R/tm_a_gee.R index e833b74f32..b281ca2ad2 100644 --- a/R/tm_a_gee.R +++ b/R/tm_a_gee.R @@ -228,7 +228,7 @@ tm_a_gee <- function(label, aval_var = cs_to_des_select(aval_var, dataname = dataname) ) - teal::module( + ans <- teal::module( label = label, server = srv_gee, ui = ui_gee, @@ -245,6 +245,8 @@ tm_a_gee <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- FALSE + ans } ui_gee <- function(id, ...) { From 9a66b78600051c461f8aefd99ec6a48b3d7a6e72 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 10:26:11 +0100 Subject: [PATCH 11/27] empty teal bookmarkable flags in all unverified modules --- R/tm_a_mmrm.R | 4 +++- R/tm_g_forest_rsp.R | 4 +++- R/tm_g_forest_tte.R | 4 +++- R/tm_g_ipp.R | 4 +++- R/tm_g_km.R | 4 +++- R/tm_g_lineplot.R | 4 +++- R/tm_g_pp_adverse_events.R | 4 +++- R/tm_g_pp_patient_timeline.R | 4 +++- R/tm_g_pp_therapy.R | 4 +++- R/tm_g_pp_vitals.R | 4 +++- R/tm_t_abnormality.R | 4 +++- R/tm_t_abnormality_by_worst_grade.R | 4 +++- R/tm_t_ancova.R | 4 +++- R/tm_t_binary_outcome.R | 4 +++- R/tm_t_coxreg.R | 4 +++- R/tm_t_events.R | 4 +++- R/tm_t_events_by_grade.R | 4 +++- R/tm_t_events_patyear.R | 4 +++- R/tm_t_events_summary.R | 4 +++- R/tm_t_exposure.R | 4 +++- R/tm_t_logistic.R | 4 +++- R/tm_t_mult_events.R | 4 +++- R/tm_t_pp_basic_info.R | 4 +++- R/tm_t_pp_laboratory.R | 4 +++- R/tm_t_pp_medical_history.R | 4 +++- R/tm_t_pp_prior_medication.R | 4 +++- R/tm_t_shift_by_arm.R | 4 +++- R/tm_t_shift_by_arm_by_worst.R | 4 +++- R/tm_t_shift_by_grade.R | 4 +++- R/tm_t_smq.R | 4 +++- R/tm_t_summary.R | 4 +++- R/tm_t_summary_by.R | 4 +++- R/tm_t_tte.R | 4 +++- 33 files changed, 99 insertions(+), 33 deletions(-) diff --git a/R/tm_a_mmrm.R b/R/tm_a_mmrm.R index f3e8bcfa0f..3b81e053ad 100644 --- a/R/tm_a_mmrm.R +++ b/R/tm_a_mmrm.R @@ -579,7 +579,7 @@ tm_a_mmrm <- function(label, aval_var = cs_to_des_select(aval_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_mmrm, ui = ui_mmrm, @@ -600,6 +600,8 @@ tm_a_mmrm <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index 8018c594ff..5620ec94ba 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -368,7 +368,7 @@ tm_g_forest_rsp <- function(label, strata_var = cs_to_des_select(strata_var, dataname = parentname, multiple = TRUE) ) - module( + ans <- module( label = label, ui = ui_g_forest_rsp, ui_args = c(data_extract_list, args), @@ -388,6 +388,8 @@ tm_g_forest_rsp <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_forest_tte.R b/R/tm_g_forest_tte.R index 14dfc35d0b..06fadc2082 100644 --- a/R/tm_g_forest_tte.R +++ b/R/tm_g_forest_tte.R @@ -351,7 +351,7 @@ tm_g_forest_tte <- function(label, time_unit_var = cs_to_des_select(time_unit_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_g_forest_tte, ui = ui_g_forest_tte, @@ -369,6 +369,8 @@ tm_g_forest_tte <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_ipp.R b/R/tm_g_ipp.R index 598fa913ac..85ede27afb 100644 --- a/R/tm_g_ipp.R +++ b/R/tm_g_ipp.R @@ -337,7 +337,7 @@ tm_g_ipp <- function(label, paramcd = cs_to_des_filter(paramcd, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_g_ipp, ui = ui_g_ipp, @@ -355,6 +355,8 @@ tm_g_ipp <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_km.R b/R/tm_g_km.R index 2fe84400f4..045ab9fce8 100644 --- a/R/tm_g_km.R +++ b/R/tm_g_km.R @@ -360,7 +360,7 @@ tm_g_km <- function(label, time_unit_var = cs_to_des_select(time_unit_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_g_km, ui = ui_g_km, @@ -378,6 +378,8 @@ tm_g_km <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_lineplot.R b/R/tm_g_lineplot.R index 807a66113b..613b2e942d 100644 --- a/R/tm_g_lineplot.R +++ b/R/tm_g_lineplot.R @@ -317,7 +317,7 @@ tm_g_lineplot <- function(label, paramcd = cs_to_des_select(paramcd, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_g_lineplot, ui = ui_g_lineplot, @@ -335,6 +335,8 @@ tm_g_lineplot <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 11f2004f96..3b55de63a7 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -295,7 +295,7 @@ tm_g_pp_adverse_events <- function(label, decod = `if`(is.null(decod), NULL, cs_to_des_select(decod, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_g_adverse_events, ui_args = c(data_extract_list, args), @@ -314,6 +314,8 @@ tm_g_pp_adverse_events <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index a26c533e26..f6cba6a74e 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -522,7 +522,7 @@ tm_g_pp_patient_timeline <- function(label, dsrelday_end = `if`(is.null(dsrelday_end), NULL, cs_to_des_select(dsrelday_end, dataname = dataname_adcm)) ) - module( + ans <- module( label = label, ui = ui_g_patient_timeline, ui_args = c(data_extract_list, args), @@ -542,6 +542,8 @@ tm_g_pp_patient_timeline <- function(label, ), datanames = c(dataname_adcm, dataname_adae, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index 83ead79c67..09aaabbe5e 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -390,7 +390,7 @@ tm_g_pp_therapy <- function(label, cmendy = `if`(is.null(cmendy), NULL, cs_to_des_select(cmendy, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_g_therapy, ui_args = c(data_extract_list, args), @@ -409,6 +409,8 @@ tm_g_pp_therapy <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index d045942586..9e7f9831c7 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -309,7 +309,7 @@ tm_g_pp_vitals <- function(label, xaxis = `if`(is.null(xaxis), NULL, cs_to_des_select(xaxis, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_g_vitals, ui_args = c(data_extract_list, args), @@ -328,6 +328,8 @@ tm_g_pp_vitals <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index 34ac515da0..cd83d1a2e2 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -359,7 +359,7 @@ tm_t_abnormality <- function(label, args <- as.list(environment()) - module( + ans <- module( label = label, ui = ui_t_abnormality, server = srv_t_abnormality, @@ -379,6 +379,8 @@ tm_t_abnormality <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 2febb68631..6742f1d1f7 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -362,7 +362,7 @@ tm_t_abnormality_by_worst_grade <- function(label, # nolint: object_length. args <- as.list(environment()) - module( + ans <- module( label = label, ui = ui_t_abnormality_by_worst_grade, server = srv_t_abnormality_by_worst_grade, @@ -380,6 +380,8 @@ tm_t_abnormality_by_worst_grade <- function(label, # nolint: object_length. ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index 460d33abf6..c9aacedc17 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -549,7 +549,7 @@ tm_t_ancova <- function(label, interact_var = cs_to_des_select(interact_var, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_ancova, ui_args = c(data_extract_list, args), @@ -567,6 +567,8 @@ tm_t_ancova <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index 9d2153eb5b..509586ec4c 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -475,7 +475,7 @@ tm_t_binary_outcome <- function(label, strata_var = cs_to_des_select(strata_var, dataname = parentname, multiple = TRUE) ) - module( + ans <- module( label = label, ui = ui_t_binary_outcome, ui_args = c(data_extract_list, args), @@ -496,6 +496,8 @@ tm_t_binary_outcome <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_coxreg.R b/R/tm_t_coxreg.R index ea2ce1ac6c..53245cca33 100644 --- a/R/tm_t_coxreg.R +++ b/R/tm_t_coxreg.R @@ -537,7 +537,7 @@ tm_t_coxreg <- function(label, cov_var = cs_to_des_select(cov_var, dataname = parentname, multiple = TRUE, ordered = TRUE) ) - module( + ans <- module( label = label, server = srv_t_coxreg, ui = ui_t_coxreg, @@ -555,6 +555,8 @@ tm_t_coxreg <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_events.R b/R/tm_t_events.R index 45ffc231b0..7fd98cda57 100644 --- a/R/tm_t_events.R +++ b/R/tm_t_events.R @@ -549,7 +549,7 @@ tm_t_events <- function(label, llt = cs_to_des_select(llt, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_t_events_byterm, server = srv_t_events_byterm, @@ -570,6 +570,8 @@ tm_t_events <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_events_by_grade.R b/R/tm_t_events_by_grade.R index c4b8271c16..b280bf40a4 100644 --- a/R/tm_t_events_by_grade.R +++ b/R/tm_t_events_by_grade.R @@ -890,7 +890,7 @@ tm_t_events_by_grade <- function(label, grade = cs_to_des_select(grade, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_t_events_by_grade, ui = ui_t_events_by_grade, @@ -909,6 +909,8 @@ tm_t_events_by_grade <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_events_patyear.R b/R/tm_t_events_patyear.R index ba3bbfe7b3..f0982363be 100644 --- a/R/tm_t_events_patyear.R +++ b/R/tm_t_events_patyear.R @@ -260,7 +260,7 @@ tm_t_events_patyear <- function(label, events_var = cs_to_des_select(events_var, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_events_patyear, ui_args = c(data_extract_list, args), @@ -278,6 +278,8 @@ tm_t_events_patyear <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_events_summary.R b/R/tm_t_events_summary.R index 5298cfc1fd..e3b05816c4 100644 --- a/R/tm_t_events_summary.R +++ b/R/tm_t_events_summary.R @@ -655,7 +655,7 @@ tm_t_events_summary <- function(label, llt = cs_to_des_select(llt, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_t_events_summary, ui_args = c(data_extract_list, args), @@ -673,6 +673,8 @@ tm_t_events_summary <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_exposure.R b/R/tm_t_exposure.R index d09376351c..d37746a1aa 100644 --- a/R/tm_t_exposure.R +++ b/R/tm_t_exposure.R @@ -354,7 +354,7 @@ tm_t_exposure <- function(label, ) args <- as.list(environment()) - module( + ans <- module( label = label, ui = ui_t_exposure, server = srv_t_exposure, @@ -374,6 +374,8 @@ tm_t_exposure <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } diff --git a/R/tm_t_logistic.R b/R/tm_t_logistic.R index 6500355656..7be74beea7 100644 --- a/R/tm_t_logistic.R +++ b/R/tm_t_logistic.R @@ -317,7 +317,7 @@ tm_t_logistic <- function(label, avalc_var = cs_to_des_select(avalc_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_t_logistic, ui = ui_t_logistic, @@ -334,6 +334,8 @@ tm_t_logistic <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_mult_events.R b/R/tm_t_mult_events.R index aa09a1220e..b5b8f69567 100644 --- a/R/tm_t_mult_events.R +++ b/R/tm_t_mult_events.R @@ -370,7 +370,7 @@ tm_t_mult_events <- function(label, llt = cs_to_des_select(llt, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_t_mult_events_byterm, server = srv_t_mult_events_byterm, @@ -389,6 +389,8 @@ tm_t_mult_events <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_pp_basic_info.R b/R/tm_t_pp_basic_info.R index 73396962d9..a0f005482a 100644 --- a/R/tm_t_pp_basic_info.R +++ b/R/tm_t_pp_basic_info.R @@ -110,7 +110,7 @@ tm_t_pp_basic_info <- function(label, vars = `if`(is.null(vars), NULL, cs_to_des_select(vars, dataname = dataname, multiple = TRUE)) ) - module( + ans <- module( label = label, ui = ui_t_basic_info, ui_args = c(data_extract_list, args), @@ -125,6 +125,8 @@ tm_t_pp_basic_info <- function(label, ), datanames = dataname ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_pp_laboratory.R b/R/tm_t_pp_laboratory.R index ed99664fa4..f69388a29a 100644 --- a/R/tm_t_pp_laboratory.R +++ b/R/tm_t_pp_laboratory.R @@ -257,7 +257,7 @@ tm_t_pp_laboratory <- function(label, anrind = `if`(is.null(anrind), NULL, cs_to_des_select(anrind, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_g_laboratory, ui_args = c(data_extract_list, args), @@ -273,6 +273,8 @@ tm_t_pp_laboratory <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_pp_medical_history.R b/R/tm_t_pp_medical_history.R index a236a51bb8..fef34d19d4 100644 --- a/R/tm_t_pp_medical_history.R +++ b/R/tm_t_pp_medical_history.R @@ -155,7 +155,7 @@ tm_t_pp_medical_history <- function(label, mhdistat = `if`(is.null(mhdistat), NULL, cs_to_des_select(mhdistat, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_t_medical_history, ui_args = c(data_extract_list, args), @@ -171,6 +171,8 @@ tm_t_pp_medical_history <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_pp_prior_medication.R b/R/tm_t_pp_prior_medication.R index a60f18dc34..836e72964b 100644 --- a/R/tm_t_pp_prior_medication.R +++ b/R/tm_t_pp_prior_medication.R @@ -145,7 +145,7 @@ tm_t_pp_prior_medication <- function(label, cmstdy = `if`(is.null(cmstdy), NULL, cs_to_des_select(cmstdy, dataname = dataname)) ) - module( + ans <- module( label = label, ui = ui_t_prior_medication, ui_args = c(data_extract_list, args), @@ -161,6 +161,8 @@ tm_t_pp_prior_medication <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_shift_by_arm.R b/R/tm_t_shift_by_arm.R index be035709f9..8ecaeabc00 100644 --- a/R/tm_t_shift_by_arm.R +++ b/R/tm_t_shift_by_arm.R @@ -302,7 +302,7 @@ tm_t_shift_by_arm <- function(label, baseline_var = cs_to_des_select(baseline_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_shift_by_arm, ui = ui_shift_by_arm, @@ -321,6 +321,8 @@ tm_t_shift_by_arm <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_shift_by_arm_by_worst.R b/R/tm_t_shift_by_arm_by_worst.R index 9103587d1e..f71dccd372 100644 --- a/R/tm_t_shift_by_arm_by_worst.R +++ b/R/tm_t_shift_by_arm_by_worst.R @@ -314,7 +314,7 @@ tm_t_shift_by_arm_by_worst <- function(label, ) - module( + ans <- module( label = label, server = srv_shift_by_arm_by_worst, ui = ui_shift_by_arm_by_worst, @@ -333,6 +333,8 @@ tm_t_shift_by_arm_by_worst <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_shift_by_grade.R b/R/tm_t_shift_by_grade.R index 1781af938c..177006a48d 100644 --- a/R/tm_t_shift_by_grade.R +++ b/R/tm_t_shift_by_grade.R @@ -602,7 +602,7 @@ tm_t_shift_by_grade <- function(label, base_toxgrade_var = cs_to_des_select(base_toxgrade_var, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_t_shift_by_grade, server = srv_t_shift_by_grade, @@ -620,6 +620,8 @@ tm_t_shift_by_grade <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_smq.R b/R/tm_t_smq.R index 0e4e084555..5f7b117e4a 100644 --- a/R/tm_t_smq.R +++ b/R/tm_t_smq.R @@ -416,7 +416,7 @@ tm_t_smq <- function(label, llt = cs_to_des_select(llt, dataname = dataname) ) - module( + ans <- module( label = label, ui = ui_t_smq, server = srv_t_smq, @@ -434,6 +434,8 @@ tm_t_smq <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_summary.R b/R/tm_t_summary.R index a09420cc4c..fb4b6ca433 100644 --- a/R/tm_t_summary.R +++ b/R/tm_t_summary.R @@ -280,7 +280,7 @@ tm_t_summary <- function(label, summarize_vars = cs_to_des_select(summarize_vars, dataname = dataname, multiple = TRUE, ordered = TRUE) ) - module( + ans <- module( label = label, server = srv_summary, ui = ui_summary, @@ -298,6 +298,8 @@ tm_t_summary <- function(label, ), datanames = c(dataname, parentname) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_summary_by.R b/R/tm_t_summary_by.R index cd8f979395..f976084972 100644 --- a/R/tm_t_summary_by.R +++ b/R/tm_t_summary_by.R @@ -433,7 +433,7 @@ tm_t_summary_by <- function(label, summarize_vars = cs_to_des_select(summarize_vars, dataname = dataname, multiple = TRUE, ordered = TRUE) ) - module( + ans <- module( label = label, ui = ui_summary_by, ui_args = c(data_extract_list, args), @@ -451,6 +451,8 @@ tm_t_summary_by <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal diff --git a/R/tm_t_tte.R b/R/tm_t_tte.R index b444c913f0..20beb88746 100644 --- a/R/tm_t_tte.R +++ b/R/tm_t_tte.R @@ -521,7 +521,7 @@ tm_t_tte <- function(label, time_unit_var = cs_to_des_select(time_unit_var, dataname = dataname) ) - module( + ans <- module( label = label, server = srv_t_tte, ui = ui_t_tte, @@ -540,6 +540,8 @@ tm_t_tte <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + attr(ans, "teal_bookmarkable") <- NULL + ans } #' @keywords internal From af65edcbfa923d55a2309c5ddda64be236f0be64 Mon Sep 17 00:00:00 2001 From: "27856297+dependabot-preview[bot]@users.noreply.github.com" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 09:31:26 +0000 Subject: [PATCH 12/27] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/template_g_km.Rd | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/man/template_g_km.Rd b/man/template_g_km.Rd index 514acfc6f0..b7dd855ceb 100644 --- a/man/template_g_km.Rd +++ b/man/template_g_km.Rd @@ -49,9 +49,9 @@ template_g_km( \item{cnsr_var}{(\code{character})\cr name of the censoring variable.} -\item{xticks}{(\code{numeric}, \code{number}, or \code{NULL})\cr numeric vector of ticks or single number with spacing -between ticks on the x axis. If \code{NULL} (default), \code{\link[labeling:extended]{labeling::extended()}} is used to determine -an optimal tick position on the x axis.} +\item{xticks}{(\code{numeric}, \code{number}, or \code{NULL})\cr numeric vector of tick positions or single number with spacing +between ticks on the x-axis. If \code{NULL} (default), \code{\link[labeling:extended]{labeling::extended()}} is used to determine +optimal tick positions on the x-axis.} \item{strata_var}{(\code{character})\cr names of the variables for stratified analysis.} @@ -66,11 +66,12 @@ an optimal tick position on the x axis.} \item{ties}{(\code{string})\cr among \code{exact} (equivalent to \code{DISCRETE} in SAS), \code{efron} and \code{breslow}, see \code{\link[survival:coxph]{survival::coxph()}}. Note: there is no equivalent of SAS \code{EXACT} method in R.} -\item{xlab}{(\code{string})\cr label of x-axis.} +\item{xlab}{(\code{string})\cr x-axis label.} \item{time_unit_var}{(\code{character})\cr name of the variable representing time units.} -\item{yval}{(\code{string})\cr value of y-axis. Options are \code{Survival} (default) and \code{Failure} probability.} +\item{yval}{(\code{string})\cr type of plot, to be plotted on the y-axis. Options are \code{Survival} (default) and \code{Failure} +probability.} \item{pval_method}{(\code{string})\cr the method used for estimation of p.values; \code{wald} (default) or \code{likelihood}.} @@ -79,13 +80,13 @@ median survival time per group.} \item{annot_coxph}{(\code{flag})\cr add the annotation table from a \code{\link[survival:coxph]{survival::coxph()}} model.} -\item{position_coxph}{(\code{numeric})\cr x and y positions for plotting \code{\link[survival:coxph]{survival::coxph()}} model.} +\item{position_coxph}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Please use the \code{x} and \code{y} elements of +\code{control_annot_coxph} instead.} -\item{width_annots}{(named \code{list} of \code{unit}s)\cr a named list of widths for annotation tables with names \code{surv_med} -(median survival time table) and \code{coxph} (\code{\link[survival:coxph]{survival::coxph()}} model table), where each value is the width -(in units) to implement when printing the annotation table.} +\item{width_annots}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Please use the \code{w} element of \code{control_annot_surv_med} +(for surv_med) and \code{control_annot_coxph} (for coxph)."} -\item{ci_ribbon}{(\code{flag})\cr draw the confidence interval around the Kaplan-Meier curve.} +\item{ci_ribbon}{(\code{flag})\cr whether the confidence interval should be drawn around the Kaplan-Meier curve.} \item{title}{(\code{character})\cr title of the output.} } From 403b09dbdee7aa4f8de9b696dca6d7400e62744f Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:04:59 +0100 Subject: [PATCH 13/27] bookmarkable flag: tm_g_forest_rsp --- R/tm_g_forest_rsp.R | 85 ++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index 5620ec94ba..80e0e380aa 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -388,7 +388,8 @@ tm_g_forest_rsp <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + # not bookmarkable b/c of arm_ref_comp_observer using teal.wigdets::draggable_buckets and JS therein + attr(ans, "teal_bookmarkable") <- FALSE ans } @@ -419,13 +420,7 @@ ui_g_forest_rsp <- function(id, ...) { data_extract_spec = a$aval_var, is_single_dataset = is_single_dataset_value ), - selectInput( - ns("responders"), - "Responders", - choices = c("CR", "PR"), - selected = c("CR", "PR"), - multiple = TRUE - ), + uiOutput(ns("container_responders")), teal.transform::data_extract_ui( id = ns("arm_var"), label = "Select Treatment Variable", @@ -571,52 +566,48 @@ srv_g_forest_rsp <- function(id, teal.code::eval_code(code = as.expression(adsl_inputs()$expr)) }) - observeEvent( - eventExpr = c( - input[[extract_input("aval_var", "ADRS")]], - input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]] - ), - handlerExpr = { - req(anl_q()) - anl <- anl_q()[["ANL"]] - aval_var <- anl_inputs()$columns_source$aval_var - paramcd_level <- unlist(anl_inputs()$filter_info$paramcd[[1]]$selected) - if (length(paramcd_level) == 0) { - return(NULL) - } + output$container_responders <- renderUI({ + req(anl_q()) - sel_param <- if (is.list(default_responses)) { - default_responses[[paramcd_level]] - } else { - default_responses - } + anl <- anl_q()[["ANL"]] + aval_var <- anl_inputs()$columns_source$aval_var + paramcd_level <- unlist(anl_inputs()$filter_info$paramcd[[1]]$selected) + req(length(paramcd_level) != 0) - common_rsp <- if (is.list(sel_param)) { - sel_param$rsp - } else { - sel_param - } - responder_choices <- if (length(aval_var) == 0) { - character(0) - } else { - if ("levels" %in% names(sel_param)) { - if (length(intersect(unique(anl[[aval_var]]), sel_param$levels)) > 1) { - sel_param$levels - } else { - union(anl[[aval_var]], sel_param$levels) - } + sel_param <- if (is.list(default_responses)) { + default_responses[[paramcd_level]] + } else { + default_responses + } + + common_rsp <- if (is.list(sel_param)) { + sel_param$rsp + } else { + sel_param + } + responder_choices <- if (length(aval_var) == 0) { + character(0) + } else { + if ("levels" %in% names(sel_param)) { + if (length(intersect(unique(anl[[aval_var]]), sel_param$levels)) > 1) { + sel_param$levels } else { - unique(anl[[aval_var]]) + union(anl[[aval_var]], sel_param$levels) } + } else { + unique(anl[[aval_var]]) } - updateSelectInput( - session, "responders", - choices = responder_choices, - selected = restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) - ) } - ) + + selectInput( + ns("responders"), + "Responders", + choices = responder_choices, + selected = intersect(responder_choices, common_rsp), + multiple = TRUE + ) + }) # Prepare the analysis environment (filter data, check data, populate envir). validate_checks <- reactive({ From 7240d08ea3b96e8cf0b86a32b13bea50d465dc26 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:42:52 +0100 Subject: [PATCH 14/27] bookmarkable flag: tm_g_forest_tte --- R/tm_g_forest_tte.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/tm_g_forest_tte.R b/R/tm_g_forest_tte.R index 06fadc2082..a6c576a79b 100644 --- a/R/tm_g_forest_tte.R +++ b/R/tm_g_forest_tte.R @@ -369,6 +369,8 @@ tm_g_forest_tte <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + # pending https://github.com/insightsengineering/teal.transform/issues/210 + # likely also https://github.com/insightsengineering/teal.widgets/issues/239 attr(ans, "teal_bookmarkable") <- NULL ans } From 9f2cf303ae5f786641c122e1c4defd9679be46ed Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:46:52 +0100 Subject: [PATCH 15/27] add comment --- R/tm_g_forest_rsp.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/tm_g_forest_rsp.R b/R/tm_g_forest_rsp.R index 80e0e380aa..6504a56a68 100644 --- a/R/tm_g_forest_rsp.R +++ b/R/tm_g_forest_rsp.R @@ -389,6 +389,7 @@ tm_g_forest_rsp <- function(label, datanames = teal.transform::get_extract_datanames(data_extract_list) ) # not bookmarkable b/c of arm_ref_comp_observer using teal.wigdets::draggable_buckets and JS therein + # https://github.com/insightsengineering/teal.widgets/issues/239 attr(ans, "teal_bookmarkable") <- FALSE ans } From 0f9962eda44041543638c2a92a42a845e13b1471 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:50:03 +0100 Subject: [PATCH 16/27] bookmarkable flag: tm_g_ipp --- R/tm_g_ipp.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_g_ipp.R b/R/tm_g_ipp.R index 85ede27afb..3834170205 100644 --- a/R/tm_g_ipp.R +++ b/R/tm_g_ipp.R @@ -355,7 +355,7 @@ tm_g_ipp <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + attr(ans, "teal_bookmarkable") <- FALSE ans } From 71dbc6809391f18a4c44f83f49db9280ee17c8e1 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:53:02 +0100 Subject: [PATCH 17/27] bookmarkable flag: tm_g_km --- R/tm_g_km.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/tm_g_km.R b/R/tm_g_km.R index 045ab9fce8..05d9f7316f 100644 --- a/R/tm_g_km.R +++ b/R/tm_g_km.R @@ -378,6 +378,8 @@ tm_g_km <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + # pending https://github.com/insightsengineering/teal.transform/issues/210 + # likely also https://github.com/insightsengineering/teal.widgets/issues/239 attr(ans, "teal_bookmarkable") <- NULL ans } From 6dfabb4d59d9ea60cabaa145daaa5d1acf7d1efc Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 11:55:39 +0100 Subject: [PATCH 18/27] bookmarkable flag: tm_g_lineplot --- R/tm_g_lineplot.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/tm_g_lineplot.R b/R/tm_g_lineplot.R index 613b2e942d..04aa9ebef8 100644 --- a/R/tm_g_lineplot.R +++ b/R/tm_g_lineplot.R @@ -335,6 +335,7 @@ tm_g_lineplot <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) + # pending https://github.com/insightsengineering/teal.transform/issues/210 attr(ans, "teal_bookmarkable") <- NULL ans } From 2b1e1a72b55005331dde7860f33654807c53fd0c Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 12:08:30 +0100 Subject: [PATCH 19/27] bookmarkable flag: tm_g_pp_adverse_events --- R/tm_g_pp_adverse_events.R | 58 +++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 3b55de63a7..8abd94ff53 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -314,7 +314,8 @@ tm_g_pp_adverse_events <- function(label, ), datanames = c(dataname, parentname) ) - attr(ans, "teal_bookmarkable") <- NULL + # presence of data extracts in UI may cause bookmarking problems as in other modules + attr(ans, "teal_bookmarkable") <- TRUE ans } @@ -348,12 +349,7 @@ ui_g_adverse_events <- function(id, ...) { "aeterm", "tox_grade", "causality", "outcome", "action", "time", "decod" )]), - teal.widgets::optionalSelectInput( - ns("patient_id"), - "Select Patient:", - multiple = FALSE, - options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) - ), + uiOutput(ns("container_patient_id")), teal.transform::data_extract_ui( id = ns("aeterm"), label = "Select AETERM variable:", @@ -449,33 +445,31 @@ srv_g_adverse_events <- function(id, patient_id <- reactive(input$patient_id) - # Init patient_data_base <- reactive(unique(data()[[parentname]][[patient_col]])) - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput(ns("patient_id"), patient_data_base()[1]) - ) - observeEvent(patient_data_base(), - handlerExpr = { - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput( - ns("patient_id"), - if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } - ) - ) - }, - ignoreInit = TRUE - ) + output$container_patient_id <- renderUI({ + req(patient_data_base()) + + selected <- + if (!isTruthy(patient_id())) { + patient_data_base()[1L] + } else { + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + } + + teal.widgets::optionalSelectInput( + ns("patient_id"), + "Select Patient:", + choices = patient_data_base(), + selected = selected, + multiple = FALSE, + options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) + ) + }) # Adverse events tab ---- selector_list <- teal.transform::data_extract_multiple_srv( From a977bbeac8e46ee95fc6edb2877a405e1a302de0 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 12:28:45 +0100 Subject: [PATCH 20/27] bookmarkable flag: tm_g_pp_patient_timeline --- R/tm_g_pp_patient_timeline.R | 56 ++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index f6cba6a74e..50557e1cc6 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -542,6 +542,7 @@ tm_g_pp_patient_timeline <- function(label, ), datanames = c(dataname_adcm, dataname_adae, parentname) ) + # pending https://github.com/insightsengineering/teal.transform/issues/211 attr(ans, "teal_bookmarkable") <- NULL ans } @@ -577,12 +578,7 @@ ui_g_patient_timeline <- function(id, ...) { "aerelday_start", "aerelday_end", "dsrelday_start", "dsrelday_end" )] ), - teal.widgets::optionalSelectInput( - ns("patient_id"), - "Select Patient:", - multiple = FALSE, - options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) - ), + uiOutput(ns('container_patient_id')), teal.transform::data_extract_ui( id = ns("cmdecod"), label = "Select Medication standardized term variable:", @@ -720,33 +716,31 @@ srv_g_patient_timeline <- function(id, patient_id <- reactive(input$patient_id) - # Init patient_data_base <- reactive(unique(data()[[parentname]][[patient_col]])) - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput(ns("patient_id"), patient_data_base()[1]) - ) - observeEvent(patient_data_base(), - handlerExpr = { - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput( - ns("patient_id"), - if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } - ) - ) - }, - ignoreInit = TRUE - ) + output$container_patient_id <- renderUI({ + req(patient_data_base()) + + selected <- + if (!isTruthy(patient_id())) { + patient_data_base()[1] + } else { + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + } + + teal.widgets::optionalSelectInput( + ns("patient_id"), + "Select Patient:", + multiple = FALSE, + choices = patient_data_base(), + selected = selected, + options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) + ) + }) # Patient timeline tab ---- check_box <- reactive(input$relday_x_axis) From 03424c1421615197602bd3f5d5bddb24f3a78863 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 13:09:02 +0100 Subject: [PATCH 21/27] bookmarkable flag: tm_g_pp_therapy --- R/tm_g_pp_therapy.R | 61 +++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index 09aaabbe5e..9540c97bf2 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -409,7 +409,8 @@ tm_g_pp_therapy <- function(label, ), datanames = c(dataname, parentname) ) - attr(ans, "teal_bookmarkable") <- NULL + # presence of data extracts in UI may cause bookmarking problems as in other modules + attr(ans, "teal_bookmarkable") <- TRUE ans } @@ -446,12 +447,7 @@ ui_g_therapy <- function(id, ...) { "atirel", "cmdecod", "cmindc", "cmdose", "cmtrt", "cmdosu", "cmroute", "cmdosfrq", "cmstdy", "cmendy" )]), - teal.widgets::optionalSelectInput( - ns("patient_id"), - "Select Patient:", - multiple = FALSE, - options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) - ), + uiOutput(ns("container_patient_id")), teal.transform::data_extract_ui( id = ns("cmdecod"), label = "Select the medication decoding column:", @@ -563,34 +559,33 @@ srv_g_therapy <- function(id, moduleServer(id, function(input, output, session) { ns <- session$ns - patient_id <- reactive(input$patient_id) - - # Init patient_data_base <- reactive(unique(data()[[parentname]][[patient_col]])) - teal.widgets::updateOptionalSelectInput( - session, "patient_id", - choices = patient_data_base(), - selected = restoreInput(ns("patient_id"), patient_data_base()[1]) - ) - observeEvent(patient_data_base(), - handlerExpr = { - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput( - ns("patient_id"), - if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } - ) - ) - }, - ignoreInit = TRUE - ) + output$container_patient_id <- renderUI({ + req(patient_data_base()) + + selected <- + if (!isTruthy(patient_id())) { + patient_data_base()[1] + } else { + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + } + + teal.widgets::optionalSelectInput( + ns("patient_id"), + "Select Patient:", + choices = patient_data_base(), + selected = selected, + multiple = FALSE, + options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) + ) + }) + + patient_id <- reactive(input$patient_id) # Therapy tab ---- selector_list <- teal.transform::data_extract_multiple_srv( From c16cb20ba9c27d03075855f3d300a870fd44c01e Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 13:38:38 +0100 Subject: [PATCH 22/27] bookmarkable flag: tm_g_pp_vitals --- R/tm_g_pp_vitals.R | 61 +++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index 9e7f9831c7..4a5e0c4e0f 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -328,7 +328,8 @@ tm_g_pp_vitals <- function(label, ), datanames = c(dataname, parentname) ) - attr(ans, "teal_bookmarkable") <- NULL + # presence of data extracts in UI may cause bookmarking problems as in other modules + attr(ans, "teal_bookmarkable") <- TRUE ans } @@ -350,12 +351,7 @@ ui_g_vitals <- function(id, ...) { ### tags$label("Encodings", class = "text-primary"), teal.transform::datanames_input(ui_args[c("paramcd", "aval_var", "xaxis")]), - teal.widgets::optionalSelectInput( - ns("patient_id"), - "Select Patient:", - multiple = FALSE, - options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) - ), + uiOutput(ns("container_patient_id")), teal.transform::data_extract_ui( id = ns("paramcd"), label = "Select PARAMCD variable:", @@ -416,35 +412,34 @@ srv_g_vitals <- function(id, moduleServer(id, function(input, output, session) { ns <- session$ns - patient_id <- reactive(input$patient_id) - # Init patient_data_base <- reactive(unique(data()[[parentname]][[patient_col]])) - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput(ns("patient_id"), patient_data_base()[1]) - ) - observeEvent(patient_data_base(), - handlerExpr = { - teal.widgets::updateOptionalSelectInput( - session, - "patient_id", - choices = patient_data_base(), - selected = restoreInput( - ns("patient_id"), - if (length(patient_data_base()) == 1) { - patient_data_base() - } else { - intersect(patient_id(), patient_data_base()) - } - ) - ) - }, - ignoreInit = TRUE - ) + output$container_patient_id <- renderUI({ + req(patient_data_base()) + + selected <- + if (!isTruthy(patient_id())) { + patient_data_base()[1] + } else { + if (length(patient_data_base()) == 1) { + patient_data_base() + } else { + intersect(patient_id(), patient_data_base()) + } + } + + teal.widgets::optionalSelectInput( + ns("patient_id"), + "Select Patient:", + choices = patient_data_base(), + selected = selected, + multiple = FALSE, + options = shinyWidgets::pickerOptions(`liveSearch` = TRUE) + ) + }) + + patient_id <- reactive(input$patient_id) # Vitals tab ---- From 160feb0a5e8e68c40d328ffdb901cbd113038701 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 13:47:31 +0100 Subject: [PATCH 23/27] bookmarkable flag: tm_t_abnormality_by_worst_grade --- R/tm_t_abnormality_by_worst_grade.R | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/R/tm_t_abnormality_by_worst_grade.R b/R/tm_t_abnormality_by_worst_grade.R index 6742f1d1f7..a0469749a6 100644 --- a/R/tm_t_abnormality_by_worst_grade.R +++ b/R/tm_t_abnormality_by_worst_grade.R @@ -380,7 +380,8 @@ tm_t_abnormality_by_worst_grade <- function(label, # nolint: object_length. ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + # may be affected by https://github.com/insightsengineering/teal.widgets/issues/238 + attr(ans, "teal_bookmarkable") <- TRUE ans } @@ -458,12 +459,7 @@ ui_t_abnormality_by_worst_grade <- function(id, ...) { # nolint: object_length. data_extract_spec = a$id_var, is_single_dataset = is_single_dataset_value ), - teal.widgets::optionalSelectInput( - ns("worst_flag_indicator"), - label = "Value Indicating Worst Grade", - multiple = FALSE, - fixed_on_single = TRUE - ), + uiOutput(ns("container_worst_flag_indicator")), checkboxInput( ns("drop_arm_levels"), label = "Drop columns not in filtered analysis dataset", @@ -508,13 +504,17 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint: object_length. moduleServer(id, function(input, output, session) { ns <- session$ns - isolate({ - resolved <- teal.transform::resolve_delayed(worst_flag_indicator, as.list(data()@env)) - teal.widgets::updateOptionalSelectInput( - session = session, - inputId = "worst_flag_indicator", + + output$container_worst_flag_indicator <- renderUI({ + resolved <- isolate(teal.transform::resolve_delayed(worst_flag_indicator, as.list(data()@env))) + + teal.widgets::optionalSelectInput( + ns("worst_flag_indicator"), + label = "Value Indicating Worst Grade", choices = resolved$choices, - selected = restoreInput(ns("worst_flag_indicator"), resolved$selected) + selected = resolved$selected, + multiple = FALSE, + fixed_on_single = TRUE ) }) From d4e09707e04c5da47018663f13f58f3d6cf8aae7 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 14:05:28 +0100 Subject: [PATCH 24/27] bookmarkable flag: tm_t_abnormality --- R/tm_t_abnormality.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/tm_t_abnormality.R b/R/tm_t_abnormality.R index cd83d1a2e2..606ff9b491 100644 --- a/R/tm_t_abnormality.R +++ b/R/tm_t_abnormality.R @@ -379,7 +379,8 @@ tm_t_abnormality <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + # may be affected by https://github.com/insightsengineering/teal.widgets/issues/238 + attr(ans, "teal_bookmarkable") <- TRUE ans } From 2c69de5b6a49bb9e31f78fae19c9b8e55608d6d9 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 27 Mar 2024 15:05:29 +0100 Subject: [PATCH 25/27] bookmarkable flag: tm_t_binary_outcome --- R/tm_t_binary_outcome.R | 76 ++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index 509586ec4c..915c0d7f38 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -496,7 +496,8 @@ tm_t_binary_outcome <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + # pending https://github.com/insightsengineering/teal.widgets/issues/239 + attr(ans, "teal_bookmarkable") <- FALSE ans } @@ -525,13 +526,7 @@ ui_t_binary_outcome <- function(id, ...) { data_extract_spec = a$paramcd, is_single_dataset = is_single_dataset_value ), - selectInput( - ns("responders"), - "Responders", - choices = NULL, - selected = NULL, - multiple = TRUE - ), + uiOutput(ns("container_responders")), teal.transform::data_extract_ui( id = ns("arm_var"), label = "Select Treatment Variable", @@ -773,45 +768,42 @@ srv_t_binary_outcome <- function(id, teal.code::eval_code(as.expression(adsl_inputs()$expr)) }) - observeEvent( - c( - input[[extract_input("aval_var", "ADRS")]], - input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]] - ), - handlerExpr = { - anl <- anl_q()[["ANL"]] - aval_var <- anl_inputs()$columns_source$aval_var - paramcd <- input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]] - sel_param <- if (is.list(default_responses) && (!is.null(paramcd))) { - default_responses[[paramcd]] - } else { - default_responses - } - common_rsp <- if (is.list(sel_param)) { - sel_param$rsp - } else { - sel_param - } - responder_choices <- if (length(aval_var) == 0) { - character(0) - } else { - if ("levels" %in% names(sel_param)) { - if (length(intersect(unique(anl[[aval_var]]), sel_param$levels)) > 1) { - sel_param$levels - } else { - unique(anl[[aval_var]]) - } + output$container_responders <- renderUI({ + anl <- req(anl_q()[["ANL"]]) + aval_var <- req(anl_inputs()$columns_source$aval_var) + paramcd <- req(input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]) + sel_param <- if (is.list(default_responses) && (!is.null(paramcd))) { + default_responses[[paramcd]] + } else { + default_responses + } + common_rsp <- if (is.list(sel_param)) { + sel_param$rsp + } else { + sel_param + } + responder_choices <- if (length(aval_var) == 0) { + character(0) + } else { + if ("levels" %in% names(sel_param)) { + if (length(intersect(unique(anl[[aval_var]]), sel_param$levels)) > 1) { + sel_param$levels } else { unique(anl[[aval_var]]) } + } else { + unique(anl[[aval_var]]) } - updateSelectInput( - session, "responders", - choices = responder_choices, - selected = restoreInput(ns("responders"), intersect(responder_choices, common_rsp)) - ) } - ) + + selectInput( + ns("responders"), + "Responders", + choices = responder_choices, + selected = common_rsp, + multiple = TRUE + ) + }) validate_check <- reactive({ teal::validate_inputs(iv_r()) From d10badbd3050a59f205c9dd183859d3787852fcb Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Thu, 28 Mar 2024 13:27:34 +0100 Subject: [PATCH 26/27] fix quotation marks --- R/tm_g_pp_patient_timeline.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index 50557e1cc6..c83495fe6d 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -578,7 +578,7 @@ ui_g_patient_timeline <- function(id, ...) { "aerelday_start", "aerelday_end", "dsrelday_start", "dsrelday_end" )] ), - uiOutput(ns('container_patient_id')), + uiOutput(ns("container_patient_id")), teal.transform::data_extract_ui( id = ns("cmdecod"), label = "Select Medication standardized term variable:", From 432996c4911015579dc7d4ac40fac3da7bdcdc11 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Thu, 28 Mar 2024 13:28:19 +0100 Subject: [PATCH 27/27] teal_bookmarkable flag: tm_t_acnova --- R/tm_t_ancova.R | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/R/tm_t_ancova.R b/R/tm_t_ancova.R index c9aacedc17..52898e0f43 100644 --- a/R/tm_t_ancova.R +++ b/R/tm_t_ancova.R @@ -567,7 +567,9 @@ tm_t_ancova <- function(label, ), datanames = teal.transform::get_extract_datanames(data_extract_list) ) - attr(ans, "teal_bookmarkable") <- NULL + # affected by https://github.com/insightsengineering/teal.widgets/issues/239 + # An ATTEMPT was made but failed. Good luck. + attr(ans, "teal_bookmarkable") <- FALSE ans } @@ -663,6 +665,8 @@ ui_ancova <- function(id, ...) { multiple = TRUE, fixed = FALSE ) + ### ATTEMPT AT ENABLING BOOKMARKING + # uiOutput(ns("container_interact_y")) # nolint: commented_code. ) ) ) @@ -807,6 +811,39 @@ srv_ancova <- function(id, } ) + ### ATTEMPT AT ENABLING BOOKMARKING + # nolint start: commented_code. + # # Render interact_y with choices set to all levels of selected interact_var + # output$container_interact_y <- renderUI({ + # req(!is.null(input$include_interact)) + # interact_var <- isolate(req(input$`interact_var-dataset_ADQS_singleextract-select`)) + # + # interact_choices <- sort(as.vector(unique(merged$anl_q()[[dataname]][[interact_var]]))) + # + # current_selection <- isolate(input$interact_y) + # interact_selected <- + # if (isTruthy(current_selection) && all(current_selection %in% interact_choices)) { + # current_selection + # } else { + # interact_choices[1L] + # } + # + # if (is.numeric(interact_choices)) { + # interact_choices <- NULL + # interact_selected <- NULL + # } + # + # teal.widgets::optionalSelectInput( + # ns("interact_y"), + # label = "Select Interaction y", + # choices = interact_choices, + # selected = interact_selected, + # multiple = TRUE, + # fixed = FALSE + # ) + # }) + # nolint end. + # Prepare the analysis environment (filter data, check data, populate envir). validate_checks <- reactive({ adsl_filtered <- merged$anl_q()[[parentname]]