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