Repository navigation
Keep Procedure concepts without a vocabulary row in the concept hierarchy (fixes OHDSI/Atlas#2926) - #2581
Merged
chrisknoll merged 1 commit intoNov 6, 2026
Conversation
…rchy The Procedure section of init_concept_hierarchy.sql inner-joins the vocabulary table to build the displayed concept name. A concept whose vocabulary_id has no row in vocabulary (typically site-specific concepts loaded into a local vocabulary) therefore gets no concept_hierarchy row and disappears from the Data Sources Procedure report, while the same concept in any other domain is reported. Use a LEFT JOIN and fall back to the vocabulary_id when the vocabulary name is missing. Adds a test that builds the hierarchy from a Procedure concept with a vocabulary row and one without. Fixes OHDSI/Atlas#2926
chrisknoll
approved these changes
Nov 6, 2026
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 OHDSI/Atlas#2926
The Data Sources Procedure report (
cdmresults/sql/report/procedure/treemap.sql) inner-joinsachilles_results(analysis 600/601) toconcept_hierarchyrows withtreemap = 'Procedure', so a procedure concept only shows up ifinit_concept_hierarchy.sqlproduced a hierarchy row for it.The Procedure section of
init_concept_hierarchy.sqlis the only section that inner-joins thevocabularytable (it usesvocabulary_nameto build the displayed concept name). A concept whosevocabulary_idhas no row invocabulary— typically site-specific concepts in the 2 billion range loaded into a local vocabulary — gets noconcept_hierarchyrow and silently disappears from the Procedure report, while the same kind of concept in the Condition, Observation, Measurement or Drug domains is reported. That is the asymmetry described in OHDSI/Atlas#2926 (custom concepts visible in the Observation report but not in the Procedure report).Changes:
init_concept_hierarchy.sql: the Procedure section usesLEFT JOIN vocabularyandCOALESCE(v1.vocabulary_name, c1.vocabulary_id)for the name prefix, so concepts without a vocabulary row are kept and labelled with theirvocabulary_id.DDLServiceTest: new test that runs the concept_hierarchy scripts against the embedded Postgres with one SNOMED procedure concept (vocabulary row present) and one local procedure concept (no vocabulary row) and asserts both get aProcedurehierarchy row with the expected names. Helper methods were extracted so the existing drug test and the new one share the script-running code.Testing:
mvn -DskipUnitTests=false -Dtest=DDLServiceTest test -Pwebapi-postgresql: the new test fails on master (expected:<2> but was:<1>) and passes with this change (Tests run: 2, Failures: 0).COALESCEandLEFT JOINtranslate without changes.Existing deployments need to re-run the concept hierarchy initialization (Configuration > Results schema init /
ddl/resultswithinitConceptHierarchy=true) to rebuild the table.