diff --git a/DESCRIPTION b/DESCRIPTION index b92c5b2..e86cd36 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: omopViewer +Package: OmopViewer Type: Package Title: Visualise OMOP Results in a Shiny App Version: 0.0.0.900 diff --git a/R/about.R b/R/about.R index 3290800..949f620 100644 --- a/R/about.R +++ b/R/about.R @@ -13,11 +13,11 @@ createAbout <- function(logo) { ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), - shiny::strong("v{as.character(utils::packageVersion("omopViewer"))}") + shiny::strong("v{as.character(utils::packageVersion("OmopViewer"))}") ) )' |> glue::glue() |> diff --git a/R/appDynamic.R b/R/appDynamic.R index 6f40956..0ed2cc0 100644 --- a/R/appDynamic.R +++ b/R/appDynamic.R @@ -14,7 +14,7 @@ createDynamicUi <- function(choices) { c( 'bslib::page_navbar(', c( - pageTitle("omopViewer App", logo), + pageTitle("OmopViewer App", logo), loadDataUi(), createUi(choices), 'bslib::nav_spacer()', @@ -174,13 +174,13 @@ messageProcessFiles <- function(x) { } mergeData <- function(newData, originalData) { if (is.null(newData)) return(originalData) - id0 <- getOption("omopViewer.number_ids", 0L) + id0 <- getOption("OmopViewer.number_ids", 0L) newData <- newData |> dplyr::mutate( id = .env$id0 + dplyr::row_number(), upload_datetime = Sys.time() |> format("%Y-%m-%d %H:%M:%S") ) - options("omopViewer.number_ids" = id0 + nrow(newData)) + options("OmopViewer.number_ids" = id0 + nrow(newData)) if (is.null(originalData)) { return(newData) } else { diff --git a/R/appStatic.R b/R/appStatic.R index b9d87dd..ba7e79e 100644 --- a/R/appStatic.R +++ b/R/appStatic.R @@ -139,8 +139,8 @@ exportStaticApp <- function(result, messageShiny <- function() { c( paste0( - "# Generated by omopViewer ", - as.character(utils::packageVersion("omopViewer")) + "# Generated by OmopViewer ", + as.character(utils::packageVersion("OmopViewer")) ), "# Be careful editing this file", "" @@ -179,7 +179,7 @@ logoPath <- function(logo) { lowLogo <- stringr::str_to_lower(logo) # add more logoKeywords in data-raw/internalData if (lowLogo %in% logoKeywords) { - system.file(file.path("logos", paste0(lowLogo, "_logo.svg")), package = "omopViewer") + system.file(file.path("logos", paste0(lowLogo, "_logo.svg")), package = "OmopViewer") } else { logo } diff --git a/R/background.R b/R/background.R index 51cbe59..633deb0 100644 --- a/R/background.R +++ b/R/background.R @@ -96,7 +96,7 @@ createBackground <- function(background) { 'bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") )' } diff --git a/R/createServer.R b/R/createServer.R index 277ef19..1dce8b5 100644 --- a/R/createServer.R +++ b/R/createServer.R @@ -22,7 +22,7 @@ selectiseServer <- function(resultTypes, data) { c( '# fill selectise variables ----', paste0('shiny::observe({ - choices <- omopViewer::getChoices(', data, ', flatten = TRUE) + choices <- OmopViewer::getChoices(', data, ', flatten = TRUE) for (k in seq_along(choices)) { shiny::updateSelectizeInput( session, diff --git a/R/panelFormatted.R b/R/panelFormatted.R index e492e10..c4bf81a 100644 --- a/R/panelFormatted.R +++ b/R/panelFormatted.R @@ -211,7 +211,7 @@ formattedServer <- function(rt, data) { c( 'getFormattedData[formatCamel(rt)] <- shiny::reactive({ [data] |> - omopViewer::filterData("[rt]", input) |> + OmopViewer::filterData("[rt]", input) |> [fun]( [args] ) diff --git a/R/panelPlot.R b/R/panelPlot.R index e4f4856..ac3de5d 100644 --- a/R/panelPlot.R +++ b/R/panelPlot.R @@ -108,7 +108,7 @@ plotsServer <- function(rt, data) { plotServer <- purrr::map_chr(plots, \(id) { c('createPlot[id] <- shiny::reactive({ result <- [data] |> - omopViewer::filterData("[rt]", input) + OmopViewer::filterData("[rt]", input) [createPlotFunction(id)] })', 'output$[rt]_plot_[id] <- [renderPlotFunction(id)]({ diff --git a/R/panelRaw.R b/R/panelRaw.R index 3158932..3822045 100644 --- a/R/panelRaw.R +++ b/R/panelRaw.R @@ -19,7 +19,7 @@ downloadRawDataServer <- function(data) { output$download_raw <- shiny::downloadHandler( filename = "results.csv", content = function(file) { - omopViewer::exportSummarisedResult([data], fileName = file) + OmopViewer::exportSummarisedResult([data], fileName = file) } )' |> glue::glue(.open = "[", .close = "]") |> diff --git a/R/panelTidy.R b/R/panelTidy.R index ad11acf..9740419 100644 --- a/R/panelTidy.R +++ b/R/panelTidy.R @@ -30,8 +30,8 @@ tidyUi <- function(tab) { tidyServer <- function(rt, data) { c(paste0('getTidyData', formatCamel(rt), ' <- shiny::reactive({ res <- ', data, ' |> - omopViewer::filterData("', rt, '", input) |> - omopViewer::tidyData() + OmopViewer::filterData("', rt, '", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) diff --git a/R/summary.R b/R/summary.R index 608147b..07001c3 100644 --- a/R/summary.R +++ b/R/summary.R @@ -146,6 +146,6 @@ summaryTab <- function(summary) { 'bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) )' } diff --git a/R/sysdata.rda b/R/sysdata.rda index d76c90d..8175877 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/README.Rmd b/README.Rmd index b934003..4c5e422 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,33 +13,33 @@ knitr::opts_chunk$set( ) ``` -# omopViewer +# OmopViewer -[![R-CMD-check](https://github.com/OHDSI/omopViewer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/OHDSI/omopViewer/actions/workflows/R-CMD-check.yaml) -[![CRAN status](https://www.r-pkg.org/badges/version/omopViewer)](https://CRAN.R-project.org/package=omopViewer) +[![R-CMD-check](https://github.com/OHDSI/OmopViewer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/OHDSI/OmopViewer/actions/workflows/R-CMD-check.yaml) +[![CRAN status](https://www.r-pkg.org/badges/version/OmopViewer)](https://CRAN.R-project.org/package=OmopViewer) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![Codecov test coverage](https://codecov.io/gh/OHDSI/omopViewer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OHDSI/omopViewer?branch=main) +[![Codecov test coverage](https://codecov.io/gh/OHDSI/OmopViewer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OHDSI/OmopViewer?branch=main) > [!IMPORTANT] > This package is under construction and this is just a first Beta release, please use it carefully and report any issue that you encounter using it. -The goal of omopViewer is to allow the user to easily create Shiny Apps to visualise study results in `` format. +The goal of OmopViewer is to allow the user to easily create Shiny Apps to visualise study results in `` format. ## Installation -You can install the development version of omopViewer from [GitHub](https://github.com/OHDSI/omopViewer) with: +You can install the development version of OmopViewer from [GitHub](https://github.com/OHDSI/OmopViewer) with: ``` {r, eval = FALSE} install.packages("pak") -pak::pkg_install("OHDSI/omopViewer") +pak::pkg_install("OHDSI/OmopViewer") ``` ## Main functionalities ```{r} -library(omopViewer) +library(OmopViewer) ``` The package can be divided in 3 main functionalities: diff --git a/README.md b/README.md index aab003c..fb4b506 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,40 @@ -# omopViewer +# OmopViewer -[![R-CMD-check](https://github.com/OHDSI/omopViewer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/OHDSI/omopViewer/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/OHDSI/OmopViewer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/OHDSI/OmopViewer/actions/workflows/R-CMD-check.yaml) [![CRAN -status](https://www.r-pkg.org/badges/version/omopViewer)](https://CRAN.R-project.org/package=omopViewer) +status](https://www.r-pkg.org/badges/version/OmopViewer)](https://CRAN.R-project.org/package=OmopViewer) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Codecov test -coverage](https://codecov.io/gh/OHDSI/omopViewer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OHDSI/omopViewer?branch=main) +coverage](https://codecov.io/gh/OHDSI/OmopViewer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OHDSI/OmopViewer?branch=main) > \[!IMPORTANT\] This package is under construction and this is just a > first Beta release, please use it carefully and report any issue that > you encounter using it. -The goal of omopViewer is to allow the user to easily create Shiny Apps +The goal of OmopViewer is to allow the user to easily create Shiny Apps to visualise study results in `` format. ## Installation -You can install the development version of omopViewer from -[GitHub](https://github.com/OHDSI/omopViewer) with: +You can install the development version of OmopViewer from +[GitHub](https://github.com/OHDSI/OmopViewer) with: ``` r install.packages("pak") -pak::pkg_install("OHDSI/omopViewer") +pak::pkg_install("OHDSI/OmopViewer") ``` ## Main functionalities ``` r -library(omopViewer) +library(OmopViewer) ``` The package can be divided in 3 main functionalities: - Static shiny @@ -50,9 +50,6 @@ results and can be modified later locally. # lets generate some results library(CohortCharacteristics) cdm <- mockCohortCharacteristics() -#> Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable', -#> target signature 'duckdb_connection#Id'. -#> "duckdb_connection#ANY" would also be valid result <- summariseCharacteristics(cdm$cohort1) |> bind(summariseCohortAttrition(cdm$cohort1)) #> ℹ adding demographics columns @@ -60,12 +57,11 @@ result <- summariseCharacteristics(cdm$cohort1) |> #> ✔ summariseCharacteristics finished! exportStaticApp(result = result) -#> ℹ shiny folder will be overwritten. #> ℹ Processing data #> ✔ Data processed: 2 result types idenfied: `summarise_characteristics` and #> `summarise_cohort_attrition`. #> ℹ Creating shiny from provided data -#> ✔ Shiny created in: /Users/martics/Documents/GitHub/omopViewer/shiny +#> ✔ Shiny created in: C:/Users/martics/Documents/GitHub/omopViewer/shiny ``` ## Dynamic shiny app diff --git a/data-raw/internalData.R b/data-raw/internalData.R index 70c02fb..863b2c7 100644 --- a/data-raw/internalData.R +++ b/data-raw/internalData.R @@ -45,7 +45,7 @@ omopViewerPlotArguments <- dplyr::tribble( omopViewerTables <- dplyr::tribble( ~table_id, ~result_tab_id, ~title, ~fun, ~output, - 0L, 0L, "Formatted", "omopViewer::omopViewerTable", "gt", + 0L, 0L, "Formatted", "OmopViewer::omopViewerTable", "gt", 1L, 1L, "Table cohort overlap", "tableCohortOverlap", "gt", 2L, 2L, "Table cohort attrition", "tableCohortAttrition", "gt", 3L, 3L, "Table cohort timing", "tableCohortTiming", "gt", @@ -127,8 +127,8 @@ omopViewerProj <- c( ) omopViewerGlobal <- c( - "data <- omopViewer::importSummarisedResult(here::here(\"data\")) |>", - "omopViewer::correctSettings()" + "data <- OmopViewer::importSummarisedResult(here::here(\"data\")) |>", + "OmopViewer::correctSettings()" ) |> styleCode() diff --git a/man/omopViewer-package.Rd b/man/omopViewer-package.Rd deleted file mode 100644 index 82adbc8..0000000 --- a/man/omopViewer-package.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/omopViewer-package.R -\docType{package} -\name{omopViewer-package} -\alias{omopViewer} -\alias{omopViewer-package} -\title{omopViewer: Visualise OMOP Results in a Shiny App} -\description{ -Visualise results obtained from analysing data mapped to the Observational Medical Outcomes Partnership (OMOP) common data model using Shiny Apps. -} -\seealso{ -Useful links: -\itemize{ - \item \url{https://ohdsi.github.io/OmopViewer/} -} - -} -\author{ -\strong{Maintainer}: Martí Català \email{marti.catalasabate@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0003-3308-9905}{ORCID}) - -Authors: -\itemize{ - \item Yuchen Guo \email{yuchen.guo@ndorms.ox.ac.uk} (\href{https://orcid.org/0000-0002-0847-4855}{ORCID}) -} - -} -\keyword{internal} diff --git a/tests/testthat.R b/tests/testthat.R index f726635..0b5d933 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -7,6 +7,6 @@ # * https://testthat.r-lib.org/articles/special-files.html library(testthat) -library(omopViewer) +library(OmopViewer) -test_check("omopViewer") +test_check("OmopViewer") diff --git a/tests/testthat/_snaps/appStatic.md b/tests/testthat/_snaps/appStatic.md index 6e27f6e..82e0706 100644 --- a/tests/testthat/_snaps/appStatic.md +++ b/tests/testthat/_snaps/appStatic.md @@ -17,7 +17,7 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_spacer(), bslib::nav_item( @@ -43,8 +43,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -63,7 +63,7 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_spacer(), bslib::nav_item( @@ -89,8 +89,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -109,7 +109,7 @@ output$download_raw <- shiny::downloadHandler( filename = "results.csv", content = function(file) { - omopViewer::exportSummarisedResult(data, fileName = file) + OmopViewer::exportSummarisedResult(data, fileName = file) } ) } @@ -119,7 +119,7 @@ Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -136,12 +136,12 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) ), bslib::nav_spacer(), bslib::nav_item( @@ -167,8 +167,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -182,7 +182,7 @@ Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -199,12 +199,12 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) ), bslib::nav_panel( title = c("Cohort count"), @@ -822,8 +822,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -837,7 +837,7 @@ Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -854,12 +854,12 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) ), bslib::nav_panel( title = c("Cohort overlap"), @@ -1477,8 +1477,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -1492,7 +1492,7 @@ Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -1509,12 +1509,12 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) ), bslib::nav_menu( title = c("DETAILS"), @@ -2136,8 +2136,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") diff --git a/tests/testthat/_snaps/background.md b/tests/testthat/_snaps/background.md index a648a54..52abc0e 100644 --- a/tests/testthat/_snaps/background.md +++ b/tests/testthat/_snaps/background.md @@ -6,7 +6,7 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ) --- diff --git a/tests/testthat/_snaps/packagesSupported.md b/tests/testthat/_snaps/packagesSupported.md index fe2987a..8064cb9 100644 --- a/tests/testthat/_snaps/packagesSupported.md +++ b/tests/testthat/_snaps/packagesSupported.md @@ -3,7 +3,7 @@ Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -20,12 +20,12 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = "Summary", icon = shiny::icon("file-alt"), - omopViewer::cardSummary(data) + OmopViewer::cardSummary(data) ), bslib::nav_panel( title = c("Cohort characteristics"), @@ -1280,8 +1280,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -1295,7 +1295,7 @@ Code cat(server, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file server <- function(input, output, session) { @@ -1303,12 +1303,12 @@ output$download_raw <- shiny::downloadHandler( filename = "results.csv", content = function(file) { - omopViewer::exportSummarisedResult(data, fileName = file) + OmopViewer::exportSummarisedResult(data, fileName = file) } ) # fill selectise variables ---- shiny::observe({ - choices <- omopViewer::getChoices(data, flatten = TRUE) + choices <- OmopViewer::getChoices(data, flatten = TRUE) for (k in seq_along(choices)) { shiny::updateSelectizeInput( session, @@ -1323,8 +1323,8 @@ ## tidy summarise_characteristics ----- getTidyDataSummariseCharacteristics <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_characteristics", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_characteristics", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1364,7 +1364,7 @@ ## formatted summarise_characteristics ----- getFormattedDataSummariseCharacteristics <- shiny::reactive({ data |> - omopViewer::filterData("summarise_characteristics", input) |> + OmopViewer::filterData("summarise_characteristics", input) |> CohortCharacteristics::tableCharacteristics( header = input$summarise_characteristics_formatted_4_header, groupColumn = input$summarise_characteristics_formatted_4_groupColumn, @@ -1386,7 +1386,7 @@ ## plot summarise_characteristics ----- createPlot4 <- shiny::reactive({ result <- data |> - omopViewer::filterData("summarise_characteristics", input) + OmopViewer::filterData("summarise_characteristics", input) CohortCharacteristics::plotCharacteristics( result, plotStyle = input$summarise_characteristics_plot_4_plot_style, @@ -1416,8 +1416,8 @@ ## tidy summarise_cohort_attrition ----- getTidyDataSummariseCohortAttrition <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_cohort_attrition", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_cohort_attrition", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1457,7 +1457,7 @@ ## formatted summarise_cohort_attrition ----- getFormattedDataSummariseCohortAttrition <- shiny::reactive({ data |> - omopViewer::filterData("summarise_cohort_attrition", input) |> + OmopViewer::filterData("summarise_cohort_attrition", input) |> CohortCharacteristics::tableCohortAttrition( header = input$summarise_cohort_attrition_formatted_2_header, groupColumn = input$summarise_cohort_attrition_formatted_2_groupColumn, @@ -1479,7 +1479,7 @@ ## plot summarise_cohort_attrition ----- createPlot2 <- shiny::reactive({ result <- data |> - omopViewer::filterData("summarise_cohort_attrition", input) + OmopViewer::filterData("summarise_cohort_attrition", input) CohortCharacteristics::plotCohortAttrition( result ) @@ -1504,8 +1504,8 @@ ## tidy summarise_cohort_count ----- getTidyDataSummariseCohortCount <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_cohort_count", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_cohort_count", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1545,7 +1545,7 @@ ## formatted summarise_cohort_count ----- getFormattedDataSummariseCohortCount <- shiny::reactive({ data |> - omopViewer::filterData("summarise_cohort_count", input) |> + OmopViewer::filterData("summarise_cohort_count", input) |> CohortCharacteristics::tableCohortCount( header = input$summarise_cohort_count_formatted_5_header, groupColumn = input$summarise_cohort_count_formatted_5_groupColumn, @@ -1567,7 +1567,7 @@ ## plot summarise_cohort_count ----- createPlot5 <- shiny::reactive({ result <- data |> - omopViewer::filterData("summarise_cohort_count", input) + OmopViewer::filterData("summarise_cohort_count", input) CohortCharacteristics::plotCohortCount( result, facet = input$summarise_cohort_count_plot_5_facet, @@ -1596,8 +1596,8 @@ ## tidy summarise_cohort_overlap ----- getTidyDataSummariseCohortOverlap <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_cohort_overlap", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_cohort_overlap", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1637,7 +1637,7 @@ ## formatted summarise_cohort_overlap ----- getFormattedDataSummariseCohortOverlap <- shiny::reactive({ data |> - omopViewer::filterData("summarise_cohort_overlap", input) |> + OmopViewer::filterData("summarise_cohort_overlap", input) |> CohortCharacteristics::tableCohortOverlap( uniqueCombinations = input$summarise_cohort_overlap_formatted_1_uniqueCombinations, header = input$summarise_cohort_overlap_formatted_1_header, @@ -1660,7 +1660,7 @@ ## plot summarise_cohort_overlap ----- createPlot1 <- shiny::reactive({ result <- data |> - omopViewer::filterData("summarise_cohort_overlap", input) + OmopViewer::filterData("summarise_cohort_overlap", input) CohortCharacteristics::plotCohortOverlap( result, facet = input$summarise_cohort_overlap_plot_1_facet, @@ -1689,8 +1689,8 @@ ## tidy summarise_cohort_timing ----- getTidyDataSummariseCohortTiming <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_cohort_timing", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_cohort_timing", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1730,7 +1730,7 @@ ## formatted summarise_cohort_timing ----- getFormattedDataSummariseCohortTiming <- shiny::reactive({ data |> - omopViewer::filterData("summarise_cohort_timing", input) |> + OmopViewer::filterData("summarise_cohort_timing", input) |> CohortCharacteristics::tableCohortTiming( uniqueCombinations = input$summarise_cohort_timing_formatted_3_uniqueCombinations, timeScale = input$summarise_cohort_timing_formatted_3_timeScale, @@ -1754,7 +1754,7 @@ ## plot summarise_cohort_timing ----- createPlot3 <- shiny::reactive({ result <- data |> - omopViewer::filterData("summarise_cohort_timing", input) + OmopViewer::filterData("summarise_cohort_timing", input) CohortCharacteristics::plotCohortTiming( result, plotType = input$summarise_cohort_timing_plot_3_plot_type, @@ -1786,8 +1786,8 @@ ## tidy summarise_large_scale_characteristics ----- getTidyDataSummariseLargeScaleCharacteristics <- shiny::reactive({ res <- data |> - omopViewer::filterData("summarise_large_scale_characteristics", input) |> - omopViewer::tidyData() + OmopViewer::filterData("summarise_large_scale_characteristics", input) |> + OmopViewer::tidyData() # columns to eliminate colsEliminate <- colnames(res) @@ -1827,8 +1827,8 @@ ## formatted summarise_large_scale_characteristics ----- getFormattedDataSummariseLargeScaleCharacteristics <- shiny::reactive({ data |> - omopViewer::filterData("summarise_large_scale_characteristics", input) |> - omopViewer::omopViewerTable( + OmopViewer::filterData("summarise_large_scale_characteristics", input) |> + OmopViewer::omopViewerTable( header = input$summarise_large_scale_characteristics_formatted_0_header, group = input$summarise_large_scale_characteristics_formatted_0_group, hide = input$summarise_large_scale_characteristics_formatted_0_hide @@ -1854,32 +1854,32 @@ Code cat(global, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file library(CohortCharacteristics) library(DT) library(DiagrammeR) + library(OmopViewer) library(bslib) library(dplyr) library(ggplot2) library(gt) library(here) - library(omopViewer) library(readr) library(shiny) library(sortable) library(visOmopResults) - data <- omopViewer::importSummarisedResult(here::here("data")) |> - omopViewer::correctSettings() + data <- OmopViewer::importSummarisedResult(here::here("data")) |> + OmopViewer::correctSettings() --- Code cat(ui, sep = "\n") Output - # Generated by omopViewer 0.0.0.900 + # Generated by OmopViewer 0.0.0.900 # Be careful editing this file ui <- bslib::page_navbar( @@ -1896,7 +1896,7 @@ bslib::nav_panel( title = "Background", icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") + OmopViewer::cardFromMd("background.md") ), bslib::nav_panel( title = c("Cohort characteristics"), @@ -3151,8 +3151,8 @@ ), "This shiny app was generated with ", shiny::a( - "omopViewer", - href = "https://github.com/OHDSI/omopViewer", + "OmopViewer", + href = "https://github.com/OHDSI/OmopViewer", target = "_blank" ), shiny::strong("v0.0.0.900") @@ -3161,1082 +3161,3 @@ bslib::nav_item(bslib::input_dark_mode(id = "dark_mode", mode = "light")) ) -# CodelistGenerator shiny - - Code - cat(ui, 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 = "ohdsi_logo.svg", - width = "auto", - height = "46px", - class = "me-3", - alt = "logo" - ), - "" - ), - bslib::nav_panel( - title = "Background", - icon = shiny::icon("disease"), - omopViewer::cardFromMd("background.md") - ), - bslib::nav_panel( - title = c("Orphan codes"), - icon = shiny::icon("magnifying-glass-arrow-right"), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - bslib::accordion( - bslib::accordion_panel( - title = "Information", - icon = shiny::icon("info"), - shiny::p("") - ), - bslib::accordion_panel( - title = "grouping", - shiny::selectizeInput( - inputId = "orphan_code_use_grouping_cdm_name", - label = "Cdm name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "orphan_code_use_grouping_codelist_name", - label = "Codelist name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "orphan_code_use_grouping_domain_id", - label = "Domain id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "orphan_code_use_grouping_standard_concept", - label = "Standard concept", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "orphan_code_use_grouping_vocabulary_id", - label = "Vocabulary id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Variables", - shiny::selectizeInput( - inputId = "orphan_code_use_variable_name", - label = "Variable name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Estimates", - shiny::selectizeInput( - inputId = "orphan_code_use_estimate_name", - label = "Estimate name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ) - ) - ), - bslib::navset_card_tab( - bslib::nav_panel( - title = "Tidy", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::downloadButton(outputId = "orphan_code_use_tidy_download", label = "Download csv") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - shiny::selectizeInput( - inputId = "orphan_code_use_tidy_columns", - label = "Columns", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::radioButtons( - inputId = "orphan_code_use_tidy_pivot", - label = "Pivot estimates/variables", - choices = c("none", "estimates", "estimates and variables"), - selected = "none" - ), - position = "right" - ), - DT::dataTableOutput("orphan_code_use_tidy") - ) - ) - ), - bslib::nav_panel( - title = "Table orphan codes", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::selectizeInput( - inputId = "orphan_code_use_formatted_download_6_type", - label = "File", - choices = c("docx", "png", "pdf", "html"), - selected = c("docx"), - multiple = FALSE, - options = list(plugins = "remove_button") - ), - shiny::downloadButton(outputId = "orphan_code_use_formatted_download_6", label = "Download") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - sortable::bucket_list( - header = NULL, - sortable::add_rank_list( - text = c("none"), - labels = c("codelist_name", "domain_id", "standard_concept", "vocabulary_id", "variable_name", "variable_level"), - input_id = "orphan_code_use_formatted_6_none" - ), - sortable::add_rank_list( - text = c("header"), - labels = c("cdm_name", "estimate_name"), - input_id = "orphan_code_use_formatted_6_header" - ), - sortable::add_rank_list( - text = c("groupColumn"), - labels = NULL, - input_id = "orphan_code_use_formatted_6_groupColumn" - ), - sortable::add_rank_list( - text = c("hide"), - labels = NULL, - input_id = "orphan_code_use_formatted_6_hide" - ) - ), - position = "right" - ), - gt::gt_output("orphan_code_use_formatted_6") - ) - ) - ), - ) - ) - ), - bslib::nav_panel( - title = c("Cohort code use"), - icon = shiny::icon("chart-column"), - 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 = "cohort_code_use_settings_timing", - label = "Timing", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "grouping", - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_cdm_name", - label = "Cdm name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_cohort_name", - label = "Cohort name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_codelist_name", - label = "Codelist name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_source_concept_name", - label = "Source concept name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_source_concept_id", - label = "Source concept id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "cohort_code_use_grouping_domain_id", - label = "Domain id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Variables", - shiny::selectizeInput( - inputId = "cohort_code_use_variable_name", - label = "Variable name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Estimates", - shiny::selectizeInput( - inputId = "cohort_code_use_estimate_name", - label = "Estimate name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ) - ) - ), - bslib::navset_card_tab( - bslib::nav_panel( - title = "Tidy", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::downloadButton(outputId = "cohort_code_use_tidy_download", label = "Download csv") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - shiny::selectizeInput( - inputId = "cohort_code_use_tidy_columns", - label = "Columns", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::radioButtons( - inputId = "cohort_code_use_tidy_pivot", - label = "Pivot estimates/variables", - choices = c("none", "estimates", "estimates and variables"), - selected = "none" - ), - position = "right" - ), - DT::dataTableOutput("cohort_code_use_tidy") - ) - ) - ), - bslib::nav_panel( - title = "Table cohort code use", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::selectizeInput( - inputId = "cohort_code_use_formatted_download_7_type", - label = "File", - choices = c("docx", "png", "pdf", "html"), - selected = c("docx"), - multiple = FALSE, - options = list(plugins = "remove_button") - ), - shiny::downloadButton(outputId = "cohort_code_use_formatted_download_7", label = "Download") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - shiny::checkboxInput( - inputId = "cohort_code_use_formatted_7_timing", - label = "timing", - value = c(FALSE) - ), - sortable::bucket_list( - header = NULL, - sortable::add_rank_list( - text = c("none"), - labels = c("cohort_name", "codelist_name", "source_concept_name", "source_concept_id", "domain_id", "variable_name", "variable_level"), - input_id = "cohort_code_use_formatted_7_none" - ), - sortable::add_rank_list( - text = c("header"), - labels = c("cdm_name", "estimate_name"), - input_id = "cohort_code_use_formatted_7_header" - ), - sortable::add_rank_list( - text = c("groupColumn"), - labels = NULL, - input_id = "cohort_code_use_formatted_7_groupColumn" - ), - sortable::add_rank_list( - text = c("hide"), - labels = NULL, - input_id = "cohort_code_use_formatted_7_hide" - ) - ), - position = "right" - ), - gt::gt_output("cohort_code_use_formatted_7") - ) - ) - ), - ) - ) - ), - bslib::nav_panel( - title = c("Code use"), - icon = shiny::icon("chart-column"), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - bslib::accordion( - bslib::accordion_panel( - title = "Information", - icon = shiny::icon("info"), - shiny::p("") - ), - bslib::accordion_panel( - title = "grouping", - shiny::selectizeInput( - inputId = "code_use_grouping_cdm_name", - label = "Cdm name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_codelist_name", - label = "Codelist name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_year", - label = "Year", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_sex", - label = "Sex", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_source_concept_name", - label = "Source concept name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_source_concept_id", - label = "Source concept id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "code_use_grouping_domain_id", - label = "Domain id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Variables", - shiny::selectizeInput( - inputId = "code_use_variable_name", - label = "Variable name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Estimates", - shiny::selectizeInput( - inputId = "code_use_estimate_name", - label = "Estimate name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ) - ) - ), - bslib::navset_card_tab( - bslib::nav_panel( - title = "Tidy", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::downloadButton(outputId = "code_use_tidy_download", label = "Download csv") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - shiny::selectizeInput( - inputId = "code_use_tidy_columns", - label = "Columns", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::radioButtons( - inputId = "code_use_tidy_pivot", - label = "Pivot estimates/variables", - choices = c("none", "estimates", "estimates and variables"), - selected = "none" - ), - position = "right" - ), - DT::dataTableOutput("code_use_tidy") - ) - ) - ), - bslib::nav_panel( - title = "Table code use", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::selectizeInput( - inputId = "code_use_formatted_download_8_type", - label = "File", - choices = c("docx", "png", "pdf", "html"), - selected = c("docx"), - multiple = FALSE, - options = list(plugins = "remove_button") - ), - shiny::downloadButton(outputId = "code_use_formatted_download_8", label = "Download") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - sortable::bucket_list( - header = NULL, - sortable::add_rank_list( - text = c("none"), - labels = c("codelist_name", "year", "sex", "source_concept_name", "source_concept_id", "domain_id", "variable_name", "variable_level"), - input_id = "code_use_formatted_8_none" - ), - sortable::add_rank_list( - text = c("header"), - labels = c("cdm_name", "estimate_name"), - input_id = "code_use_formatted_8_header" - ), - sortable::add_rank_list( - text = c("groupColumn"), - labels = NULL, - input_id = "code_use_formatted_8_groupColumn" - ), - sortable::add_rank_list( - text = c("hide"), - labels = NULL, - input_id = "code_use_formatted_8_hide" - ) - ), - position = "right" - ), - gt::gt_output("code_use_formatted_8") - ) - ) - ), - ) - ) - ), - bslib::nav_panel( - title = c("Achilles code use"), - icon = shiny::icon("chart-column"), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - bslib::accordion( - bslib::accordion_panel( - title = "Information", - icon = shiny::icon("info"), - shiny::p("") - ), - bslib::accordion_panel( - title = "grouping", - shiny::selectizeInput( - inputId = "achilles_code_use_grouping_cdm_name", - label = "Cdm name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "achilles_code_use_grouping_codelist_name", - label = "Codelist name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "achilles_code_use_grouping_domain_id", - label = "Domain id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "achilles_code_use_grouping_standard_concept", - label = "Standard concept", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::selectizeInput( - inputId = "achilles_code_use_grouping_vocabulary_id", - label = "Vocabulary id", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Variables", - shiny::selectizeInput( - inputId = "achilles_code_use_variable_name", - label = "Variable name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ), - bslib::accordion_panel( - title = "Estimates", - shiny::selectizeInput( - inputId = "achilles_code_use_estimate_name", - label = "Estimate name", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ) - ) - ) - ), - bslib::navset_card_tab( - bslib::nav_panel( - title = "Tidy", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::downloadButton(outputId = "achilles_code_use_tidy_download", label = "Download csv") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - shiny::selectizeInput( - inputId = "achilles_code_use_tidy_columns", - label = "Columns", - choices = NULL, - selected = NULL, - multiple = TRUE, - options = list(plugins = "remove_button") - ), - shiny::radioButtons( - inputId = "achilles_code_use_tidy_pivot", - label = "Pivot estimates/variables", - choices = c("none", "estimates", "estimates and variables"), - selected = "none" - ), - position = "right" - ), - DT::dataTableOutput("achilles_code_use_tidy") - ) - ) - ), - bslib::nav_panel( - title = "Table achilles code use", - bslib::card( - full_screen = TRUE, - bslib::card_header( - bslib::popover( - shiny::icon("download"), - shiny::selectizeInput( - inputId = "achilles_code_use_formatted_download_9_type", - label = "File", - choices = c("docx", "png", "pdf", "html"), - selected = c("docx"), - multiple = FALSE, - options = list(plugins = "remove_button") - ), - shiny::downloadButton(outputId = "achilles_code_use_formatted_download_9", label = "Download") - ), - class = "text-end" - ), - bslib::layout_sidebar( - sidebar = bslib::sidebar( - sortable::bucket_list( - header = NULL, - sortable::add_rank_list( - text = c("none"), - labels = c("codelist_name", "domain_id", "standard_concept", "vocabulary_id", "variable_name", "variable_level"), - input_id = "achilles_code_use_formatted_9_none" - ), - sortable::add_rank_list( - text = c("header"), - labels = c("cdm_name", "estimate_name"), - input_id = "achilles_code_use_formatted_9_header" - ), - sortable::add_rank_list( - text = c("groupColumn"), - labels = NULL, - input_id = "achilles_code_use_formatted_9_groupColumn" - ), - sortable::add_rank_list( - text = c("hide"), - labels = NULL, - input_id = "achilles_code_use_formatted_9_hide" - ) - ), - position = "right" - ), - gt::gt_output("achilles_code_use_formatted_9") - ) - ) - ), - ) - ) - ), - bslib::nav_spacer(), - bslib::nav_item( - bslib::popover( - shiny::icon("download"), - shiny::downloadButton( - outputId = "download_raw", - label = "Download raw data", - icon = shiny::icon("download") - ) - ) - ), - 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/OHDSI/omopViewer", - target = "_blank" - ), - shiny::strong("v0.0.0.900") - ) - ), - bslib::nav_item(bslib::input_dark_mode(id = "dark_mode", mode = "light")) - ) - ---- - - Code - cat(server, sep = "\n") - Output - # Generated by omopViewer 0.0.0.900 - # Be careful editing this file - - server <- function(input, output, session) { - # download raw data ----- - output$download_raw <- shiny::downloadHandler( - filename = "results.csv", - content = function(file) { - omopViewer::exportSummarisedResult(data, fileName = file) - } - ) - # fill selectise variables ---- - shiny::observe({ - choices <- omopViewer::getChoices(data, flatten = TRUE) - for (k in seq_along(choices)) { - shiny::updateSelectizeInput( - session, - inputId = names(choices)[k], - choices = choices[[k]], - selected = choices[[k]], - server = TRUE - ) - } - }) - # orphan_code_use ----- - ## tidy orphan_code_use ----- - getTidyDataOrphanCodeUse <- shiny::reactive({ - res <- data |> - omopViewer::filterData("orphan_code_use", input) |> - omopViewer::tidyData() - - # columns to eliminate - colsEliminate <- colnames(res) - colsEliminate <- colsEliminate[!colsEliminate %in% c( - input$orphan_code_use_tidy_columns, "variable_name", "variable_level", - "estimate_name", "estimate_type", "estimate_value" - )] - - # pivot - pivot <- input$orphan_code_use_tidy_pivot - if (pivot != "none") { - vars <- switch(pivot, - "estimates" = "estimate_name", - "estimates and variables" = c("variable_name", "variable_level", "estimate_name") - ) - res <- res |> - visOmopResults::pivotEstimates(pivotEstimatesBy = vars) - } - - res |> - dplyr::select(!dplyr::all_of(colsEliminate)) - }) - output$orphan_code_use_tidy <- DT::renderDT({ - DT::datatable( - getTidyDataOrphanCodeUse(), - options = list(scrollX = TRUE), - rownames = FALSE - ) - }) - output$orphan_code_use_tidy_download <- shiny::downloadHandler( - filename = "tidy_orphan_code_use.csv", - content = function(file) { - getTidyDataOrphanCodeUse() |> - readr::write_csv(file = file) - } - ) - ## formatted orphan_code_use ----- - getFormattedDataOrphanCodeUse <- shiny::reactive({ - data |> - omopViewer::filterData("orphan_code_use", input) |> - CodelistGenerator::tableOrphanCodes( - header = input$orphan_code_use_formatted_6_header, - groupColumn = input$orphan_code_use_formatted_6_groupColumn, - hide = input$orphan_code_use_formatted_6_hide - ) - }) - output$orphan_code_use_formatted_6 <- gt::render_gt({ - getFormattedDataOrphanCodeUse() - }) - output$orphan_code_use_formatted_download_6 <- shiny::downloadHandler( - filename = function() { - paste0("formatted_orphan_code_use.", input$orphan_code_use_formatted_download_6_type) - }, - content = function(file) { - getFormattedDataOrphanCodeUse() |> - gt::gtsave(filename = file) - } - ) - ## plot orphan_code_use ----- - - - # cohort_code_use ----- - ## tidy cohort_code_use ----- - getTidyDataCohortCodeUse <- shiny::reactive({ - res <- data |> - omopViewer::filterData("cohort_code_use", input) |> - omopViewer::tidyData() - - # columns to eliminate - colsEliminate <- colnames(res) - colsEliminate <- colsEliminate[!colsEliminate %in% c( - input$cohort_code_use_tidy_columns, "variable_name", "variable_level", - "estimate_name", "estimate_type", "estimate_value" - )] - - # pivot - pivot <- input$cohort_code_use_tidy_pivot - if (pivot != "none") { - vars <- switch(pivot, - "estimates" = "estimate_name", - "estimates and variables" = c("variable_name", "variable_level", "estimate_name") - ) - res <- res |> - visOmopResults::pivotEstimates(pivotEstimatesBy = vars) - } - - res |> - dplyr::select(!dplyr::all_of(colsEliminate)) - }) - output$cohort_code_use_tidy <- DT::renderDT({ - DT::datatable( - getTidyDataCohortCodeUse(), - options = list(scrollX = TRUE), - rownames = FALSE - ) - }) - output$cohort_code_use_tidy_download <- shiny::downloadHandler( - filename = "tidy_cohort_code_use.csv", - content = function(file) { - getTidyDataCohortCodeUse() |> - readr::write_csv(file = file) - } - ) - ## formatted cohort_code_use ----- - getFormattedDataCohortCodeUse <- shiny::reactive({ - data |> - omopViewer::filterData("cohort_code_use", input) |> - CodelistGenerator::tableCohortCodeUse( - timing = input$cohort_code_use_formatted_7_timing, - header = input$cohort_code_use_formatted_7_header, - groupColumn = input$cohort_code_use_formatted_7_groupColumn, - hide = input$cohort_code_use_formatted_7_hide - ) - }) - output$cohort_code_use_formatted_7 <- gt::render_gt({ - getFormattedDataCohortCodeUse() - }) - output$cohort_code_use_formatted_download_7 <- shiny::downloadHandler( - filename = function() { - paste0("formatted_cohort_code_use.", input$cohort_code_use_formatted_download_7_type) - }, - content = function(file) { - getFormattedDataCohortCodeUse() |> - gt::gtsave(filename = file) - } - ) - ## plot cohort_code_use ----- - - - # code_use ----- - ## tidy code_use ----- - getTidyDataCodeUse <- shiny::reactive({ - res <- data |> - omopViewer::filterData("code_use", input) |> - omopViewer::tidyData() - - # columns to eliminate - colsEliminate <- colnames(res) - colsEliminate <- colsEliminate[!colsEliminate %in% c( - input$code_use_tidy_columns, "variable_name", "variable_level", - "estimate_name", "estimate_type", "estimate_value" - )] - - # pivot - pivot <- input$code_use_tidy_pivot - if (pivot != "none") { - vars <- switch(pivot, - "estimates" = "estimate_name", - "estimates and variables" = c("variable_name", "variable_level", "estimate_name") - ) - res <- res |> - visOmopResults::pivotEstimates(pivotEstimatesBy = vars) - } - - res |> - dplyr::select(!dplyr::all_of(colsEliminate)) - }) - output$code_use_tidy <- DT::renderDT({ - DT::datatable( - getTidyDataCodeUse(), - options = list(scrollX = TRUE), - rownames = FALSE - ) - }) - output$code_use_tidy_download <- shiny::downloadHandler( - filename = "tidy_code_use.csv", - content = function(file) { - getTidyDataCodeUse() |> - readr::write_csv(file = file) - } - ) - ## formatted code_use ----- - getFormattedDataCodeUse <- shiny::reactive({ - data |> - omopViewer::filterData("code_use", input) |> - CodelistGenerator::tableCodeUse( - header = input$code_use_formatted_8_header, - groupColumn = input$code_use_formatted_8_groupColumn, - hide = input$code_use_formatted_8_hide - ) - }) - output$code_use_formatted_8 <- gt::render_gt({ - getFormattedDataCodeUse() - }) - output$code_use_formatted_download_8 <- shiny::downloadHandler( - filename = function() { - paste0("formatted_code_use.", input$code_use_formatted_download_8_type) - }, - content = function(file) { - getFormattedDataCodeUse() |> - gt::gtsave(filename = file) - } - ) - ## plot code_use ----- - - - # achilles_code_use ----- - ## tidy achilles_code_use ----- - getTidyDataAchillesCodeUse <- shiny::reactive({ - res <- data |> - omopViewer::filterData("achilles_code_use", input) |> - omopViewer::tidyData() - - # columns to eliminate - colsEliminate <- colnames(res) - colsEliminate <- colsEliminate[!colsEliminate %in% c( - input$achilles_code_use_tidy_columns, "variable_name", "variable_level", - "estimate_name", "estimate_type", "estimate_value" - )] - - # pivot - pivot <- input$achilles_code_use_tidy_pivot - if (pivot != "none") { - vars <- switch(pivot, - "estimates" = "estimate_name", - "estimates and variables" = c("variable_name", "variable_level", "estimate_name") - ) - res <- res |> - visOmopResults::pivotEstimates(pivotEstimatesBy = vars) - } - - res |> - dplyr::select(!dplyr::all_of(colsEliminate)) - }) - output$achilles_code_use_tidy <- DT::renderDT({ - DT::datatable( - getTidyDataAchillesCodeUse(), - options = list(scrollX = TRUE), - rownames = FALSE - ) - }) - output$achilles_code_use_tidy_download <- shiny::downloadHandler( - filename = "tidy_achilles_code_use.csv", - content = function(file) { - getTidyDataAchillesCodeUse() |> - readr::write_csv(file = file) - } - ) - ## formatted achilles_code_use ----- - getFormattedDataAchillesCodeUse <- shiny::reactive({ - data |> - omopViewer::filterData("achilles_code_use", input) |> - CodelistGenerator::tableAchillesCodeUse( - header = input$achilles_code_use_formatted_9_header, - groupColumn = input$achilles_code_use_formatted_9_groupColumn, - hide = input$achilles_code_use_formatted_9_hide - ) - }) - output$achilles_code_use_formatted_9 <- gt::render_gt({ - getFormattedDataAchillesCodeUse() - }) - output$achilles_code_use_formatted_download_9 <- shiny::downloadHandler( - filename = function() { - paste0("formatted_achilles_code_use.", input$achilles_code_use_formatted_download_9_type) - }, - content = function(file) { - getFormattedDataAchillesCodeUse() |> - gt::gtsave(filename = file) - } - ) - ## plot achilles_code_use ----- - } - ---- - - Code - cat(global, sep = "\n") - Output - # Generated by omopViewer 0.0.0.900 - # Be careful editing this file - - library(CodelistGenerator) - library(DT) - library(bslib) - library(dplyr) - library(gt) - library(here) - library(omopViewer) - library(readr) - library(shiny) - library(sortable) - library(visOmopResults) - - data <- omopViewer::importSummarisedResult(here::here("data")) |> - omopViewer::correctSettings() - diff --git a/tests/testthat/_snaps/summary.md b/tests/testthat/_snaps/summary.md index d327570..66aa593 100644 --- a/tests/testthat/_snaps/summary.md +++ b/tests/testthat/_snaps/summary.md @@ -39,8 +39,8 @@

Package versions

Inconsistent versions:

    -
  • omopViewer 0.1.0 in result_id(s): 1
  • -
  • omopViewer 0.2.0 in result_id(s): 2
  • +
  • OmopViewer 0.1.0 in result_id(s): 1
  • +
  • OmopViewer 0.2.0 in result_id(s): 2

Consistent versions:

    @@ -54,7 +54,7 @@

    Explore settings

    - + diff --git a/tests/testthat/test-choices.R b/tests/testthat/test-choices.R index 4d7791c..cd63e07 100644 --- a/tests/testthat/test-choices.R +++ b/tests/testthat/test-choices.R @@ -11,7 +11,7 @@ test_that("test getChoices", { res <- emptySummarisedResult(settings = dplyr::tibble( result_id = c(1L, 2L), result_type = resT, - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "1.0.0", param = c(TRUE, NA), x = c(0, 1) @@ -50,7 +50,7 @@ test_that("test getChoices", { settings = dplyr::tibble( result_id = c(1L, 2L), result_type = resT, - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "1.0.0", param = c(TRUE, NA), x = c(0, 1) diff --git a/tests/testthat/test-correctSettings.R b/tests/testthat/test-correctSettings.R index 2647ec5..7449119 100644 --- a/tests/testthat/test-correctSettings.R +++ b/tests/testthat/test-correctSettings.R @@ -34,7 +34,7 @@ test_that("correctSettings columns", { omopgenerics::newSummarisedResult(settings = dplyr::tibble( result_id = 1L, result_type = "toy_data", - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "0.1.0" )) expect_no_error(xCorrected <- correctSettings(x)) @@ -73,7 +73,7 @@ test_that("correctSettings columns", { omopgenerics::newSummarisedResult(settings = dplyr::tibble( result_id = c(1L, 2L), result_type = "toy_data", - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "0.1.0" )) expect_no_error(xCorrected <- correctSettings(x)) @@ -98,7 +98,7 @@ test_that("correctSettings columns", { omopgenerics::newSummarisedResult(settings = dplyr::tibble( result_id = c(1L, 2L, 3L), result_type = "toy_data", - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "0.1.0" )) expect_no_error(xCorrected <- correctSettings(x)) @@ -127,7 +127,7 @@ test_that("correctSettings columns", { omopgenerics::newSummarisedResult(settings = dplyr::tibble( result_id = c(1L, 2L, 3L), result_type = "toy_data", - package_name = "omopViewer", + package_name = "OmopViewer", package_version = "0.1.0", strata = "test" )) diff --git a/tests/testthat/test-summary.R b/tests/testthat/test-summary.R index f5f35bc..778f2bf 100644 --- a/tests/testthat/test-summary.R +++ b/tests/testthat/test-summary.R @@ -24,7 +24,7 @@ test_that("test cardSummary", { omopgenerics::newSummarisedResult(settings = dplyr::tibble( result_id = c(1L, 2L, 3L), result_type = c("counts", "counts", "sums"), - package_name = c("omopViewer", "omopViewer", "omopgenerics"), + package_name = c("OmopViewer", "OmopViewer", "omopgenerics"), package_version = c("0.1.0", "0.2.0", "1.0.0"), min_cell_count = c(NA, 1, 5) )) diff --git a/vignettes/articles/background.Rmd b/vignettes/articles/background.Rmd index a067f0d..b40c3e8 100644 --- a/vignettes/articles/background.Rmd +++ b/vignettes/articles/background.Rmd @@ -16,7 +16,7 @@ knitr::opts_chunk$set( The background panel is triggered when `background = TRUE` argument is used in the `exportStaticApp()` function. If background is set to TRUE a 'background' panel is added and a default 'background.md' file is created. The content of this 'background' panel will be always a card generated with the `cardFromMd()` function using the content of 'background.md'. In this vignette we are going to show different options how to populate the 'background.md' file. ```{r} -library(omopViewer) +library(OmopViewer) ``` ## General markdown behaviour @@ -62,7 +62,7 @@ This shiny *contains information* on: The **ohdsi** logo: ![](', -system.file("logos", "ohdsi_logo.svg", package = "omopViewer"), +system.file("logos", "ohdsi_logo.svg", package = "OmopViewer"), '){width=100px}') tmpFile <- tempfile(fileext = ".md") @@ -95,7 +95,7 @@ The `yaml` metadata can contain two types of information: The following keywords can be used to edit the `bslib::card()` content: ```{r, echo=FALSE} -omopViewer:::backgroundKeywords |> +OmopViewer:::backgroundKeywords |> dplyr::mutate(`function` = purrr::map2(.data$link, .data$fun, \(x, y) { shiny::a(href = x, y) |> as.character() |> diff --git a/vignettes/supported_result_type.Rmd b/vignettes/supported_result_type.Rmd index 1c0eba5..edfea82 100644 --- a/vignettes/supported_result_type.Rmd +++ b/vignettes/supported_result_type.Rmd @@ -1,5 +1,5 @@ --- -title: "Plot tabs in omopViewer" +title: "Plot tabs in OmopViewer" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{supported_result_type} @@ -14,10 +14,10 @@ knitr::opts_chunk$set( ) ``` -The **omopViewer** package supports `r omopViewer:::omopViewerTabs$result_type |> unique() |> length()` different result types of the following packages: +The **OmopViewer** package supports `r OmopViewer:::omopViewerTabs$result_type |> unique() |> length()` different result types of the following packages: ```{r, results='asis', echo=FALSE} -pkgs <- omopViewer:::omopViewerTabs$package |> unique() |> sort() +pkgs <- OmopViewer:::omopViewerTabs$package |> unique() |> sort() for (k in seq_along(pkgs)) { cat(paste0("* ", pkgs[k], "\n")) } @@ -26,9 +26,9 @@ for (k in seq_along(pkgs)) { You can see the plot functions that have been configured in the package per result type in the following table: ```{r, echo = FALSE} -omopViewer:::omopViewerPlots |> +OmopViewer:::omopViewerPlots |> dplyr::inner_join( - omopViewer:::omopViewerTabs, by = "result_tab_id" + OmopViewer:::omopViewerTabs, by = "result_tab_id" ) |> dplyr::select( "Result type" = "result_type", "package", "Plot function" = "fun") |>