Skip to content

Commit

Permalink
Bad table naming fix
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Oct 6, 2023
1 parent b0b1306 commit d30b34d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions R/cohort-diagnostics-definition.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,13 @@ getConceptSetDetailsFromCohortDefinition <-


getCdCohortRows <- function(dataSource, cohortIds) {
sql <- "SELECT {@use_cg_table} ? {cohort_definition_id as cohort_id,} * FROM @schema.@cohort_table
WHERE {@use_cg_table} ? {cohort_definition_id} : {cohort_id} IN (@cohort_ids)"
sql <- "SELECT * FROM @schema.@cohort_table
WHERE cohort_id IN (@cohort_ids)"
dataSource$connectionHandler$queryDb(
sql = sql,
schema = dataSource$schema,
cohort_table = dataSource$cohortTableName,
cohort_ids = cohortIds,
use_cg_table = dataSource$useCgTable
cohort_ids = cohortIds
)
}

Expand Down
2 changes: 1 addition & 1 deletion R/cohort-diagnostics-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ createCdDatabaseDataSource <- function(
}

getDatabaseTable <- function(dataSource) {
databaseTable <- loadResultsTable(dataSource, dataSource$databaseTable, required = TRUE)
databaseTable <- loadResultsTable(dataSource, dataSource$prefixTable(dataSource$databaseTable), required = TRUE)
if (nrow(databaseTable) > 0 &
"vocabularyVersion" %in% colnames(databaseTable)) {
databaseTable <- databaseTable %>%
Expand Down

0 comments on commit d30b34d

Please sign in to comment.