diff --git a/R/summariseConceptIdCounts.R b/R/summariseConceptIdCounts.R index d584d04..d2c2db0 100644 --- a/R/summariseConceptIdCounts.R +++ b/R/summariseConceptIdCounts.R @@ -100,10 +100,8 @@ summariseConceptIdCounts <- function(cdm, ) |> # summarise results summariseCountsInternal(stratax, counts) |> - dplyr::mutate(omop_table = .env$table, - estimate_name = dplyr::if_else(.data$estimate_name == "count_records", "Number records", - dplyr::if_else(.data$estimate_name == "count_subjects", "Number subjects", .data$estimate_name) - )) + dplyr::mutate(omop_table = .env$table) + omopgenerics::dropSourceTable(cdm = cdm, name = dplyr::starts_with(prefix)) diff --git a/tests/testthat/test-summariseConceptIdCounts.R b/tests/testthat/test-summariseConceptIdCounts.R index 1672445..4aedba9 100644 --- a/tests/testthat/test-summariseConceptIdCounts.R +++ b/tests/testthat/test-summariseConceptIdCounts.R @@ -98,7 +98,7 @@ test_that("sample argument works", { expect_no_error(z<-summariseConceptIdCounts(cdm,"drug_exposure",sample = n)) expect_equal(y |> sortTibble(), z |> sortTibble()) expect_equal(summariseConceptIdCounts(cdm,"drug_exposure", sample = 1) |> - dplyr::filter(.data$estimate_name == "Number records") |> + dplyr::filter(.data$estimate_name == "count_records") |> dplyr::pull(.data$estimate_value) |> as.integer(), 1L)