Skip to content

Commit

Permalink
Merge pull request #270 from OHDSI/issue_262
Browse files Browse the repository at this point in the history
summariseConceptCount changes name
  • Loading branch information
catalamarti authored Dec 16, 2024
2 parents e7a8a86 + 36e70bb commit 38c0b96
Show file tree
Hide file tree
Showing 12 changed files with 529 additions and 412 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Imports:
clock,
CohortConstructor (>= 0.3.1),
dplyr,
lifecycle,
omopgenerics (>= 0.3.1),
PatientProfiles (>= 1.2.1),
purrr,
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ export(bind)
export(exportSummarisedResult)
export(importSummarisedResult)
export(mockOmopSketch)
export(plotConceptCounts)
export(plotConceptSetCounts)
export(plotInObservation)
export(plotObservationPeriod)
export(plotRecordCount)
export(settings)
export(summariseAllConceptCounts)
export(summariseClinicalRecords)
export(summariseConceptCounts)
export(summariseConceptSetCounts)
export(summariseInObservation)
export(summariseMissingData)
export(summariseObservationPeriod)
Expand Down
16 changes: 8 additions & 8 deletions R/plotConceptCounts.R → R/plotConceptSetCounts.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Plot the concept counts of a summariseConceptCounts output.
#' Plot the concept counts of a summariseConceptSetCounts output.
#'
#' @param result A summarised_result object (output of summariseConceptCounts).
#' @param result A summarised_result object (output of summariseConceptSetCounts).
#' @param facet Columns to face by. Formula format can be provided. See possible
#' columns to face by with: `visOmopResults::tidyColumns()`.
#' @param colour Columns to colour by. See possible columns to colour by with:
Expand All @@ -14,20 +14,20 @@
#' cdm <- mockOmopSketch()
#'
#' result <- cdm |>
#' summariseConceptCounts(
#' conceptId = list(
#' summariseConceptSetCounts(
#' conceptSet= list(
#' "Renal agenesis" = 194152,
#' "Manic mood" = c(4226696, 4304866, 37110496, 40371897)
#' )
#' )
#'
#' result |>
#' filter(variable_name == "Number subjects") |>
#' plotConceptCounts(facet = "codelist_name", colour = "standard_concept_name")
#' plotConceptSetCounts(facet = "codelist_name", colour = "standard_concept_name")
#'
#' PatientProfiles::mockDisconnect(cdm)
#' }
plotConceptCounts <- function(result,
plotConceptSetCounts <- function(result,
facet = NULL,
colour = NULL){

Expand All @@ -39,10 +39,10 @@ plotConceptCounts <- function(result,

# subset to results of interest
result <- result |>
omopgenerics::filterSettings(.data$result_type == "summarise_concept_counts")
omopgenerics::filterSettings(.data$result_type == "summarise_concept_set_counts")

if (nrow(result) == 0) {
cli::cli_abort(c("!" = "No records found with result_type == summarise_concept_counts"))
cli::cli_abort(c("!" = "No records found with result_type == summarise_concept_set_counts"))
}

# check only one estimate is contained
Expand Down
Loading

0 comments on commit 38c0b96

Please sign in to comment.