Skip to content

Commit

Permalink
Merge pull request #152 from OHDSI/concept_type_filer
Browse files Browse the repository at this point in the history
Concept type filer
  • Loading branch information
edward-burn authored Dec 4, 2024
2 parents 4e393f4 + 451dd6b commit 1cded1d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
9 changes: 7 additions & 2 deletions inst/shiny/scripts/preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ selected$compare_large_scale_characteristics_grouping_domain <- choices$compare_

if(!is.null(dataFiltered$summarise_large_scale_characteristics)){
if(nrow(dataFiltered$summarise_large_scale_characteristics)>0){
choices$summarise_large_scale_characteristics_grouping_domain <- settings(dataFiltered$summarise_large_scale_characteristics) |>
pull("table_name") |> unique()
choices$summarise_large_scale_characteristics_grouping_domain <- unique(settings(dataFiltered$summarise_large_scale_characteristics) |>
pull("table_name"))
selected$summarise_large_scale_characteristics_grouping_domain <- choices$summarise_large_scale_characteristics_grouping_domain
}}

Expand Down Expand Up @@ -167,6 +167,11 @@ selected$summarise_cohort_overlap_grouping_cohort_name_comparator <- selected$su
choices$compare_large_scale_characteristics_grouping_domain <- choices$summarise_large_scale_characteristics_grouping_domain
selected$compare_large_scale_characteristics_grouping_domain <- choices$compare_large_scale_characteristics_grouping_domain

choices$compare_large_scale_characteristics_settings_analysis <- choices$summarise_large_scale_characteristics_settings_analysis
selected$compare_large_scale_characteristics_settings_analysis <- "standard"

selected$summarise_large_scale_characteristics_settings_analysis <-"standard"

choices <- choices[!grepl("concept_id", names(choices))]
selected <- selected[!grepl("concept_id", names(selected))]
choices <- choices[!grepl("concept_name", names(choices))]
Expand Down
9 changes: 6 additions & 3 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ server <- function(input, output, session) {
lsc_data <- dataFiltered$summarise_large_scale_characteristics |>
filter(!is.na(estimate_value)) |>
filter(estimate_value != "-") |>
visOmopResults::filterSettings(table_name %in% input$summarise_large_scale_characteristics_grouping_domain) |>
visOmopResults::filterSettings(table_name %in% input$summarise_large_scale_characteristics_grouping_domain,
analysis %in% input$summarise_large_scale_characteristics_settings_analysis) |>
dplyr::filter(cdm_name %in% input$summarise_large_scale_characteristics_grouping_cdm_name ) |>
dplyr::filter(group_level %in% input$summarise_large_scale_characteristics_grouping_cohort_name) |>
dplyr::filter(variable_level %in% input$summarise_large_scale_characteristics_grouping_time_window)
Expand Down Expand Up @@ -665,7 +666,8 @@ server <- function(input, output, session) {
lsc_data <- dataFiltered$summarise_large_scale_characteristics |>
filter(!is.na(estimate_value)) |>
filter(estimate_value != "-") |>
visOmopResults::filterSettings(table_name %in% input$summarise_large_scale_characteristics_grouping_domain) |>
visOmopResults::filterSettings(table_name %in% input$summarise_large_scale_characteristics_grouping_domain,
analysis %in% input$summarise_large_scale_characteristics_settings_analysis) |>
dplyr::filter(cdm_name %in% input$summarise_large_scale_characteristics_grouping_cdm_name ) |>
dplyr::filter(group_level %in% input$summarise_large_scale_characteristics_grouping_cohort_name) |>
dplyr::filter(variable_level %in% input$summarise_large_scale_characteristics_grouping_time_window)
Expand Down Expand Up @@ -1068,7 +1070,8 @@ server <- function(input, output, session) {
}
dataFiltered$summarise_large_scale_characteristics |>
filter(variable_level %in% input$compare_large_scale_characteristics_grouping_time_window) |>
filterSettings(table_name %in% input$compare_large_scale_characteristics_grouping_domain)
filterSettings(table_name %in% input$compare_large_scale_characteristics_grouping_domain,
analysis %in% input$compare_large_scale_characteristics_settings_analysis)

})

Expand Down
19 changes: 17 additions & 2 deletions inst/shiny/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,21 @@ ui <- bslib::page_navbar(
multiple = FALSE,
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3")
),

shinyWidgets::pickerInput(
inputId = "summarise_large_scale_characteristics_grouping_time_window",
label = "Time window",
choices = NULL,
selected = NULL,
multiple = FALSE,
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3")
),
shinyWidgets::pickerInput(
inputId = "summarise_large_scale_characteristics_settings_analysis",
label = "Concept type",
choices = NULL,
selected = NULL,
multiple = FALSE,
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3")
)
)
)
Expand Down Expand Up @@ -657,12 +664,20 @@ ui <- bslib::page_navbar(
),
shinyWidgets::pickerInput(
inputId = "compare_large_scale_characteristics_grouping_domain",
label = "Table",
label = "Domain",
choices = NULL,
selected = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3")
),
shinyWidgets::pickerInput(
inputId = "compare_large_scale_characteristics_settings_analysis",
label = "Concept type",
choices = NULL,
selected = NULL,
multiple = FALSE,
options = list(`actions-box` = TRUE, size = 10, `selected-text-format` = "count > 3")
),
shinyWidgets::prettyCheckbox(
inputId = "compare_large_scale_characteristics_impute_missings",
label = "Impute missing values as 0",
Expand Down

0 comments on commit 1cded1d

Please sign in to comment.