Skip to content

Commit

Permalink
count in estimate name in summariseConceptIdCounts
Browse files Browse the repository at this point in the history
  • Loading branch information
cecicampanile committed Jan 28, 2025
1 parent 11b57d9 commit 9adb79e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions R/summariseConceptIdCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-summariseConceptIdCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9adb79e

Please sign in to comment.