Repository navigation
Include Type Concept vocabulary in Data Sources condition by type report (fixes OHDSI/Atlas#2644) - #2568
Conversation
The condition "by type" drilldown queries only join condition type concepts from the 'Condition Type' vocabulary. That vocabulary was deprecated in 2020 when the type concepts were consolidated into the 'Type Concept' vocabulary, so CDMs that use current condition_type_concept_id values (for example 32817 EHR or 32810 Claim) get an empty "Condition by type" chart in Data Sources. Also accept concepts from the 'Type Concept' vocabulary and apply the inpatient/outpatient primary/secondary grouping only to the old 'Condition Type' concepts it was written for, so new type concepts are shown under their own names. Adds a test that runs the condition drilldown and drilldown summary queries against the embedded Postgres database with both old and new condition type concepts. Fixes OHDSI/Atlas#2644
|
Vocabulary changes are fun! Personally, the nature of the CDM vocab change to me is a 'major version' type of change (due to breaking previous queries). But I understand the challenges with that, but at the same time I wish they would take more care in these types of changes. |
|
Agreed. It's a quiet break, too: the old 'Condition Type' concepts are still in the vocabulary, so nothing errors. The report just comes up empty for any CDM that uses the newer type concepts. OHDSI/Atlas#2644 is a screenshot of exactly that, from December 2021. To make sure there wasn't more of this, I grepped |
…type-concept-vocabulary
Fixes OHDSI/Atlas#2644
The Data Sources condition "by type" drilldown (
cdmresults/sql/report/condition/drilldown/byType.sqland the matchingdrilldownsummary/byType.sql) joins Achilles analysis 405 to condition type concepts filtered withlower(vocabulary_id) = 'condition type'. The 'Condition Type' vocabulary was deprecated in the 2020 vocabulary release that consolidated all type concepts into the 'Type Concept' vocabulary, so a CDM that uses currentcondition_type_concept_idvalues (for example 32817 EHR, 32810 Claim, or 32831 from the linked issue) gets an empty "Condition by type" chart. The other domains' by type queries joinconceptwithout a vocabulary filter and are not affected.Changes:
CDMResultsConditionByTypeTest, which runs the condition drilldown and drilldown summary queries throughCDMResultsAnalysisRunner.getDrilldownagainst the embedded Postgres database with old and new condition type concepts.The new SQL is plain nested
CASE. I checked that SqlRender translates it for Snowflake, SQL Server, BigQuery, Spark, Redshift and Oracle.Testing:
mvn -B test -Dtest=CDMResultsConditionByTypeTest: both tests fail on master (only the two 'Condition Type' rows come back) and pass with this change.mvn -B test: 156 unit tests, 0 failures, 5 skipped. In the integration test run, 3VocabularyServiceITtests fail (404). They fail the same way on master without this change.Note: drilldown results already stored in the Achilles cache stay as they are until that cache is cleared or warmed again.