Repository navigation
Conversation
…ry daimon
The Explore panel of a characterization report (GET /cohort-characterization
/generation/{id}/explore/prevalence/{analysisId}/{cohortId}/{covariateId})
lists the ancestors and descendants of a covariate's concept. Its query,
queryCovariateStatsVocab.sql, joined concept and concept_ancestor through
@cdm_database_schema, which CcServiceImpl filled with the CDM daimon's
qualifier. On a source whose Vocabulary daimon points at a different schema
than the CDM daimon, the query failed with "relation <cdm>.concept_ancestor
does not exist", so Explore returned a server error for every covariate,
even though the report itself (queryResults.sql) already reads concept
names from the vocabulary schema.
Read both tables through @vocabulary_database_schema, which
SourceAwareSqlRender fills from the Vocabulary daimon and which falls back
to the CDM daimon when the source has none, and drop the CDM qualifier the
query no longer uses. This is the same change OHDSI#2556 made for the person
profile queries.
Adds a test that runs Explore on the embedded Postgres database for a
source with separate CDM and vocabulary schemas, and for a source with no
Vocabulary daimon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2600
What was wrong
The Explore panel of a characterization report (
GET /cohort-characterization/generation/{id}/explore/prevalence/{analysisId}/{cohortId}/{covariateId}) lists the ancestors and descendants of a covariate's concept. Its query,cohortcharacterizations/sql/queryCovariateStatsVocab.sql, joinedconceptandconcept_ancestorthrough@cdm_database_schema, whichCcServiceImpl.getPrevalenceStatsByGenerationIdfilled with the CDM daimon's qualifier. On a source whose Vocabulary daimon points at a different schema than the CDM daimon, the query failed withrelation "<cdm>.concept_ancestor" does not exist, so Explore returned a server error for every covariate. The report itself was fine, becausequeryResults.sqlalready reads concept names from the vocabulary schema.What changed
queryCovariateStatsVocab.sqlreadsconceptandconcept_ancestorthrough@vocabulary_database_schema.SourceAwareSqlRenderalready fills that parameter from the Vocabulary daimon, andSource.getTableQualifierOrNullfalls back to the CDM daimon when a source has no Vocabulary daimon, so single-schema sources behave as before.CcServiceImplno longer passes the CDM qualifier to this query, since it no longer uses it.This is the same change #2556 made for the person profile queries.
How it was tested
New
CcPrevalenceStatsVocabularyTestrunsgetPrevalenceStatsByGenerationIdon the embedded Postgres database withcc_results,conceptandconcept_ancestorrows for a small diabetes hierarchy:relation "cc_explore_cdm.concept_ancestor" does not exist, passes with this changeFull unit suite (
mvn -DskipUnitTests=false -DskipITtests=true test, JDK 21): Tests run: 176, Failures: 0, Errors: 0, Skipped: 5.