From caf710c421d936fca3f04e43ac1d01afe30dd381 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 8 Feb 2024 14:16:24 -0500 Subject: [PATCH] Updated for stricter system matching --- .../studies/core/builder_condition.py | 7 +++-- .../studies/core/builder_encounter.py | 29 ++++++++++++------- .../codeable_concept_denormalize.sql.jinja | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/cumulus_library/studies/core/builder_condition.py b/cumulus_library/studies/core/builder_condition.py index d085818c..0ffa52cf 100644 --- a/cumulus_library/studies/core/builder_condition.py +++ b/cumulus_library/studies/core/builder_condition.py @@ -54,9 +54,12 @@ def denormalize_codes(self): "http://snomed.info/sct", "http://hl7.org/fhir/sid/icd-10-cm", "http://hl7.org/fhir/sid/icd-9-cm", - "urn:oid:1.2.840.114350.1.13.71.2.7.2", - "urn:oid:1.2.840.114350.1.13.71.2.7.4", + "http://hl7.org/fhir/sid/icd-9-cm/diagnosis", + # Cerner specific systems "http://terminology.hl7.org/CodeSystem/data-absent-reason", + # EPIC specific systems + "urn:oid:1.2.840.114350.1.13.71.2.7.2.728286", + "urn:oid:1.2.840.114350.1.13.71.2.7.4.698084.10375", ], ) self.queries.append( diff --git a/cumulus_library/studies/core/builder_encounter.py b/cumulus_library/studies/core/builder_encounter.py index 154c5df6..923b898b 100644 --- a/cumulus_library/studies/core/builder_encounter.py +++ b/cumulus_library/studies/core/builder_encounter.py @@ -40,9 +40,13 @@ def denormalize_codes(self, schema, cursor): "http://terminology.hl7.org/CodeSystem/v2-0004", "urn:oid:2.16.840.1.113883.4.642.3.248", "http://snomed.info/sct", - "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/71", - "urn:oid:1.2.840.114350.1.13.71.2.7.10", - "urn:oid:1.2.840.114350.1.13.71.2.7.2", + # Cerner specific systems + "https://fhir.cerner.com/%/codeSet/71", + # EPIC specific systems + "urn:oid:1.2.840.114350.1.13.71.2.7.10.698084.10110", + "urn:oid:1.2.840.114350.1.13.71.2.7.10.698084.18875", + "urn:oid:1.2.840.114350.1.13.71.2.7.10.698084.30", + "urn:oid:1.2.840.114350.1.13.71.2.7.2.808267", ], "has_data": False, }, @@ -52,10 +56,11 @@ def denormalize_codes(self, schema, cursor): "filter_priority": True, "code_systems": [ "http://terminology.hl7.org/CodeSystem/service-type", - "urn:oid:2.16.840.1.113883.4.642.3.518", "http://snomed.info/sct", - "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/34", - "urn:oid:1.2.840.114350.1.13.71.2.7.10", + # Cerner specific systems + "https://fhir.cerner.com/%/codeSet/34", + "urn:oid:2.16.840.1.113883.4.642.3.518", + "urn:oid:1.2.840.114350.1.13.71.2.7.10.698084.18886", ], "has_data": False, }, @@ -66,8 +71,10 @@ def denormalize_codes(self, schema, cursor): "code_systems": [ "http://terminology.hl7.org/CodeSystem/v3-ActPriority", "http://snomed.info/sct", - "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/3", - "urn:oid:1.2.840.114350.1.13.71.2.7.10", + # Cerner specific systems + "https://fhir.cerner.com/%/codeSet/3", + # EPIC specific systems + "urn:oid:1.2.840.114350.1.13.71.2.7.10.698084.410", ], "has_data": False, }, @@ -80,8 +87,10 @@ def denormalize_codes(self, schema, cursor): "http://snomed.info/sct", "http://hl7.org/fhir/sid/icd-10-cm", "http://hl7.org/fhir/sid/icd-9-cm", - "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/nomenclature", - "urn:oid:1.2.840.114350.1.13.71.2.7.2", + # Cerner specific systems + "https://fhir.cerner.com/%/nomenclature", + # EPIC specific systems + "urn:oid:1.2.840.114350.1.13.71.2.7.2.728286", ], "has_data": False, }, diff --git a/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja b/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja index 37a1c60f..a0ac8b92 100644 --- a/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja +++ b/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja @@ -21,7 +21,7 @@ CREATE TABLE {{ target_table }} AS ( {%- endif %} {%- if filter_priority %} WHERE - u.codeable_concept.system LIKE '{{ system }}%' + u.codeable_concept.system LIKE '{{ system }}' {%- endif %} ), --noqa: LT07 {%- endfor %}