Skip to content

Commit

Permalink
Fixed broken query
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Aug 24, 2023
1 parent b204913 commit 044d064
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 3 additions & 3 deletions R/cohort-diagnostics-characterization.R
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ cohortDiagCharacterizationModule <- function(
params$order_desc <- input$shortByRawAscTemporal == "DESC"
params$time_id <- ""
params$use_database_id <- TRUE
params$database_table <- dataSource$dbTable
params$database_table <- dataSource$databaseTable
return(params)
})

Expand Down Expand Up @@ -1051,8 +1051,8 @@ cohortDiagCharacterizationModule <- function(
SELECT @select_stament
FROM @results_database_schema.@table_prefixtemporal_covariate_ref tcr
LEFT JOIN @results_database_schema.@table_prefixtemporal_analysis_ref tar ON tar.analysis_id = tcr.analysis_id
LEFT JOIN @results_database_schema.@table_prefixtemporal_covariate_value tcv ON tcr.covariate_id = tcv.covariate_id
INNER JOIN @results_database_schema.@table_prefixtemporal_analysis_ref tar ON tar.analysis_id = tcr.analysis_id
INNER JOIN @results_database_schema.@table_prefixtemporal_covariate_value tcv ON tcr.covariate_id = tcv.covariate_id
INNER JOIN @results_database_schema.@database_table db ON db.database_id = tcv.database_id
WHERE tcr.covariate_id IS NOT NULL
"
Expand Down
13 changes: 0 additions & 13 deletions R/cohort-diagnostics-incidenceRates.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,6 @@ getIncidenceRateResult <- function(dataSource,
)
checkmate::reportAssertions(collection = errorMessage)

#sql <- "SELECT ir.*, dt.database_name, cc.cohort_subjects
# FROM @schema.@ir_table ir
# INNER JOIN @schema.@database_table dt ON ir.database_id = dt.database_id
# INNER JOIN @schema.@cc_table cc ON (
# ir.database_id = cc.database_id AND ir.cohort_id = cc.cohort_id
# )
# WHERE ir.cohort_id in (@cohort_ids)
# AND ir.database_id in (@database_ids)
# {@gender == TRUE} ? {AND ir.gender != ''} : { AND ir.gender = ''}
# {@age_group == TRUE} ? {AND ir.age_group != ''} : { AND ir.age_group = ''}
# {@calendar_year == TRUE} ? {AND ir.calendar_year != ''} : { AND ir.calendar_year = ''}
# AND ir.person_years > @personYears;"

sql <- "SELECT ir.*, cc.cohort_subjects
FROM @schema.@ir_table ir
INNER JOIN @schema.@cc_table cc ON (
Expand Down

0 comments on commit 044d064

Please sign in to comment.