diff --git a/DESCRIPTION b/DESCRIPTION index 6c3506e..60473ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,10 @@ Suggests: omock, testthat (>= 3.0.0), knitr, - RPostgres + RPostgres, + PatientProfiles, + ggplot2, + ggpubr Config/testthat/edition: 3 RoxygenNote: 7.3.2 Imports: @@ -29,7 +32,6 @@ Imports: here, omopgenerics, magrittr, - PatientProfiles, purrr, rmarkdown, rlang, @@ -38,3 +40,4 @@ Imports: visOmopResults URL: https://oxford-pharmacoepi.github.io/phenotypeR/ VignetteBuilder: knitr + diff --git a/R/cohortDiagnostics.R b/R/cohortDiagnostics.R index 539ff23..de3670b 100644 --- a/R/cohortDiagnostics.R +++ b/R/cohortDiagnostics.R @@ -76,13 +76,45 @@ cohortDiagnostics <- function(cohort, attr(results[["cohort_summary"]], "settings")$result_id <- attr(results[["cohort_summary"]], "settings")$result_id * 10L + # cli::cli_bullets(c("*" = "{.strong Creating denominator for incidence and prevalence}")) + # denominatorTable <- omopgenerics::uniqueTableName() + # cdm <- IncidencePrevalence::generateDenominatorCohortSet( + # cdm = cdm, + # name = denominatorTable, + # ageGroup = list(c(0,17), + # c(18,64), + # c(65,199)), + # sex = c("Male", "Female", "Both"), + # daysPriorObservation = c(0, 180) + # ) + # + # cli::cli_bullets(c("*" = "{.strong Estimating incidence}")) + # results[["incidence"]] <- IncidencePrevalence::estimateIncidence( + # cdm = cdm, + # denominatorTable = denominatorTable, + # outcomeTable = cohortName, + # interval = "years", + # repeatedEvents = c(TRUE, FALSE), + # outcomeWashout = c(0, Inf), + # completeDatabaseIntervals = c(TRUE, FALSE), + # minCellCount = 0) + # + # cli::cli_bullets(c("*" = "{.strong Estimating prevalence}")) + # results[["prevalence"]] <- IncidencePrevalence::estimatePeriodPrevalence( + # cdm = cdm, + # denominatorTable = denominatorTable, + # outcomeTable = cohortName, + # interval = "years", + # completeDatabaseIntervals = c(TRUE, FALSE), + # fullContribution = c(TRUE, FALSE), + # minCellCount = 0) + cli::cli_bullets(c("*" = "{.strong Generating a age and sex matched cohorts}")) matchedCohortTable <- paste0(omopgenerics::tableName(cdm[[cohortName]]), "_matched") cdm[[matchedCohortTable]] <- CohortConstructor::matchCohorts(cdm[[cohortName]], name = matchedCohortTable) - cli::cli_bullets(c("*" = "{.strong Running large scale characterisation}")) results[["lsc"]] <- CohortCharacteristics::summariseLargeScaleCharacteristics( cohort = cdm[[matchedCohortTable]], diff --git a/inst/shiny/server.R b/inst/shiny/server.R index c0c5fbd..b1427a2 100644 --- a/inst/shiny/server.R +++ b/inst/shiny/server.R @@ -219,7 +219,7 @@ server <- function(input, output, session) { table[[7]] <- as.numeric(table[[7]]) } if(length(names(table))>=8){ - table[[8]] <- as.numeric(table[[7]]) + table[[8]] <- as.numeric(table[[8]]) } datatable(table, rownames= FALSE) diff --git a/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001.json b/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001.json deleted file mode 100644 index 8cfa0eb..0000000 --- a/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "input": { - - }, - "output": { - - }, - "export": { - - } -} diff --git a/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001_.png b/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001_.png deleted file mode 100644 index 06bd82a..0000000 Binary files a/tests/testthat/_snaps/shinyDiagnostics/diagnostics-001_.png and /dev/null differ