diff --git a/DESCRIPTION b/DESCRIPTION index 2ba3f364..9c039dda 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: DrugUtilisation Title: Summarise Patient-Level Drug Utilisation in Data Mapped to the OMOP Common Data Model -Version: 1.0.3 +Version: 1.0.4 Authors@R: c( person( "MartĂ­", "CatalĂ ", email = "marti.catalasabate@ndorms.ox.ac.uk", diff --git a/NEWS.md b/NEWS.md index 3ef19b8e..aa3baef4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# DrugUtilisation 1.0.4 + +* Fix plotDrugUtilisation combining different cdm_name by @catalamarti + # DrugUtilisation 1.0.3 * Skip some tests for regression in duckdb by @catalamarti diff --git a/R/plots.R b/R/plots.R index d42126c4..79c7d718 100644 --- a/R/plots.R +++ b/R/plots.R @@ -222,7 +222,7 @@ plotDrugUtilisation <- function(result, cli::cli_abort() } vars <- getVariables(result) - x <- vars[!vars %in% c(asCharacterFacet(facet), result)] + x <- vars[!vars %in% asCharacterFacet(facet)] if (length(x) == 0) { result <- result |> omopgenerics::tidy() |> @@ -288,7 +288,7 @@ plotDrugUtilisation <- function(result, result <- result |> dplyr::filter(.data$estimate_name %in% .env$est) vars <- getVariables(result) - x <- vars[!vars %in% c(asCharacterFacet(facet), result)] + x <- vars[!vars %in% asCharacterFacet(facet)] if (length(x) == 0) { result <- result |> omopgenerics::tidy() |> @@ -535,6 +535,7 @@ getVariables <- function(res) { dplyr::distinct() |> omopgenerics::splitAll() |> omopgenerics::addSettings() |> + dplyr::select(!"result_id") |> as.list() |> purrr::map(unique) |> purrr::keep(\(x) length(x) > 1) |>