test filtering of covariates based on minCharacterizationMean

`covariates` not equivalent to `expectedCovariates`.
Component “cohortDefinitionId”: Numeric: lengths (2, 1) differ
Component “covariateId”: Numeric: lengths (2, 1) differ
Component “sumValue”: Numeric: lengths (2, 1) differ
Component “averageValue”: Numeric: lengths (2, 1) differ

tempTable <- substr(cohortTableName, 1, 1) == "#"
if (substr(cohortTableName, 1, 1) == "#") {
sql = "DROP TABLE IF EXISTS @cohort_table;",
sql = "DROP TABLE IF EXISTS @database_schema.@cohort_table;",
# Database specific tests ---------------
runCohortBasedBinaryNonAggTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
tempTable <- substr(cohortTable, 1, 1) == "#"
runCohortBasedBinaryAggTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedBinaryNonAggTemporalTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedBinaryAggTemporalTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedCountsNonAggTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedCountsAggTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedCountsNonAggTemporalTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedCountsAggTemporalTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
runCohortBasedCountsAggMultiCohortTest <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, cohortTable) {
test_that("Cohort-based covariates: binary, non-aggregated on Eunomia", {
test_that("Cohort-based covariates: binary, aggregated on Eunomia", {
test_that("Cohort-based covariates: binary, non-aggregated, temporal on Eunomia", {
test_that("Cohort-based covariates: binary, aggregated, temporal on Eunomia", {
test_that("Cohort-based covariates: counts, non-aggregated on Eunomia", {
test_that("Cohort-based covariates: counts, aggregated on Eunomia", {
test_that("Cohort-based covariates: counts, non-aggregated, temporal on Eunomia", {
test_that("Cohort-based covariates: counts, aggregated, temporal on Eunomia", {
test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Eunomia", {
test_that("Cohort-based covariates: binary, non-aggregated on Postgres", {
test_that("Cohort-based covariates: binary, aggregated on Postgres", {
test_that("Cohort-based covariates: binary, non-aggregated, temporal on Postgres", {
test_that("Cohort-based covariates: binary, aggregated, temporal on Postgres", {
test_that("Cohort-based covariates: counts, non-aggregated on Postgres", {
test_that("Cohort-based covariates: counts, aggregated on Postgres", {
test_that("Cohort-based covariates: counts, non-aggregated, temporal on Postgres", {
test_that("Cohort-based covariates: counts, aggregated, temporal on Postgres", {
test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Postgres", {
test_that("Cohort-based covariates: binary, non-aggregated on SQL Server", {
test_that("Cohort-based covariates: binary, aggregated on SQL Server", {
test_that("Cohort-based covariates: binary, non-aggregated, temporal on SQL Server", {
test_that("Cohort-based covariates: binary, aggregated, temporal on SQL Server", {
test_that("Cohort-based covariates: counts, non-aggregated on SQL Server", {
test_that("Cohort-based covariates: counts, aggregated on SQL Server", {
test_that("Cohort-based covariates: counts, non-aggregated, temporal on SQL Server", {
test_that("Cohort-based covariates: counts, aggregated, temporal on SQL Server", {
test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on SQL Server", {
test_that("Cohort-based covariates: binary, non-aggregated on Oracle", {
test_that("Cohort-based covariates: binary, aggregated on Oracle", {
test_that("Cohort-based covariates: binary, non-aggregated, temporal on Oracle", {
test_that("Cohort-based covariates: binary, aggregated, temporal on Oracle", {
test_that("Cohort-based covariates: counts, non-aggregated on Oracle", {
test_that("Cohort-based covariates: counts, aggregated on Oracle", {
test_that("Cohort-based covariates: counts, non-aggregated, temporal on Oracle", {
test_that("Cohort-based covariates: counts, aggregated, temporal on Oracle", {
test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Oracle", {
test_that("Cohort-based covariates: binary, non-aggregated on RedShift", {
test_that("Cohort-based covariates: binary, aggregated on RedShift", {
test_that("Cohort-based covariates: binary, non-aggregated, temporal on RedShift", {
test_that("Cohort-based covariates: binary, aggregated, temporal on RedShift", {
test_that("Cohort-based covariates: counts, non-aggregated on RedShift", {
test_that("Cohort-based covariates: counts, aggregated on RedShift", {
test_that("Cohort-based covariates: counts, non-aggregated, temporal on RedShift", {
test_that("Cohort-based covariates: counts, aggregated, temporal on RedShift", {
test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on RedShift", {
# Non-database specific tests ---------------
test_that("Cohort-based covariates: warning if using pre-defined analysis ID", {
"Analysis ID [0-9+] also used for prespecified analysis"