Skip to content

Commit fdfd9b7

Browse files
committed
Fixes #106
1 parent e65172d commit fdfd9b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/GetCovariates.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ getDbCovariateData <- function(connectionDetails = NULL,
9595
} else {
9696
cohortDatabaseSchemaTable <- paste(cohortDatabaseSchema, cohortTable, sep = ".")
9797
}
98-
sql <- "SELECT cohort_definition_id, COUNT_BIG(*) AS size FROM @cohort_database_schema_table {@cohort_id != -1} ? {WHERE cohort_definition_id IN (@cohort_id)} GROUP BY cohort_definition_id;"
98+
sql <- "SELECT cohort_definition_id, COUNT_BIG(*) AS population_size FROM @cohort_database_schema_table {@cohort_id != -1} ? {WHERE cohort_definition_id IN (@cohort_id)} GROUP BY cohort_definition_id;"
9999
sql <- SqlRender::render(sql = sql,
100100
cohort_database_schema_table = cohortDatabaseSchemaTable,
101101
cohort_id = cohortId)
@@ -104,10 +104,10 @@ getDbCovariateData <- function(connectionDetails = NULL,
104104
oracleTempSchema = oracleTempSchema)
105105
temp <- DatabaseConnector::querySql(connection, sql, snakeCaseToCamelCase = TRUE)
106106
if (aggregated) {
107-
populationSize <- temp$size
107+
populationSize <- temp$populationSize
108108
names(populationSize) <- temp$cohortDefinitionId
109109
} else {
110-
populationSize <- sum(temp$size)
110+
populationSize <- sum(temp$populationSize)
111111
}
112112
if (sum(populationSize) == 0) {
113113
covariateData <- createEmptyCovariateData(cohortId, aggregated, covariateSettings$temporal)

0 commit comments

Comments
 (0)