Repository navigation
Conversation
The Drug section of init_concept_hierarchy.sql picks the level1 ingredient of every drug concept from concept_ancestor using domain_id = 'Drug' and concept_class_id = 'Ingredient'. Classification concepts (standard_concept = 'C') that carry the Ingredient class also match, so drugs below them get an extra concept_hierarchy row with the classification concept as their ingredient, and the Data Sources drug treemap shows them under that concept as well as under their real ingredient. Restrict the ingredient to standard concepts. Adds a test that runs the concept_hierarchy scripts against the embedded Postgres database with a small vocabulary containing such a classification concept. Fixes OHDSI#1966
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 #1966
The Drug section of
ddl/results/init_concept_hierarchy.sqltakes the level1 ingredient of each drug concept fromconcept_ancestor, filtering the ancestor ondomain_id = 'Drug'andconcept_class_id = 'Ingredient'. Classification concepts (standard_concept = 'C') with the Ingredient concept class also match, so every drug below one of them gets a secondconcept_hierarchyrow with the classification concept as its ingredient. In the Data Sources drug treemap those drugs then show up under the classification concept (the ALKA-SELTZER PLUS example in the issue) as well as under their real ingredient.This adds
AND c2.standard_concept = 'S'to that ingredient join, as agreed in the issue discussion.Changes:
src/main/resources/ddl/results/init_concept_hierarchy.sql: only standard concepts are used as the level1 ingredient in the Drug hierarchy.src/test/java/org/ohdsi/webapi/service/DDLServiceTest.java: new test that renders the concept_hierarchy scripts (DDLService.INIT_CONCEPT_HIERARCHY_FILE_PATHS) for PostgreSQL, runs them against the embedded Postgres database with a small vocabulary (acetaminophen, an acetaminophen tablet, a classification concept with the Ingredient class, and an ATC chain), and checks that each drug gets exactly one Drug row with acetaminophen as level1 and the ATC levels above it. Before the change the query returns 4 rows instead of 2.Testing:
mvn -B test -Dtest=DDLServiceTestfails on master (expected:<2> but was:<4>) and passes with this change.mvn -B test: unit testsTests run: 146, Failures: 0, Errors: 0, Skipped: 5. The integration test run reports the same 3VocabularyServiceITfailures (404) with and without this change.