From f77f6ffe546689a78666cf5c06b5289c0caa500d Mon Sep 17 00:00:00 2001 From: Anthony Sena Date: Fri, 28 Jun 2024 10:16:12 -0400 Subject: [PATCH] NC counts should include 0 counts --- R/RunCohortGeneration.R | 2 +- tests/testthat/test-RunCohortGeneration.R | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/RunCohortGeneration.R b/R/RunCohortGeneration.R index ee69d0f..e77a324 100644 --- a/R/RunCohortGeneration.R +++ b/R/RunCohortGeneration.R @@ -288,7 +288,7 @@ generateAndExportNegativeControls <- function(connection, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTableNames$cohortTable, databaseId = databaseId, - cohortIds = negativeControlOutcomeCohortSet$cohortId + cohortDefinitionSet = negativeControlOutcomeCohortSet[,c("cohortId")] ) } diff --git a/tests/testthat/test-RunCohortGeneration.R b/tests/testthat/test-RunCohortGeneration.R index 369b502..719f731 100644 --- a/tests/testthat/test-RunCohortGeneration.R +++ b/tests/testthat/test-RunCohortGeneration.R @@ -57,8 +57,9 @@ test_that("Call runCohortGeneration happy path", { file = file.path(testOutputFolder, expectedFileList[i]) ) tbl <- tools::file_path_sans_ext(expectedFileList[i]) + emptyResult <- CohortGenerator:::createEmptyResult(tbl) - expect_equal(!!sort(names(data)), !!sort(names(emptyResult))) + expect_equal(!!c(tbl, sort(names(data))), !!c(tbl, sort(names(emptyResult)))) } # Make sure that the output that specifies a database ID has the correct