Skip to content

Commit

Permalink
datatable as table type
Browse files Browse the repository at this point in the history
  • Loading branch information
cecicampanile committed Feb 7, 2025
1 parent 33ca978 commit 71fc035
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.2.2
Date: 2025-01-28 15:48:47 UTC
SHA: 33ca978939eeb706a018033e8cb218563ab3eeed
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Suggests:
CodelistGenerator,
DBI,
duckdb,
DT,
flextable,
gt,
here,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# OmopSketch 0.2.2.900

- account for int64 in summariseInObservation by @cecicampanile
- add "datatable" as possible table type by @cecicampanile
2 changes: 1 addition & 1 deletion R/tableClinicalRecords.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tableClinicalRecords <- function(result,
# initial checks
rlang::check_installed("visOmopResults")
omopgenerics::validateResultArgument(result)
omopgenerics::assertChoice(type, choicesTables())
omopgenerics::assertChoice(type, visOmopResults::tableType())

# subset to result_type of interest
result <- result |>
Expand Down
2 changes: 1 addition & 1 deletion R/tableConceptIdCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tableConceptIdCounts <- function(result,
# initial checks
rlang::check_installed("visOmopResults")
omopgenerics::validateResultArgument(result)
omopgenerics::assertChoice(type, choicesTables())
omopgenerics::assertChoice(type, visOmopResults::tableType())

# subset to result_type of interest
result <- result |>
Expand Down
2 changes: 1 addition & 1 deletion R/tableMissingData.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tableMissingData <- function(result,
# initial checks
rlang::check_installed("visOmopResults")
omopgenerics::validateResultArgument(result)
omopgenerics::assertChoice(type, choicesTables())
omopgenerics::assertChoice(type, visOmopResults::tableType())

# subset to result_type of interest
result <- result |>
Expand Down
2 changes: 1 addition & 1 deletion R/tableObservationPeriod.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tableObservationPeriod <- function(result,
# initial checks
rlang::check_installed("visOmopResults")
omopgenerics::validateResultArgument(result)
omopgenerics::assertChoice(type, choicesTables())
omopgenerics::assertChoice(type, visOmopResults::tableType())

# subset to result_type of interest
result <- result |>
Expand Down
6 changes: 2 additions & 4 deletions R/tableOmopSnapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tableOmopSnapshot <- function(result,
# initial checks
rlang::check_installed("visOmopResults")
omopgenerics::validateResultArgument(result)
omopgenerics::assertChoice(type, choicesTables())
omopgenerics::assertChoice(type, visOmopResults::tableType())

# subset to result_type of interest
result <- result |>
Expand Down Expand Up @@ -64,9 +64,7 @@ emptyTable <- function(type) {
"flextable" = flextable::flextable(x)
)
}
choicesTables <- function() {
c("tibble", "flextable", "gt")
}

formatColumn <- function(result, col) {
for (x in col) {
result <- result |>
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-summariseClinicalRecords.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ test_that("tableClinicalRecords() works", {
expect_true(inherits(y,"gt_tbl"))
expect_warning(t <- summariseClinicalRecords(cdm, "death"))
expect_warning(inherits(tableClinicalRecords(t),"gt_tbl"))

expect_no_error(x <- tableClinicalRecords(summariseClinicalRecords(cdm, "condition_occurrence"), type = "datatable"))
PatientProfiles::mockDisconnect(cdm = cdm)
})

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-summariseObservationPeriod.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ test_that("check summariseObservationPeriod works", {

# table works
expect_no_error(tableObservationPeriod(resAll))
expect_no_error(tableObservationPeriod(resAll, type = "datatable"))
expect_no_error(tableObservationPeriod(resOne))
expect_no_error(tableObservationPeriod(resEmpty))

Expand Down

0 comments on commit 71fc035

Please sign in to comment.