From cd9a0d70bef9fd9ec750e84f9c99012b1c2bb487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=BAria=20Mercad=C3=A9-Besora?= <61558739+nmercadeb@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:46:13 +0100 Subject: [PATCH 1/6] add summary --- R/appStatic.R | 15 +- R/summary.R | 40 + man/exportStaticApp.Rd | 4 + tests/testthat/_snaps/appStatic.md | 2691 +++++++++++++++++++++++++++- tests/testthat/test-appStatic.R | 7 + 5 files changed, 2735 insertions(+), 22 deletions(-) create mode 100644 R/summary.R diff --git a/R/appStatic.R b/R/appStatic.R index 8bfeaf4..86ea94f 100644 --- a/R/appStatic.R +++ b/R/appStatic.R @@ -6,6 +6,8 @@ #' @param logo Name of a logo or path to a logo. If NULL no logo is included. #' Only svg format allowed for the moment. #' @param title title of the shiny +#' @param summary Whether to include a panel with a summary of content in the +#' `result`. #' @param open Whether to open the shiny app project. #' #' @return The shiny app will be created in directory. @@ -14,6 +16,7 @@ exportStaticApp <- function(result = emptySummarisedResult(), logo = "HDS", title = "My study", + summary = TRUE, directory = getwd(), open = rlang::is_interactive()) { # input check @@ -22,6 +25,12 @@ exportStaticApp <- function(result = emptySummarisedResult(), omopgenerics::assertLogical(open, length = 1) omopgenerics::assertCharacter(logo, length = 1, null = TRUE) omopgenerics::assertCharacter(title, length = 1) + omopgenerics::assertLogical(summary, length = 1) + if (summary) { + sum <- capture.output(summary(result), type = "message") + } else { + sum <- NULL + } # create directory if it does not exit if (!dir.exists(directory)) { @@ -52,7 +61,7 @@ exportStaticApp <- function(result = emptySummarisedResult(), dir.create(path = directory, showWarnings = FALSE) cli::cli_inform(c("i" = "Creating shiny from provided data")) logo <- copyLogos(logo, directory) - ui <- c(messageShiny(), uiStatic(choices = choices, logo = logo, title = title)) + ui <- c(messageShiny(), uiStatic(choices = choices, logo = logo, title = title, summary = sum)) server <- c(messageShiny(), serverStatic(resultTypes = names(choices))) global <- c(messageShiny(), omopViewerGlobal) dir.create(paste0(directory, "/data"), showWarnings = FALSE) @@ -111,7 +120,8 @@ copyLogos <- function(logo, directory) { uiStatic <- function(choices = list(), logo = NULL, title = "My study", - background = TRUE) { + background = TRUE, + summary = NULL) { # initial checks omopgenerics::assertList(choices, named = TRUE) omopgenerics::assertCharacter(logo, length = 1, null = TRUE) @@ -123,6 +133,7 @@ uiStatic <- function(choices = list(), c( pageTitle(title, logo), createBackground(background, title, logo), + createSummary(summary, logo), createUi(names(choices), choices), 'bslib::nav_spacer()', createAbout("hds_logo.svg"), diff --git a/R/summary.R b/R/summary.R new file mode 100644 index 0000000..6d6a478 --- /dev/null +++ b/R/summary.R @@ -0,0 +1,40 @@ +createSummary <- function(sum, logo) { + if (length(sum) == 0) {return("")} + + if (!is.null(logo)) { + logoImg <- ', + shiny::tags$img( + src = "{logo}", + width = "auto", + height = "100px", + alt = "logo", + align = "left" + )' |> + glue::glue() |> + as.character() + } else { + logoImg <- "" + } + + return( + 'bslib::nav_panel( + title = "Summary", + icon = shiny::icon("file-alt"), + bslib::card( + bslib::card_header("Summary of results"), + {styleSummary(sum)} + {logoImg} + ) + )' |> + glue::glue() |> + as.character() + ) +} + +styleSummary <- function(sum) { + sum[1] <- gsub("(\\d+)", "**\\1**", sum[1]) + sum[-1] <- paste0(" - **", gsub(": ", ":** ", sum[-1])) + purrr::map(sum, function(x){ + glue::glue('shiny::p(shiny::markdown("{x}"))') + }) |> unlist() |> paste0(collapse = ", ") +} diff --git a/man/exportStaticApp.Rd b/man/exportStaticApp.Rd index 4cd83f7..f463514 100644 --- a/man/exportStaticApp.Rd +++ b/man/exportStaticApp.Rd @@ -8,6 +8,7 @@ exportStaticApp( result = emptySummarisedResult(), logo = "HDS", title = "My study", + summary = TRUE, directory = getwd(), open = rlang::is_interactive() ) @@ -20,6 +21,9 @@ Only svg format allowed for the moment.} \item{title}{title of the shiny} +\item{summary}{Whether to include a panel with a summary of content in the +`result`.} + \item{directory}{Directory to create the shiny.} \item{open}{Whether to open the shiny app project.} diff --git a/tests/testthat/_snaps/appStatic.md b/tests/testthat/_snaps/appStatic.md index 8f917f3..25351b0 100644 --- a/tests/testthat/_snaps/appStatic.md +++ b/tests/testthat/_snaps/appStatic.md @@ -28,7 +28,7 @@ align = "left" ) ) - ), + ), , bslib::nav_spacer(), bslib::nav_item( bslib::popover( @@ -67,7 +67,7 @@ bslib::card_header("My study background"), shiny::p("You can use this section to add some background of your study") ) - ), + ), , bslib::nav_spacer(), bslib::nav_item( bslib::popover( @@ -114,7 +114,7 @@ bslib::card_header("My study background"), shiny::p("You can use this section to add some background of your study") ) - ), + ), , bslib::nav_panel( title = "Cohort characteristics", icon = shiny::icon("users-gear"), @@ -1874,31 +1874,2682 @@ ## plot summarise_large_scale_characteristics ----- } -# title +--- Code - cat(x, sep = "\n") + cat(uiStatic(choices = getChoices(result), summary = capture.output(summary( + result), type = "message"), logo = NULL), sep = "\n") + Message + A summarised_result object with 27031 rows, 9 different result_id, 1 different cdm names, and 9 settings. + CDM names: mock database. + Settings: package_name, package_version, result_type, cohort_definition_id, table_name, restrict_to_first_entry, density, type, and analysis. Output - # Generated by omopViewer 0.0.0.900 - # Be careful editing this file - ui <- bslib::page_navbar( - title = shiny::tags$span( - shiny::tags$img( - src = "hds_logo.svg", - width = "auto", - height = "46px", - class = "me-3", - alt = "logo" - ), - "example" - ), + title = "My study", bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), bslib::card( - bslib::card_header("example background"), - shiny::p("You can use this section to add some background of your study"), + bslib::card_header("My study background"), + shiny::p("You can use this section to add some background of your study") + ) + ), , + bslib::nav_panel( + title = "Cohort characteristics", + icon = shiny::icon("users-gear"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_characteristics_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_characteristics_variable_name", + label = "Variable name", + choices = c("Age", "Cohort end date", "Cohort start date", "Future observation", "Number records", "Number subjects", "Prior observation", "Sex"), + selected = c("Age", "Cohort end date", "Cohort start date", "Future observation", "Number records", "Number subjects", "Prior observation", "Sex"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_characteristics_estimate_name", + label = "Estimate name", + choices = c("count", "max", "mean", "median", "min", "percentage", "q25", "q75", "sd"), + selected = c("count", "max", "mean", "median", "min", "percentage", "q25", "q75", "sd"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_characteristics_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_characteristics_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_characteristics_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_characteristics_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_characteristics_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("variable_name", "variable_level", "estimate_name"), + input_id = "summarise_characteristics_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_characteristics_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_characteristics_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = character(), + input_id = "summarise_characteristics_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_characteristics_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot characteristics", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_characteristics_plot_4_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_plot_style", + label = "plotStyle", + choices = c("boxplot", "barplot", "scatterplot"), + selected = c("barplot"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_facet", + label = "facet", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_colour", + label = "colour", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + position = "right" + ), + shiny::plotOutput("summarise_characteristics_plot_4") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort Attrition", + icon = shiny::icon("layer-group"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_settings_cohort_definition_id", + label = "Cohort definition id", + choices = c(1, 2, 3), + selected = c(1, 2, 3), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_settings_table_name", + label = "Table name", + choices = c("cohort"), + selected = c("cohort"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_reason", + label = "Reason", + choices = c("Initial qualifying events"), + selected = c("Initial qualifying events"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_reason_id", + label = "Reason id", + choices = c("1"), + selected = c("1"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_variable_name", + label = "Variable name", + choices = c("excluded_records", "excluded_subjects", "number_records", "number_subjects"), + selected = c("excluded_records", "excluded_subjects", "number_records", "number_subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_estimate_name", + label = "Estimate name", + choices = c("count"), + selected = c("count"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_attrition_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_attrition_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_attrition_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_attrition_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_attrition_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("reason", "reason_id", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_attrition_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_attrition_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_cohort_attrition_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("cohort_definition_id", "table_name"), + input_id = "summarise_cohort_attrition_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_attrition_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Diagram", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_plot_2_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_attrition_plot_2_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + position = "right" + ), + DiagrammeR::grVizOutput("summarise_cohort_attrition_plot_2") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort count", + icon = shiny::icon("users"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_count_settings_table_name", + label = "Table name", + choices = c("cohort"), + selected = c("cohort"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_count_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_count_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_count_variable_name", + label = "Variable name", + choices = c("Number records", "Number subjects"), + selected = c("Number records", "Number subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_count_estimate_name", + label = "Estimate name", + choices = c("count"), + selected = c("count"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_count_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_count_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_count_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_count_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_count_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_count_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_count_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_cohort_count_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("table_name"), + input_id = "summarise_cohort_count_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_count_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort count", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_count_plot_5_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_facet", + label = "facet", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = c("cdm_name"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_colour", + label = "colour", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_count_plot_5") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort overlap", + icon = shiny::icon("circle-half-stroke"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("Cohort overlap shows the number of subjects that contribute to a pair of cohorts.") + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cohort_name_reference", + label = "Cohort name reference", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cohort_name_comparator", + label = "Cohort name comparator", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_variable_name", + label = "Variable name", + choices = c("comparator", "overlap", "reference"), + selected = c("comparator", "overlap", "reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_estimate_name", + label = "Estimate name", + choices = c("count", "percentage"), + selected = c("count", "percentage"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_overlap_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_overlap_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_overlap_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_overlap_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_overlap_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = character(), + input_id = "summarise_cohort_overlap_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = character(), + input_id = "summarise_cohort_overlap_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_overlap_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort overlap", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_plot_1_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_overlap_plot_1_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_plot_1_facet", + label = "facet", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + selected = c("cdm_name", "cohort_name_reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_plot_1_unique_combinations", + label = "uniqueCombinations", + value = c(FALSE) + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_overlap_plot_1") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort timing", + icon = shiny::icon("chart-simple"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_settings_restrict_to_first_entry", + label = "Restrict to first entry", + choices = c(TRUE), + selected = c(TRUE), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_settings_density", + label = "Density", + choices = c(FALSE), + selected = c(FALSE), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cohort_name_reference", + label = "Cohort name reference", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cohort_name_comparator", + label = "Cohort name comparator", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_variable_name", + label = "Variable name", + choices = c("days_between_cohort_entries", "number records", "number subjects"), + selected = c("days_between_cohort_entries", "number records", "number subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_estimate_name", + label = "Estimate name", + choices = c("count", "max", "median", "min", "q25", "q75"), + selected = c("count", "max", "median", "min", "q25", "q75"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_timing_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_timing_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_timing_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_timing_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_timing_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_timing_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_timing_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = character(), + input_id = "summarise_cohort_timing_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("restrict_to_first_entry", "density"), + input_id = "summarise_cohort_timing_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_timing_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort timing", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_timing_plot_3_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_plot_type", + label = "plotType", + choices = c("boxplot", "density"), + selected = c("boxplot"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_time_scale", + label = "timeScale", + choices = c("days", "years"), + selected = c("days"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_facet", + label = "facet", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name", "restrict_to_first_entry", "density"), + selected = c("cdm_name", "cohort_name_reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_colour", + label = "colour", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name", "restrict_to_first_entry", "density"), + selected = c("cohort_name_comparator"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::checkboxInput( + inputId = "summarise_cohort_timing_plot_3_unique_combinations", + label = "uniqueCombinations", + value = c(FALSE) + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_timing_plot_3") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Large Scale Characteristics", + icon = shiny::icon("arrow-up-right-dots"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_table_name", + label = "Table name", + choices = c("condition_occurrence", "drug_exposure"), + selected = c("condition_occurrence", "drug_exposure"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_type", + label = "Type", + choices = c("episode", "event"), + selected = c("episode", "event"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_analysis", + label = "Analysis", + choices = c("standard"), + selected = c("standard"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_sex", + label = "Sex", + choices = c("Female", "Male", "overall"), + selected = c("Female", "Male", "overall"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_age_group", + label = "Age group", + choices = c("0 to 44", "45 or above", "overall"), + selected = c("0 to 44", "45 or above", "overall"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_concept_id", + label = "Concept id", + choices = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), + selected = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_variable_name", + label = "Variable name", + choices = c("ANTIHISTAMINES FOR SYSTEMIC USE", "ANTINEOPLASTIC AGENTS", "ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS", "Acquired deformities of fingers and toes", "Alkaline phosphatase bone isoenzyme raised", "Alkaline phosphatase isoenzyme, bone fraction", "Arthropathies", "Bos taurus catalase preparation", "Bus occupant injured in collision with heavy transport vehicle or bus", "Bus occupant injured in collision with heavy transport vehicle or bus, person on outside of vehicle injured in nontraffic accident", "COUGH AND COLD PREPARATIONS", "DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES", "Disorders of patella", "ENDOCRINE THERAPY", "Elevated mood", "IMMUNOSTIMULANTS", "IMMUNOSUPPRESSANTS", "Internal derangement of knee", "Jaaps Health Salts", "Manic mood", "Manic symptoms co-occurrent and due to primary psychotic disorder", "Mentha arvensis top extract / sodium chloride / xylitol Nasal Powder", "NASAL PREPARATIONS", "Nasal Powder", "Nasal Product", "OTHER RESPIRATORY SYSTEM PRODUCTS", "Other acquired deformities of limbs", "Other joint disorders", "Other joint disorders, not elsewhere classified", "Other specific joint derangements", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / sodium carbonate / Sodium Chloride / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Injectable Solution", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE 0.0094 MG/MG", "POTASSIUM SODIUM TARTRATE 9.4 MG/MG", "RESPIRATORY SYSTEM", "Renal agenesis and dysgenesis", "Renal agenesis or dysgenesis NOS", "Septiline", "Sisymbrium officianale whole extract 10 MG Nasal Powder", "Sisymbrium officianale whole extract 10 MG Nasal Powder Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon]", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50 by Mayoly Spindler", "Sisymbrium officianale whole extract Nasal Powder", "Sisymbrium officianale whole extract Nasal Powder [Euphon]", "Sodium / Sodium Chloride Nasal Powder", "Sodium potassium tartrate", "Sodium potassium tartrate crystal", "THROAT PREPARATIONS", "Topical Liquefied Gas", "Topical Product", "Uroporphyrin III", "Victim of vehicular AND/OR traffic accident", "combinations of electrolytes; parenteral", "glucagon 3 MG Nasal Powder", "glucagon 3 MG Nasal Powder [Baqsimi]", "glucagon 3 MG Nasal Powder [Baqsimi] by Abacus Medicine", "glucagon Nasal Powder", "glucagon Nasal Powder [Baqsimi]", "glucose / potassium / sodium Nasal Powder", "nitrogen 99 % Topical Liquefied Gas", "nitrogen 99.2 % Topical Liquefied Gas", "nitrogen Topical Liquefied Gas", "potassium sodium tartrate", "sodium chloride Nasal Powder", "sodium chloride Nasal Powder [Neilmed Sinus Rins]", "sodium potassium tartrate tetrahydrate", "sumatriptan 11 MG Nasal Powder", "sumatriptan 11 MG Nasal Powder [Onzetra]", "sumatriptan Nasal Powder", "sumatriptan Nasal Powder [Onzetra]"), + selected = c("ANTIHISTAMINES FOR SYSTEMIC USE", "ANTINEOPLASTIC AGENTS", "ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS", "Acquired deformities of fingers and toes", "Alkaline phosphatase bone isoenzyme raised", "Alkaline phosphatase isoenzyme, bone fraction", "Arthropathies", "Bos taurus catalase preparation", "Bus occupant injured in collision with heavy transport vehicle or bus", "Bus occupant injured in collision with heavy transport vehicle or bus, person on outside of vehicle injured in nontraffic accident", "COUGH AND COLD PREPARATIONS", "DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES", "Disorders of patella", "ENDOCRINE THERAPY", "Elevated mood", "IMMUNOSTIMULANTS", "IMMUNOSUPPRESSANTS", "Internal derangement of knee", "Jaaps Health Salts", "Manic mood", "Manic symptoms co-occurrent and due to primary psychotic disorder", "Mentha arvensis top extract / sodium chloride / xylitol Nasal Powder", "NASAL PREPARATIONS", "Nasal Powder", "Nasal Product", "OTHER RESPIRATORY SYSTEM PRODUCTS", "Other acquired deformities of limbs", "Other joint disorders", "Other joint disorders, not elsewhere classified", "Other specific joint derangements", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / sodium carbonate / Sodium Chloride / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Injectable Solution", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE 0.0094 MG/MG", "POTASSIUM SODIUM TARTRATE 9.4 MG/MG", "RESPIRATORY SYSTEM", "Renal agenesis and dysgenesis", "Renal agenesis or dysgenesis NOS", "Septiline", "Sisymbrium officianale whole extract 10 MG Nasal Powder", "Sisymbrium officianale whole extract 10 MG Nasal Powder Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon]", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50 by Mayoly Spindler", "Sisymbrium officianale whole extract Nasal Powder", "Sisymbrium officianale whole extract Nasal Powder [Euphon]", "Sodium / Sodium Chloride Nasal Powder", "Sodium potassium tartrate", "Sodium potassium tartrate crystal", "THROAT PREPARATIONS", "Topical Liquefied Gas", "Topical Product", "Uroporphyrin III", "Victim of vehicular AND/OR traffic accident", "combinations of electrolytes; parenteral", "glucagon 3 MG Nasal Powder", "glucagon 3 MG Nasal Powder [Baqsimi]", "glucagon 3 MG Nasal Powder [Baqsimi] by Abacus Medicine", "glucagon Nasal Powder", "glucagon Nasal Powder [Baqsimi]", "glucose / potassium / sodium Nasal Powder", "nitrogen 99 % Topical Liquefied Gas", "nitrogen 99.2 % Topical Liquefied Gas", "nitrogen Topical Liquefied Gas", "potassium sodium tartrate", "sodium chloride Nasal Powder", "sodium chloride Nasal Powder [Neilmed Sinus Rins]", "sodium potassium tartrate tetrahydrate", "sumatriptan 11 MG Nasal Powder", "sumatriptan 11 MG Nasal Powder [Onzetra]", "sumatriptan Nasal Powder", "sumatriptan Nasal Powder [Onzetra]"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_estimate_name", + label = "Estimate name", + choices = c("count", "percentage"), + selected = c("count", "percentage"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_large_scale_characteristics_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_large_scale_characteristics_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_large_scale_characteristics_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_large_scale_characteristics_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_large_scale_characteristics_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("sex", "age_group", "concept_id", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_large_scale_characteristics_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_large_scale_characteristics_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_large_scale_characteristics_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("table_name", "type", "analysis"), + input_id = "summarise_large_scale_characteristics_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_large_scale_characteristics_formatted") + ) + ) + ), + ) + ) + ), + bslib::nav_spacer(), + bslib::nav_item( + bslib::popover( + shiny::icon("circle-info"), + shiny::tags$img( + src = "hds_logo.svg", + class = "logo-img", + alt = "Logo", + height = "auto", + width = "30%", + style = "float:right" + ), + "This shiny app was generated with ", + shiny::a( + "omopViewer", + href = "https://github.com/oxford-pharmacoepi/omopViewer", + target = "_blank" + ), + shiny::strong("v0.0.0.900") + ) + ), + bslib::nav_item(bslib::input_dark_mode(id = "dark_mode", mode = "light")) + ) + +--- + + Code + cat(uiStatic(choices = getChoices(result), summary = capture.output(summary( + result), type = "message"), logo = "HDS"), sep = "\n") + Message + A summarised_result object with 27031 rows, 9 different result_id, 1 different cdm names, and 9 settings. + CDM names: mock database. + Settings: package_name, package_version, result_type, cohort_definition_id, table_name, restrict_to_first_entry, density, type, and analysis. + Output + ui <- bslib::page_navbar( + title = shiny::tags$span( + shiny::tags$img( + src = "HDS", + width = "auto", + height = "46px", + class = "me-3", + alt = "logo" + ), + "My study" + ), + bslib::nav_panel( + title = "Background", + icon = shiny::icon("disease"), + bslib::card( + bslib::card_header("My study background"), + shiny::p("You can use this section to add some background of your study"), + shiny::tags$img( + src = "HDS", + width = "auto", + height = "100px", + alt = "logo", + align = "left" + ) + ) + ), , + bslib::nav_panel( + title = "Cohort characteristics", + icon = shiny::icon("users-gear"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_characteristics_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_characteristics_variable_name", + label = "Variable name", + choices = c("Age", "Cohort end date", "Cohort start date", "Future observation", "Number records", "Number subjects", "Prior observation", "Sex"), + selected = c("Age", "Cohort end date", "Cohort start date", "Future observation", "Number records", "Number subjects", "Prior observation", "Sex"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_characteristics_estimate_name", + label = "Estimate name", + choices = c("count", "max", "mean", "median", "min", "percentage", "q25", "q75", "sd"), + selected = c("count", "max", "mean", "median", "min", "percentage", "q25", "q75", "sd"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_characteristics_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_characteristics_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_characteristics_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_characteristics_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_characteristics_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_characteristics_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("variable_name", "variable_level", "estimate_name"), + input_id = "summarise_characteristics_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_characteristics_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_characteristics_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = character(), + input_id = "summarise_characteristics_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_characteristics_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot characteristics", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_characteristics_plot_4_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_characteristics_plot_4_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_plot_style", + label = "plotStyle", + choices = c("boxplot", "barplot", "scatterplot"), + selected = c("barplot"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_facet", + label = "facet", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_characteristics_plot_4_colour", + label = "colour", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + position = "right" + ), + shiny::plotOutput("summarise_characteristics_plot_4") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort Attrition", + icon = shiny::icon("layer-group"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_settings_cohort_definition_id", + label = "Cohort definition id", + choices = c(1, 2, 3), + selected = c(1, 2, 3), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_settings_table_name", + label = "Table name", + choices = c("cohort"), + selected = c("cohort"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_reason", + label = "Reason", + choices = c("Initial qualifying events"), + selected = c("Initial qualifying events"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_groupping_reason_id", + label = "Reason id", + choices = c("1"), + selected = c("1"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_variable_name", + label = "Variable name", + choices = c("excluded_records", "excluded_subjects", "number_records", "number_subjects"), + selected = c("excluded_records", "excluded_subjects", "number_records", "number_subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_estimate_name", + label = "Estimate name", + choices = c("count"), + selected = c("count"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_attrition_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_attrition_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_attrition_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_attrition_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_attrition_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_attrition_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("reason", "reason_id", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_attrition_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_attrition_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_cohort_attrition_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("cohort_definition_id", "table_name"), + input_id = "summarise_cohort_attrition_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_attrition_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Diagram", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_attrition_plot_2_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_attrition_plot_2_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_attrition_plot_2_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + position = "right" + ), + DiagrammeR::grVizOutput("summarise_cohort_attrition_plot_2") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort count", + icon = shiny::icon("users"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_count_settings_table_name", + label = "Table name", + choices = c("cohort"), + selected = c("cohort"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_count_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_count_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_count_variable_name", + label = "Variable name", + choices = c("Number records", "Number subjects"), + selected = c("Number records", "Number subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_count_estimate_name", + label = "Estimate name", + choices = c("count"), + selected = c("count"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_count_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_count_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_count_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_count_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_count_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_count_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_count_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_count_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_cohort_count_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("table_name"), + input_id = "summarise_cohort_count_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_count_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort count", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_count_plot_5_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_count_plot_5_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_facet", + label = "facet", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = c("cdm_name"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_count_plot_5_colour", + label = "colour", + choices = c("cdm_name", "cohort_name", "variable_name", "variable_level", "estimate_name"), + selected = NULL, + multiple = TRUE, + options = list(plugins = "remove_button") + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_count_plot_5") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort overlap", + icon = shiny::icon("circle-half-stroke"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("Cohort overlap shows the number of subjects that contribute to a pair of cohorts.") + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cohort_name_reference", + label = "Cohort name reference", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_groupping_cohort_name_comparator", + label = "Cohort name comparator", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_variable_name", + label = "Variable name", + choices = c("comparator", "overlap", "reference"), + selected = c("comparator", "overlap", "reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_estimate_name", + label = "Estimate name", + choices = c("count", "percentage"), + selected = c("count", "percentage"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_overlap_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_overlap_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_overlap_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_overlap_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_overlap_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_overlap_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = character(), + input_id = "summarise_cohort_overlap_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = character(), + input_id = "summarise_cohort_overlap_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_overlap_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort overlap", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_plot_1_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_overlap_plot_1_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_overlap_plot_1_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_overlap_plot_1_facet", + label = "facet", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + selected = c("cdm_name", "cohort_name_reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::checkboxInput( + inputId = "summarise_cohort_overlap_plot_1_unique_combinations", + label = "uniqueCombinations", + value = c(FALSE) + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_overlap_plot_1") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Cohort timing", + icon = shiny::icon("chart-simple"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_settings_restrict_to_first_entry", + label = "Restrict to first entry", + choices = c(TRUE), + selected = c(TRUE), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_settings_density", + label = "Density", + choices = c(FALSE), + selected = c(FALSE), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cohort_name_reference", + label = "Cohort name reference", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_groupping_cohort_name_comparator", + label = "Cohort name comparator", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_variable_name", + label = "Variable name", + choices = c("days_between_cohort_entries", "number records", "number subjects"), + selected = c("days_between_cohort_entries", "number records", "number subjects"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_cohort_timing_estimate_name", + label = "Estimate name", + choices = c("count", "max", "median", "min", "q25", "q75"), + selected = c("count", "max", "median", "min", "q25", "q75"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_cohort_timing_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_cohort_timing_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_cohort_timing_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_cohort_timing_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_cohort_timing_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_cohort_timing_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_cohort_timing_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_cohort_timing_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = character(), + input_id = "summarise_cohort_timing_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("restrict_to_first_entry", "density"), + input_id = "summarise_cohort_timing_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_cohort_timing_formatted") + ) + ) + ), + bslib::nav_panel( + title = "Plot cohort timing", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_width", label = "width", value = 15), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_height", label = "height", value = 10), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_download_units", + label = "Units", + choices = c("px", "cm", "inch"), + selected = c("cm"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::numericInput(inputId = "summarise_cohort_timing_plot_3_download_dpi", label = "dpi", value = 300), + shiny::downloadButton(outputId = "summarise_cohort_timing_plot_3_download", label = "Download png") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_plot_type", + label = "plotType", + choices = c("boxplot", "density"), + selected = c("boxplot"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_time_scale", + label = "timeScale", + choices = c("days", "years"), + selected = c("days"), + multiple = FALSE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_facet", + label = "facet", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name", "restrict_to_first_entry", "density"), + selected = c("cdm_name", "cohort_name_reference"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_cohort_timing_plot_3_colour", + label = "colour", + choices = c("cdm_name", "cohort_name_reference", "cohort_name_comparator", "variable_name", "variable_level", "estimate_name", "restrict_to_first_entry", "density"), + selected = c("cohort_name_comparator"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::checkboxInput( + inputId = "summarise_cohort_timing_plot_3_unique_combinations", + label = "uniqueCombinations", + value = c(FALSE) + ), + position = "right" + ), + shiny::plotOutput("summarise_cohort_timing_plot_3") + ) + ) + ) + ) + ) + ), + bslib::nav_panel( + title = "Large Scale Characteristics", + icon = shiny::icon("arrow-up-right-dots"), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + bslib::accordion( + bslib::accordion_panel( + title = "Information", + icon = shiny::icon("info"), + shiny::p("") + ), + bslib::accordion_panel( + title = "Settings", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_table_name", + label = "Table name", + choices = c("condition_occurrence", "drug_exposure"), + selected = c("condition_occurrence", "drug_exposure"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_type", + label = "Type", + choices = c("episode", "event"), + selected = c("episode", "event"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_settings_analysis", + label = "Analysis", + choices = c("standard"), + selected = c("standard"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Groupping", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_cdm_name", + label = "Cdm name", + choices = c("mock database"), + selected = c("mock database"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_cohort_name", + label = "Cohort name", + choices = c("asthma", "covid", "tb"), + selected = c("asthma", "covid", "tb"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_sex", + label = "Sex", + choices = c("Female", "Male", "overall"), + selected = c("Female", "Male", "overall"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_age_group", + label = "Age group", + choices = c("0 to 44", "45 or above", "overall"), + selected = c("0 to 44", "45 or above", "overall"), + multiple = TRUE, + options = list(plugins = "remove_button") + ), + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_groupping_concept_id", + label = "Concept id", + choices = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), + selected = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Variables", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_variable_name", + label = "Variable name", + choices = c("ANTIHISTAMINES FOR SYSTEMIC USE", "ANTINEOPLASTIC AGENTS", "ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS", "Acquired deformities of fingers and toes", "Alkaline phosphatase bone isoenzyme raised", "Alkaline phosphatase isoenzyme, bone fraction", "Arthropathies", "Bos taurus catalase preparation", "Bus occupant injured in collision with heavy transport vehicle or bus", "Bus occupant injured in collision with heavy transport vehicle or bus, person on outside of vehicle injured in nontraffic accident", "COUGH AND COLD PREPARATIONS", "DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES", "Disorders of patella", "ENDOCRINE THERAPY", "Elevated mood", "IMMUNOSTIMULANTS", "IMMUNOSUPPRESSANTS", "Internal derangement of knee", "Jaaps Health Salts", "Manic mood", "Manic symptoms co-occurrent and due to primary psychotic disorder", "Mentha arvensis top extract / sodium chloride / xylitol Nasal Powder", "NASAL PREPARATIONS", "Nasal Powder", "Nasal Product", "OTHER RESPIRATORY SYSTEM PRODUCTS", "Other acquired deformities of limbs", "Other joint disorders", "Other joint disorders, not elsewhere classified", "Other specific joint derangements", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / sodium carbonate / Sodium Chloride / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Injectable Solution", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE 0.0094 MG/MG", "POTASSIUM SODIUM TARTRATE 9.4 MG/MG", "RESPIRATORY SYSTEM", "Renal agenesis and dysgenesis", "Renal agenesis or dysgenesis NOS", "Septiline", "Sisymbrium officianale whole extract 10 MG Nasal Powder", "Sisymbrium officianale whole extract 10 MG Nasal Powder Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon]", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50 by Mayoly Spindler", "Sisymbrium officianale whole extract Nasal Powder", "Sisymbrium officianale whole extract Nasal Powder [Euphon]", "Sodium / Sodium Chloride Nasal Powder", "Sodium potassium tartrate", "Sodium potassium tartrate crystal", "THROAT PREPARATIONS", "Topical Liquefied Gas", "Topical Product", "Uroporphyrin III", "Victim of vehicular AND/OR traffic accident", "combinations of electrolytes; parenteral", "glucagon 3 MG Nasal Powder", "glucagon 3 MG Nasal Powder [Baqsimi]", "glucagon 3 MG Nasal Powder [Baqsimi] by Abacus Medicine", "glucagon Nasal Powder", "glucagon Nasal Powder [Baqsimi]", "glucose / potassium / sodium Nasal Powder", "nitrogen 99 % Topical Liquefied Gas", "nitrogen 99.2 % Topical Liquefied Gas", "nitrogen Topical Liquefied Gas", "potassium sodium tartrate", "sodium chloride Nasal Powder", "sodium chloride Nasal Powder [Neilmed Sinus Rins]", "sodium potassium tartrate tetrahydrate", "sumatriptan 11 MG Nasal Powder", "sumatriptan 11 MG Nasal Powder [Onzetra]", "sumatriptan Nasal Powder", "sumatriptan Nasal Powder [Onzetra]"), + selected = c("ANTIHISTAMINES FOR SYSTEMIC USE", "ANTINEOPLASTIC AGENTS", "ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS", "Acquired deformities of fingers and toes", "Alkaline phosphatase bone isoenzyme raised", "Alkaline phosphatase isoenzyme, bone fraction", "Arthropathies", "Bos taurus catalase preparation", "Bus occupant injured in collision with heavy transport vehicle or bus", "Bus occupant injured in collision with heavy transport vehicle or bus, person on outside of vehicle injured in nontraffic accident", "COUGH AND COLD PREPARATIONS", "DRUGS FOR OBSTRUCTIVE AIRWAY DISEASES", "Disorders of patella", "ENDOCRINE THERAPY", "Elevated mood", "IMMUNOSTIMULANTS", "IMMUNOSUPPRESSANTS", "Internal derangement of knee", "Jaaps Health Salts", "Manic mood", "Manic symptoms co-occurrent and due to primary psychotic disorder", "Mentha arvensis top extract / sodium chloride / xylitol Nasal Powder", "NASAL PREPARATIONS", "Nasal Powder", "Nasal Product", "OTHER RESPIRATORY SYSTEM PRODUCTS", "Other acquired deformities of limbs", "Other joint disorders", "Other joint disorders, not elsewhere classified", "Other specific joint derangements", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / sodium carbonate / Sodium Chloride / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Injectable Solution", "POTASSIUM SODIUM TARTRATE / Sodium Bicarbonate / tartaric acid Oral Powder", "POTASSIUM SODIUM TARTRATE 0.0094 MG/MG", "POTASSIUM SODIUM TARTRATE 9.4 MG/MG", "RESPIRATORY SYSTEM", "Renal agenesis and dysgenesis", "Renal agenesis or dysgenesis NOS", "Septiline", "Sisymbrium officianale whole extract 10 MG Nasal Powder", "Sisymbrium officianale whole extract 10 MG Nasal Powder Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon]", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50", "Sisymbrium officianale whole extract 10 MG Nasal Powder [Euphon] Box of 50 by Mayoly Spindler", "Sisymbrium officianale whole extract Nasal Powder", "Sisymbrium officianale whole extract Nasal Powder [Euphon]", "Sodium / Sodium Chloride Nasal Powder", "Sodium potassium tartrate", "Sodium potassium tartrate crystal", "THROAT PREPARATIONS", "Topical Liquefied Gas", "Topical Product", "Uroporphyrin III", "Victim of vehicular AND/OR traffic accident", "combinations of electrolytes; parenteral", "glucagon 3 MG Nasal Powder", "glucagon 3 MG Nasal Powder [Baqsimi]", "glucagon 3 MG Nasal Powder [Baqsimi] by Abacus Medicine", "glucagon Nasal Powder", "glucagon Nasal Powder [Baqsimi]", "glucose / potassium / sodium Nasal Powder", "nitrogen 99 % Topical Liquefied Gas", "nitrogen 99.2 % Topical Liquefied Gas", "nitrogen Topical Liquefied Gas", "potassium sodium tartrate", "sodium chloride Nasal Powder", "sodium chloride Nasal Powder [Neilmed Sinus Rins]", "sodium potassium tartrate tetrahydrate", "sumatriptan 11 MG Nasal Powder", "sumatriptan 11 MG Nasal Powder [Onzetra]", "sumatriptan Nasal Powder", "sumatriptan Nasal Powder [Onzetra]"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ), + bslib::accordion_panel( + title = "Estimates", + shiny::selectizeInput( + inputId = "summarise_large_scale_characteristics_estimate_name", + label = "Estimate name", + choices = c("count", "percentage"), + selected = c("count", "percentage"), + multiple = TRUE, + options = list(plugins = "remove_button") + ) + ) + ) + ), + bslib::navset_card_tab( + bslib::nav_panel( + title = "Raw", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_raw_download", label = "Download summarised_result") + ), + class = "text-end" + ), + DT::dataTableOutput("summarise_large_scale_characteristics_raw") + ) + ), + bslib::nav_panel( + title = "Tidy", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_tidy_download", label = "Download csv") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + shiny::checkboxInput( + inputId = "summarise_large_scale_characteristics_tidy_settings", + label = "Show settings", + value = FALSE + ), + shiny::checkboxInput( + inputId = "summarise_large_scale_characteristics_tidy_groupping", + label = "Show groupping", + value = TRUE + ), + shiny::radioButtons( + inputId = "summarise_large_scale_characteristics_tidy_pivot", + label = "Pivot estimates/variables", + choices = c("none", "estimates", "estimates and variables"), + selected = "none" + ), + position = "right" + ), + DT::dataTableOutput("summarise_large_scale_characteristics_tidy") + ) + ) + ), + bslib::nav_panel( + title = "Formatted", + bslib::card( + full_screen = TRUE, + bslib::card_header( + bslib::popover( + shiny::icon("download"), + shiny::downloadButton(outputId = "summarise_large_scale_characteristics_formatted_download", label = "Download word") + ), + class = "text-end" + ), + bslib::layout_sidebar( + sidebar = bslib::sidebar( + sortable::bucket_list( + header = NULL, + sortable::add_rank_list( + text = "None", + labels = c("sex", "age_group", "concept_id", "variable_name", "variable_level", "estimate_name"), + input_id = "summarise_large_scale_characteristics_formatted_none" + ), + sortable::add_rank_list( + text = "Header", + labels = c("cdm_name"), + input_id = "summarise_large_scale_characteristics_formatted_header" + ), + sortable::add_rank_list( + text = "Group", + labels = c("cohort_name"), + input_id = "summarise_large_scale_characteristics_formatted_group" + ), + sortable::add_rank_list( + text = "Hide", + labels = c("table_name", "type", "analysis"), + input_id = "summarise_large_scale_characteristics_formatted_hide" + ) + ), + position = "right" + ), + gt::gt_output("summarise_large_scale_characteristics_formatted") + ) + ) + ), + ) + ) + ), + bslib::nav_spacer(), + bslib::nav_item( + bslib::popover( + shiny::icon("circle-info"), + shiny::tags$img( + src = "hds_logo.svg", + class = "logo-img", + alt = "Logo", + height = "auto", + width = "30%", + style = "float:right" + ), + "This shiny app was generated with ", + shiny::a( + "omopViewer", + href = "https://github.com/oxford-pharmacoepi/omopViewer", + target = "_blank" + ), + shiny::strong("v0.0.0.900") + ) + ), + bslib::nav_item(bslib::input_dark_mode(id = "dark_mode", mode = "light")) + ) + +# title + + Code + cat(x, sep = "\n") + Output + # Generated by omopViewer 0.0.0.900 + # Be careful editing this file + + ui <- bslib::page_navbar( + title = shiny::tags$span( + shiny::tags$img( + src = "hds_logo.svg", + width = "auto", + height = "46px", + class = "me-3", + alt = "logo" + ), + "example" + ), + bslib::nav_panel( + title = "Background", + icon = shiny::icon("disease"), + bslib::card( + bslib::card_header("example background"), + shiny::p("You can use this section to add some background of your study"), + shiny::tags$img( + src = "hds_logo.svg", + width = "auto", + height = "100px", + alt = "logo", + align = "left" + ) + ) + ), + bslib::nav_panel( + title = "Summary", + icon = shiny::icon("file-alt"), + bslib::card( + bslib::card_header("Summary of results"), + shiny::p(shiny::markdown("A summarised_result object with **0** rows, **0** different result_id, different cdm names, and **3** settings.")), shiny::p(shiny::markdown(" - **Settings:** result_type, package_name, and package_version.")), shiny::tags$img( src = "hds_logo.svg", width = "auto", diff --git a/tests/testthat/test-appStatic.R b/tests/testthat/test-appStatic.R index c973082..59c80a5 100644 --- a/tests/testthat/test-appStatic.R +++ b/tests/testthat/test-appStatic.R @@ -69,6 +69,13 @@ test_that("CohortCharacteristics shiny", { expect_snapshot(serverStatic(resultTypes = names(getChoices(result))) |> cat(sep = "\n")) unlink(paste0(tdir, "/shiny/"), recursive = TRUE) + # use summary + expect_no_error(exportStaticApp(result = result, directory = tdir, summary = TRUE)) + expect_true("shiny" %in% list.files(tdir)) + expect_snapshot(uiStatic(choices = getChoices(result), summary = capture.output(summary(result), type = "message"), logo = NULL) |> cat(sep = "\n")) + expect_snapshot(uiStatic(choices = getChoices(result), summary = capture.output(summary(result), type = "message"), logo = "HDS") |> cat(sep = "\n")) + unlink(paste0(tdir, "/shiny/"), recursive = TRUE) + PatientProfiles::mockDisconnect(cdm) }) From bcd907fb77cd2b2eaa878b36159ee9aabbb0f0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=BAria=20Mercad=C3=A9-Besora?= <61558739+nmercadeb@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:52:03 +0100 Subject: [PATCH 2/6] revision --- R/appStatic.R | 6 +----- R/summary.R | 3 ++- R/utilities.R | 7 +++++++ tests/testthat/_snaps/appStatic.md | 10 +++++----- tests/testthat/test-appStatic.R | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 R/utilities.R diff --git a/R/appStatic.R b/R/appStatic.R index 86ea94f..51c53f3 100644 --- a/R/appStatic.R +++ b/R/appStatic.R @@ -26,11 +26,7 @@ exportStaticApp <- function(result = emptySummarisedResult(), omopgenerics::assertCharacter(logo, length = 1, null = TRUE) omopgenerics::assertCharacter(title, length = 1) omopgenerics::assertLogical(summary, length = 1) - if (summary) { - sum <- capture.output(summary(result), type = "message") - } else { - sum <- NULL - } + sum <- validateSummary(summary, result) # create directory if it does not exit if (!dir.exists(directory)) { diff --git a/R/summary.R b/R/summary.R index 6d6a478..2100bb7 100644 --- a/R/summary.R +++ b/R/summary.R @@ -1,5 +1,6 @@ createSummary <- function(sum, logo) { - if (length(sum) == 0) {return("")} + + if (length(sum) == 0) {return(NULL)} if (!is.null(logo)) { logoImg <- ', diff --git a/R/utilities.R b/R/utilities.R new file mode 100644 index 0000000..b59c5d8 --- /dev/null +++ b/R/utilities.R @@ -0,0 +1,7 @@ +validateSummary <- function(summary, result){ + if (summary) { + sum <- capture.output(summary(result), type = "message") + } else { + sum <- NULL + } +} diff --git a/tests/testthat/_snaps/appStatic.md b/tests/testthat/_snaps/appStatic.md index 25351b0..792fe1d 100644 --- a/tests/testthat/_snaps/appStatic.md +++ b/tests/testthat/_snaps/appStatic.md @@ -28,7 +28,7 @@ align = "left" ) ) - ), , + ), bslib::nav_spacer(), bslib::nav_item( bslib::popover( @@ -67,7 +67,7 @@ bslib::card_header("My study background"), shiny::p("You can use this section to add some background of your study") ) - ), , + ), bslib::nav_spacer(), bslib::nav_item( bslib::popover( @@ -114,7 +114,7 @@ bslib::card_header("My study background"), shiny::p("You can use this section to add some background of your study") ) - ), , + ), bslib::nav_panel( title = "Cohort characteristics", icon = shiny::icon("users-gear"), @@ -1893,7 +1893,7 @@ bslib::card_header("My study background"), shiny::p("You can use this section to add some background of your study") ) - ), , + ), bslib::nav_panel( title = "Cohort characteristics", icon = shiny::icon("users-gear"), @@ -3219,7 +3219,7 @@ align = "left" ) ) - ), , + ), bslib::nav_panel( title = "Cohort characteristics", icon = shiny::icon("users-gear"), diff --git a/tests/testthat/test-appStatic.R b/tests/testthat/test-appStatic.R index 59c80a5..c7fdc20 100644 --- a/tests/testthat/test-appStatic.R +++ b/tests/testthat/test-appStatic.R @@ -63,7 +63,7 @@ test_that("CohortCharacteristics shiny", { # generate shiny tdir <- here::here() - expect_no_error(exportStaticApp(result = result, directory = tdir)) + expect_no_error(exportStaticApp(result = result, directory = tdir, summary = FALSE)) expect_true("shiny" %in% list.files(tdir)) expect_snapshot(uiStatic(choices = getChoices(result)) |> cat(sep = "\n")) expect_snapshot(serverStatic(resultTypes = names(getChoices(result))) |> cat(sep = "\n")) From d356e0a8d163745f06c34c5d68776e15249024c0 Mon Sep 17 00:00:00 2001 From: catalamarti Date: Mon, 30 Sep 2024 13:07:11 +0200 Subject: [PATCH 3/6] Update background.R --- R/background.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/background.R b/R/background.R index 9888458..c8590ed 100644 --- a/R/background.R +++ b/R/background.R @@ -53,8 +53,8 @@ validateBackground <- function(background) { } else { omopgenerics::assertCharacter(x = background, null = TRUE, named = TRUE) notAllowed <- ! names(background) %in% c("header", "title", "body", "footer") - if (sum(notAllowed) > 0) { - cli::cli_warn("{background[notAllowed]} {?is/are} not allowed named for `background` and will be ignored.") + if (any(notAllowed)) { + cli::cli_warn("{names(background)[notAllowed]} {?is/are} not allowed named for `background` and will be ignored.") background <- background[!notAllowed] } } From 14d6b24f8795c9620449ebd1cd16e7168b928090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=BAria=20Mercad=C3=A9-Besora?= <61558739+nmercadeb@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:16:16 +0100 Subject: [PATCH 4/6] checks --- tests/testthat/_snaps/appStatic.md | 4 ++-- tests/testthat/test-appStatic.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/_snaps/appStatic.md b/tests/testthat/_snaps/appStatic.md index 4dd7666..6d28a2d 100644 --- a/tests/testthat/_snaps/appStatic.md +++ b/tests/testthat/_snaps/appStatic.md @@ -4470,14 +4470,14 @@ Code createBackground(full) Output - [1] "bslib::nav_panel(\n title = \"Background\",\n icon = shiny::icon(\"disease\"),\n bslib::card(bslib::card_header(shiny::markdown('Abstract')), bslib::card_title(shiny::markdown('**Introduction**')), shiny::p(shiny::markdown('Example of an [introduction](https://github.com/oxford-pharmacoepi/omopViewer).')), bslib::card_title(shiny::markdown('Methods')), bslib::card_footer(shiny::markdown('*Here is the footer.')))\n)" + [1] "bslib::nav_panel(\n title = \"Background\",\n icon = shiny::icon(\"disease\"),\n bslib::card(bslib::card_header(shiny::markdown('Abstract')), bslib::card_title(shiny::markdown('**Introduction**')), shiny::p(shiny::markdown('Example of an [introduction](https://github.com/oxford-pharmacoepi/omopViewer).')), bslib::card_title(shiny::markdown('Methods')), shiny::p(shiny::markdown('Methods example, with a footer* example.')), bslib::card_footer(shiny::markdown('*Here is the footer.')))\n)" --- Code createBackground(full, "HDS") Output - [1] "bslib::nav_panel(\n title = \"Background\",\n icon = shiny::icon(\"disease\"),\n bslib::card(bslib::card_header(shiny::markdown('Abstract')), bslib::card_title(shiny::markdown('**Introduction**')), shiny::p(shiny::markdown('Example of an [introduction](https://github.com/oxford-pharmacoepi/omopViewer).')), bslib::card_title(shiny::markdown('Methods')), bslib::card_footer(shiny::markdown('*Here is the footer.')),\nshiny::tags$img(\n src = \"HDS\",\n width = \"auto\",\n height = \"100px\",\n alt = \"logo\",\n align = \"left\"\n))\n)" + [1] "bslib::nav_panel(\n title = \"Background\",\n icon = shiny::icon(\"disease\"),\n bslib::card(bslib::card_header(shiny::markdown('Abstract')), bslib::card_title(shiny::markdown('**Introduction**')), shiny::p(shiny::markdown('Example of an [introduction](https://github.com/oxford-pharmacoepi/omopViewer).')), bslib::card_title(shiny::markdown('Methods')), shiny::p(shiny::markdown('Methods example, with a footer* example.')), bslib::card_footer(shiny::markdown('*Here is the footer.')),\nshiny::tags$img(\n src = \"HDS\",\n width = \"auto\",\n height = \"100px\",\n alt = \"logo\",\n align = \"left\"\n))\n)" # title diff --git a/tests/testthat/test-appStatic.R b/tests/testthat/test-appStatic.R index f6ba5cd..9a9bda6 100644 --- a/tests/testthat/test-appStatic.R +++ b/tests/testthat/test-appStatic.R @@ -95,7 +95,7 @@ test_that("background", { "title" = "**Introduction**", "body" = "Example of an [introduction](https://github.com/oxford-pharmacoepi/omopViewer).", "title" = "Methods", - "paragraph" = "Methods example, with a footer* example.", + "body" = "Methods example, with a footer* example.", "footer" = "*Here is the footer." ) tdir <- here::here() From 4aafb730999b449f798315b8aa10e931af160ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=BAria=20Mercad=C3=A9-Besora?= <61558739+nmercadeb@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:33:45 +0100 Subject: [PATCH 5/6] checks --- R/utilities.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utilities.R b/R/utilities.R index b59c5d8..a99a1bb 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -1,6 +1,6 @@ validateSummary <- function(summary, result){ if (summary) { - sum <- capture.output(summary(result), type = "message") + sum <- utils::capture.output(summary(result), type = "message") } else { sum <- NULL } From 08df2e8f8c103dd8fd0e760f8908e8297ae165a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=BAria=20Mercad=C3=A9-Besora?= <61558739+nmercadeb@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:35:32 +0100 Subject: [PATCH 6/6] Update appStatic.md --- tests/testthat/_snaps/appStatic.md | 148 ++++++++++++++--------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/tests/testthat/_snaps/appStatic.md b/tests/testthat/_snaps/appStatic.md index 5e631ba..407b727 100644 --- a/tests/testthat/_snaps/appStatic.md +++ b/tests/testthat/_snaps/appStatic.md @@ -1881,9 +1881,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_characteristics_groupping_cdm_name", + inputId = "summarise_characteristics_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -1891,7 +1891,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_characteristics_groupping_cohort_name", + inputId = "summarise_characteristics_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -1957,8 +1957,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_characteristics_tidy_groupping", - label = "Show groupping", + inputId = "summarise_characteristics_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -2103,9 +2103,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_cdm_name", + inputId = "summarise_cohort_attrition_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -2113,7 +2113,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_cohort_name", + inputId = "summarise_cohort_attrition_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2121,7 +2121,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_reason", + inputId = "summarise_cohort_attrition_grouping_reason", label = "Reason", choices = c("Initial qualifying events"), selected = c("Initial qualifying events"), @@ -2129,7 +2129,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_reason_id", + inputId = "summarise_cohort_attrition_grouping_reason_id", label = "Reason id", choices = c("1"), selected = c("1"), @@ -2195,8 +2195,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_attrition_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_attrition_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -2309,9 +2309,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_count_groupping_cdm_name", + inputId = "summarise_cohort_count_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -2319,7 +2319,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_count_groupping_cohort_name", + inputId = "summarise_cohort_count_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2385,8 +2385,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_count_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_count_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -2504,9 +2504,9 @@ shiny::p("Cohort overlap shows the number of subjects that contribute to a pair of cohorts.") ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cdm_name", + inputId = "summarise_cohort_overlap_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -2514,7 +2514,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cohort_name_reference", + inputId = "summarise_cohort_overlap_grouping_cohort_name_reference", label = "Cohort name reference", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2522,7 +2522,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cohort_name_comparator", + inputId = "summarise_cohort_overlap_grouping_cohort_name_comparator", label = "Cohort name comparator", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2588,8 +2588,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_overlap_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_overlap_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -2715,9 +2715,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cdm_name", + inputId = "summarise_cohort_timing_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -2725,7 +2725,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cohort_name_reference", + inputId = "summarise_cohort_timing_grouping_cohort_name_reference", label = "Cohort name reference", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2733,7 +2733,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cohort_name_comparator", + inputId = "summarise_cohort_timing_grouping_cohort_name_comparator", label = "Cohort name comparator", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2799,8 +2799,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_timing_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_timing_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -2966,9 +2966,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_cdm_name", + inputId = "summarise_large_scale_characteristics_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -2976,7 +2976,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_cohort_name", + inputId = "summarise_large_scale_characteristics_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -2984,7 +2984,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_sex", + inputId = "summarise_large_scale_characteristics_grouping_sex", label = "Sex", choices = c("Female", "Male", "overall"), selected = c("Female", "Male", "overall"), @@ -2992,7 +2992,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_age_group", + inputId = "summarise_large_scale_characteristics_grouping_age_group", label = "Age group", choices = c("0 to 44", "45 or above", "overall"), selected = c("0 to 44", "45 or above", "overall"), @@ -3000,7 +3000,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_concept_id", + inputId = "summarise_large_scale_characteristics_grouping_concept_id", label = "Concept id", choices = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), selected = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), @@ -3066,8 +3066,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_large_scale_characteristics_tidy_groupping", - label = "Show groupping", + inputId = "summarise_large_scale_characteristics_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -3195,9 +3195,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_characteristics_groupping_cdm_name", + inputId = "summarise_characteristics_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -3205,7 +3205,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_characteristics_groupping_cohort_name", + inputId = "summarise_characteristics_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -3271,8 +3271,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_characteristics_tidy_groupping", - label = "Show groupping", + inputId = "summarise_characteristics_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -3417,9 +3417,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_cdm_name", + inputId = "summarise_cohort_attrition_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -3427,7 +3427,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_cohort_name", + inputId = "summarise_cohort_attrition_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -3435,7 +3435,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_reason", + inputId = "summarise_cohort_attrition_grouping_reason", label = "Reason", choices = c("Initial qualifying events"), selected = c("Initial qualifying events"), @@ -3443,7 +3443,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_attrition_groupping_reason_id", + inputId = "summarise_cohort_attrition_grouping_reason_id", label = "Reason id", choices = c("1"), selected = c("1"), @@ -3509,8 +3509,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_attrition_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_attrition_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -3623,9 +3623,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_count_groupping_cdm_name", + inputId = "summarise_cohort_count_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -3633,7 +3633,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_count_groupping_cohort_name", + inputId = "summarise_cohort_count_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -3699,8 +3699,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_count_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_count_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -3818,9 +3818,9 @@ shiny::p("Cohort overlap shows the number of subjects that contribute to a pair of cohorts.") ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cdm_name", + inputId = "summarise_cohort_overlap_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -3828,7 +3828,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cohort_name_reference", + inputId = "summarise_cohort_overlap_grouping_cohort_name_reference", label = "Cohort name reference", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -3836,7 +3836,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_overlap_groupping_cohort_name_comparator", + inputId = "summarise_cohort_overlap_grouping_cohort_name_comparator", label = "Cohort name comparator", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -3902,8 +3902,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_overlap_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_overlap_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -4029,9 +4029,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cdm_name", + inputId = "summarise_cohort_timing_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -4039,7 +4039,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cohort_name_reference", + inputId = "summarise_cohort_timing_grouping_cohort_name_reference", label = "Cohort name reference", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -4047,7 +4047,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_cohort_timing_groupping_cohort_name_comparator", + inputId = "summarise_cohort_timing_grouping_cohort_name_comparator", label = "Cohort name comparator", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -4113,8 +4113,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_cohort_timing_tidy_groupping", - label = "Show groupping", + inputId = "summarise_cohort_timing_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons( @@ -4280,9 +4280,9 @@ ) ), bslib::accordion_panel( - title = "Groupping", + title = "grouping", shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_cdm_name", + inputId = "summarise_large_scale_characteristics_grouping_cdm_name", label = "Cdm name", choices = c("mock database"), selected = c("mock database"), @@ -4290,7 +4290,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_cohort_name", + inputId = "summarise_large_scale_characteristics_grouping_cohort_name", label = "Cohort name", choices = c("asthma", "covid", "tb"), selected = c("asthma", "covid", "tb"), @@ -4298,7 +4298,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_sex", + inputId = "summarise_large_scale_characteristics_grouping_sex", label = "Sex", choices = c("Female", "Male", "overall"), selected = c("Female", "Male", "overall"), @@ -4306,7 +4306,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_age_group", + inputId = "summarise_large_scale_characteristics_grouping_age_group", label = "Age group", choices = c("0 to 44", "45 or above", "overall"), selected = c("0 to 44", "45 or above", "overall"), @@ -4314,7 +4314,7 @@ options = list(plugins = "remove_button") ), shiny::selectizeInput( - inputId = "summarise_large_scale_characteristics_groupping_concept_id", + inputId = "summarise_large_scale_characteristics_grouping_concept_id", label = "Concept id", choices = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), selected = c("1361364", "1361365", "1361368", "1361370", "1830184", "1830278", "1830279", "1830280", "1830281", "1830282", "1830283", "194152", "1971546", "21018250", "21216049", "21601213", "21601386", "21601387", "21603215", "21603248", "21603365", "21603444", "21603530", "21603812", "21603848", "21603890", "21605007", "21605008", "35604394", "35604434", "35604435", "35604439", "35604877", "35604879", "35604880", "35604883", "35604884", "35741956", "35774678", "36034746", "36034747", "36034751", "36036059", "36217206", "36217213", "37110496", "37498042", "37593197", "37787172", "40371897", "40475132", "40475135", "40721254", "40741270", "4151660", "4220473", "4220524", "4226696", "42899580", "4304866", "44022939", "44081436", "44091285", "444074", "45430573", "45511667", "45533778", "45538734", "45548358", "45548372", "45755492", "45755493", "45756021", "45756023", "46274351"), @@ -4380,8 +4380,8 @@ value = FALSE ), shiny::checkboxInput( - inputId = "summarise_large_scale_characteristics_tidy_groupping", - label = "Show groupping", + inputId = "summarise_large_scale_characteristics_tidy_grouping", + label = "Show grouping", value = TRUE ), shiny::radioButtons(