Skip to content

Commit

Permalink
Merge pull request #98 from OHDSI/shiny_no_path
Browse files Browse the repository at this point in the history
no default path for shiny
  • Loading branch information
edward-burn authored Nov 1, 2024
2 parents a4d290b + 2c11fa8 commit 2d40429
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/addCodelistAttribute.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ addCodelistAttribute <- function(cohort,
}

cohortCodelist <- dplyr::bind_rows(currentCohortCodelist |>
dplyr::filter(!cohort_definition_id %in%
dplyr::filter(!.data$cohort_definition_id %in%
unique(cohortCodelist$cohort_definition_id)),
cohortCodelist)
}
Expand Down
4 changes: 2 additions & 2 deletions R/shinyDiagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
#' schema ="main",
#' overwrite = TRUE)
#' my_result_cohort_diag <- cdm$my_cohort |> phenotypeDiagnostics()
#' shinyDiagnostics(my_result_cohort_diag)
#' shinyDiagnostics(my_result_cohort_diag, here::here())
#' }
shinyDiagnostics <- function(result,
directory = here::here()){
directory){

rlang::check_installed("OmopViewer")

Expand Down
4 changes: 2 additions & 2 deletions man/shinyDiagnostics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/testthat/test-dbms.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test_that("eunomia", {
conceptSet = meds_cs,
name = "meds")
results <- phenotypeDiagnostics(cdm$meds)
expect_no_error(shinyDiagnostics(result = results))
expect_no_error(shinyDiagnostics(result = results, directory = here::here()))
})

test_that("postgres test", {
Expand Down Expand Up @@ -49,7 +49,7 @@ test_that("postgres test", {
cdm <- omopgenerics::bind(cdm$asthma, cdm$drugs, name = "my_cohort")

results <- phenotypeDiagnostics(cdm$my_cohort)
expect_no_error(shinyDiagnostics(result = results))
expect_no_error(shinyDiagnostics(result = results, directory = here::here()))
expect_no_error(CodelistGenerator::tableCohortCodeUse(results))
expect_no_error(CodelistGenerator::tableAchillesCodeUse(results))
expect_no_error(CodelistGenerator::tableOrphanCodes(results))
Expand All @@ -60,7 +60,7 @@ test_that("postgres test", {
expect_no_error(CohortCharacteristics::tableCohortTiming(results))
expect_no_error(CohortCharacteristics::tableLargeScaleCharacteristics(results))
# omopViewer::exportStaticApp(results)
expect_no_error(shinyDiagnostics(result = results))
expect_no_error(shinyDiagnostics(result = results, directory = here::here()))

CDMConnector::cdm_disconnect(cdm = cdm)

Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-shinyDiagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ test_that("basic working example with one cohort", {

# empty result - should still work without error
expect_no_error(
shinyDiagnostics(result = omopgenerics::emptySummarisedResult())
shinyDiagnostics(result = omopgenerics::emptySummarisedResult(),
directory = here::here())
)

# with results
Expand Down Expand Up @@ -38,7 +39,8 @@ test_that("basic working example with one cohort", {

my_result_cohort_diag <- cdm$my_cohort |> phenotypeDiagnostics()

expect_no_error(shinyDiagnostics(my_result_cohort_diag))
expect_no_error(shinyDiagnostics(my_result_cohort_diag,
directory = here::here()))


})

0 comments on commit 2d40429

Please sign in to comment.