Skip to content

Commit

Permalink
Merge pull request #144 from OHDSI/matched_name
Browse files Browse the repository at this point in the history
matched names
  • Loading branch information
edward-burn authored Dec 3, 2024
2 parents 2855ba7 + 22f852f commit aadf419
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions inst/shiny/scripts/preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ if(nrow(data) == 0){
choices <- list()
} else{

# data <- data |>
# mutate(group_level = if_else(str_starts(group_level, "matched_to_"),
# str_replace(group_level, "^matched_to_", "") %>%
# paste0("_m1"),
# group_level)) |>
# mutate(group_level = if_else(str_detect(group_level, "_matched"),
# str_replace(group_level, "_matched", "") %>%
# paste0("_sample"),
# group_level))|>
# mutate(group_level = if_else(str_detect(group_level, "_m1"),
# str_replace(group_level, "_m1", "") %>%
# paste0("_matched"),
# group_level))
data <- data |>
mutate(group_level = if_else(str_starts(group_level, "matched_to_"),
str_replace(group_level, "^matched_to_", "") %>%
paste0("_m1"),
group_level)) |>
mutate(group_level = if_else(str_detect(group_level, "_matched"),
str_replace(group_level, "_matched", "") %>%
paste0("_sampled"),
group_level))|>
mutate(group_level = if_else(str_detect(group_level, "_m1"),
str_replace(group_level, "_m1", "") %>%
paste0("_matched"),
group_level))


# cli::cli_inform("Correcting settings")
Expand All @@ -50,7 +50,7 @@ if(nrow(data) == 0){
cli::cli_inform("Customising shiny app inputs")
# remove matched cohorts from choices
choices$summarise_characteristics_grouping_cohort_name <- choices$summarise_characteristics_grouping_cohort_name[
!stringr::str_detect(choices$summarise_characteristics_grouping_cohort_name, "matched")]
!stringr::str_detect(choices$summarise_characteristics_grouping_cohort_name, "matched|sampled")]

settingsUsed <- unique(settings(data) |> pull("result_type"))
dataFiltered <- list()
Expand Down
1 change: 1 addition & 0 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ server <- function(input, output, session) {
selectedCohorts <- c(
input$summarise_characteristics_grouping_cohort_name,
paste0("matched_to_", input$summarise_characteristics_grouping_cohort_name),
paste0(input$summarise_characteristics_grouping_cohort_name, "_sampled"),
paste0(input$summarise_characteristics_grouping_cohort_name, "_matched")
)
} else {
Expand Down

0 comments on commit aadf419

Please sign in to comment.