Skip to content

Commit

Permalink
some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-burn committed Nov 14, 2024
1 parent 9c969c1 commit d0311a9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 41 deletions.
57 changes: 28 additions & 29 deletions inst/shiny/scripts/preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ data <- omopgenerics::importSummarisedResult(file.path(getwd(),"data", "raw")) |
#
choices <- getChoices(data, flatten = TRUE)
#
# # 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")]
# 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")]
#
settingsUsed <- unique(settings(data) |> pull("result_type"))
dataFiltered <- list()
Expand All @@ -50,36 +50,35 @@ for(i in seq_along(settingsUsed)){
#
selected <- choices
#
# selected$summarise_characteristics_grouping_cohort_name <- selected$summarise_characteristics_grouping_cohort_name[1]
# selected$summarise_large_scale_characteristics_grouping_cohort_name <- selected$summarise_large_scale_characteristics_grouping_cohort_name[1]
selected$summarise_characteristics_grouping_cohort_name <- selected$summarise_characteristics_grouping_cohort_name[1]
selected$summarise_large_scale_characteristics_grouping_cohort_name <- selected$summarise_large_scale_characteristics_grouping_cohort_name[1]
#
# choices$cohort_code_use_grouping_cohort_name <- codeUseCohorts
# selected$cohort_code_use_grouping_cohort_name <- codeUseCohorts[1]
#
# choices$compare_large_scale_characteristics_grouping_cdm_name <- choices$summarise_large_scale_characteristics_grouping_cdm_name
# choices$compare_large_scale_characteristics_grouping_cohort_1 <- choices$summarise_large_scale_characteristics_grouping_cohort_name
# choices$compare_large_scale_characteristics_grouping_cohort_2 <- choices$summarise_large_scale_characteristics_grouping_cohort_name
# selected$compare_large_scale_characteristics_grouping_cdm_name <- choices$compare_large_scale_characteristics_grouping_cdm_name
# selected$compare_large_scale_characteristics_grouping_cohort_1 <- choices$compare_large_scale_characteristics_grouping_cohort_1[1]
# selected$compare_large_scale_characteristics_grouping_cohort_2 <- choices$compare_large_scale_characteristics_grouping_cohort_1[2]
#
# choices$summarise_large_scale_characteristics_grouping_domain <- settings(dataFiltered$summarise_large_scale_characteristics) |>
# pull("table_name")
# selected$summarise_large_scale_characteristics_grouping_domain <- choices$summarise_large_scale_characteristics_grouping_domain
#
# choices$summarise_large_scale_characteristics_grouping_time_window <- unique(dataFiltered$summarise_large_scale_characteristics |>
# pull("variable_level"))
# selected$summarise_large_scale_characteristics_grouping_time_window <-choices$summarise_large_scale_characteristics_grouping_time_window
#
# orphanCodelist <- unique(dataFiltered$orphan_code_use |>
# visOmopResults::splitAll() |> pull("codelist_name"))
# orphanCdm <- unique(dataFiltered$orphan_code_use |>
# visOmopResults::addSettings() |> pull("cdm_name"))
#
# choices$orphan_grouping_cdm_name <- orphanCdm
# choices$orphan_grouping_codelist_name <- orphanCodelist
# selected$orphan_grouping_cdm_name <- orphanCdm
# selected$orphan_grouping_cohort_name <- orphanCodelist[1]
choices$compare_large_scale_characteristics_grouping_cdm_name <- choices$summarise_large_scale_characteristics_grouping_cdm_name
choices$compare_large_scale_characteristics_grouping_cohort_1 <- choices$summarise_large_scale_characteristics_grouping_cohort_name
choices$compare_large_scale_characteristics_grouping_cohort_2 <- choices$summarise_large_scale_characteristics_grouping_cohort_name
selected$compare_large_scale_characteristics_grouping_cdm_name <- choices$compare_large_scale_characteristics_grouping_cdm_name
selected$compare_large_scale_characteristics_grouping_cohort_1 <- choices$compare_large_scale_characteristics_grouping_cohort_1[1]
selected$compare_large_scale_characteristics_grouping_cohort_2 <- choices$compare_large_scale_characteristics_grouping_cohort_1[2]

choices$summarise_large_scale_characteristics_grouping_domain <- settings(dataFiltered$summarise_large_scale_characteristics) |>
pull("table_name")
selected$summarise_large_scale_characteristics_grouping_domain <- choices$summarise_large_scale_characteristics_grouping_domain

choices$summarise_large_scale_characteristics_grouping_time_window <- unique(dataFiltered$summarise_large_scale_characteristics |>
pull("variable_level"))
selected$summarise_large_scale_characteristics_grouping_time_window <-choices$summarise_large_scale_characteristics_grouping_time_window

orphanCodelist <- unique(dataFiltered$orphan_code_use |>
visOmopResults::splitAll() |> pull("codelist_name"))
orphanCdm <- unique(dataFiltered$orphan_code_use |>
visOmopResults::addSettings() |> pull("cdm_name"))
choices$orphan_grouping_cdm_name <- orphanCdm
choices$orphan_grouping_codelist_name <- orphanCodelist
selected$orphan_grouping_cdm_name <- orphanCdm
selected$orphan_grouping_cohort_name <- orphanCodelist[1]
#
# unmappedCodelist <- unique(dataFiltered$unmapped_codes |>
# visOmopResults::splitAll() |> pull("codelist_name"))
Expand Down
1 change: 0 additions & 1 deletion inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,6 @@ server <- function(input, output, session) {
result <- dataFiltered$orphan_code_use |>
dplyr::filter(cdm_name %in% input$orphan_grouping_cdm_name,
group_level %in% input$orphan_grouping_codelist_name)

tbl <- CodelistGenerator::tableOrphanCodes(
result,
header = input$orphan_gt_99_header,
Expand Down
44 changes: 33 additions & 11 deletions inst/shiny/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
# Be careful editing this file

ui <- bslib::page_navbar(
theme = bs_theme(bootswatch = "zephyr"),

#minty pulse
theme = bs_theme(bootswatch = "pulse"),
# zephyr

title = "PhenotypeR",
bslib::nav_panel(
Expand All @@ -13,10 +12,11 @@ ui <- bslib::page_navbar(
shiny::includeMarkdown(path = "background.md")

),

# Database diagnostics -----
bslib::nav_menu(
title = "Database diagnostics",
icon = shiny::icon("list"),
## snapshot -----
bslib::nav_panel(
title = "Snapshot",
icon = shiny::icon("clipboard-list"),
Expand All @@ -39,6 +39,7 @@ ui <- bslib::page_navbar(
gt::gt_output("summarise_omop_snapshot_gt_17") |> withSpinner()
)
),
## observation periods -----
bslib::nav_panel(
title = "Observation periods",
icon = shiny::icon("eye"),
Expand All @@ -65,10 +66,17 @@ ui <- bslib::page_navbar(
)
)
),

# Codelist diagnostics -----
bslib::nav_menu(
title = "Codelist diagnostics",
icon = shiny::icon("list"),
## achilles code use -----
bslib::nav_panel(
title = "Achilles Code Use",
icon = shiny::icon("database")
),

## unmapped concepts -----
bslib::nav_panel(
title = "Unmapped concepts",
icon = shiny::icon("database"),
Expand Down Expand Up @@ -146,6 +154,7 @@ ui <- bslib::page_navbar(
)
),

## Orphan codes -----
bslib::nav_panel(
title = "Orphan codes",
icon = shiny::icon("circle-half-stroke"),
Expand Down Expand Up @@ -222,10 +231,13 @@ ui <- bslib::page_navbar(

),

# Cohort diagnostics -----

bslib::nav_menu(
title = "Cohort diagnostics",
icon = shiny::icon("list"),

## Cohort code use -----

bslib::nav_panel(
title = "Cohort code use",
Expand Down Expand Up @@ -319,7 +331,7 @@ ui <- bslib::page_navbar(
)
)
),

## Cohort characteristics -----
bslib::nav_panel(
title = "Cohort characteristics",
icon = shiny::icon("users-gear"),
Expand Down Expand Up @@ -375,9 +387,6 @@ ui <- bslib::page_navbar(
)
)
)



)
),
bslib::card(
Expand All @@ -400,6 +409,8 @@ ui <- bslib::page_navbar(
)
)
),
## Large scale characteristics -----

bslib::nav_panel(
title = "Large scale characteristics",
icon = shiny::icon("arrow-up-right-dots"),
Expand Down Expand Up @@ -531,6 +542,7 @@ ui <- bslib::page_navbar(
)
)
),
## Compare large scale characteristics -----
bslib::nav_panel(
title = "Compare large scale characteristics",
icon = shiny::icon("arrow-up-right-dots"),
Expand Down Expand Up @@ -570,8 +582,8 @@ ui <- bslib::page_navbar(
full_screen = TRUE,
plotly::plotlyOutput("plotly_compare_lsc") |> withSpinner()
)

)),
## Cohort overlap -----
bslib::nav_panel(
title = "Cohort overlap",
icon = shiny::icon("circle-half-stroke"),
Expand Down Expand Up @@ -742,9 +754,12 @@ ui <- bslib::page_navbar(
)
)
),

# Population diagnostics -----
bslib::nav_menu(
title = "Population diagnostics",
icon = shiny::icon("list"),
## Incidence -----
bslib::nav_panel(
title = "Incidence",
icon = shiny::icon("chart-line"),
Expand Down Expand Up @@ -918,7 +933,7 @@ ui <- bslib::page_navbar(
)
)
)
)
),
# ,
# bslib::nav_panel(
# title = "Attrition",
Expand Down Expand Up @@ -1136,6 +1151,12 @@ ui <- bslib::page_navbar(
# )
# )
# )

## Prevalence -----
bslib::nav_panel(
title = "Prevalence",
icon = shiny::icon("chart-line")
)
),
bslib::nav_spacer(),
bslib::nav_item(
Expand All @@ -1148,4 +1169,5 @@ ui <- bslib::page_navbar(
)
)
)
# end ------
)

0 comments on commit d0311a9

Please sign in to comment.