Skip to content

Commit

Permalink
Merge pull request #312 from OHDSI/issue_311
Browse files Browse the repository at this point in the history
update summariseInObservation
  • Loading branch information
cecicampanile authored Feb 7, 2025
2 parents 33ca978 + a83f3eb commit 94f375d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OmopSketch 0.2.2.900

- Account for int64 in summariseInObservation by @cecicampanile #311
8 changes: 6 additions & 2 deletions R/summariseInObservation.R
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ countRecords <- function(observationPeriod, cdm, start_date_name, end_date_name,
}

x <- personDays |>
rbind(records) |>
dplyr::mutate(estimate_value = as.numeric(.data$estimate_value)) |>
rbind(
records |>
dplyr::mutate(estimate_value = as.numeric(.data$estimate_value))
) |>
omopgenerics::uniteAdditional(additional_column)|>
dplyr::arrange(dplyr::across(dplyr::any_of("additional_level")))

Expand All @@ -249,7 +253,7 @@ createSummarisedResultObservationPeriod <- function(result, observationPeriod, n
dplyr::mutate("interval" = .env$original_interval))
}else{
result <- result |>
dplyr::mutate("estimate_value" = as.character(.data$estimate_value)) |>
dplyr::mutate("estimate_value" = sprintf('%.0f', .data$estimate_value)) |>
omopgenerics::uniteStrata(cols = c("sex", "age_group")) |>
dplyr::mutate(
"result_id" = as.integer(1),
Expand Down

0 comments on commit 94f375d

Please sign in to comment.