From 88b38506f90527212c0c0417b5103bcaf05f9a97 Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Mon, 24 Feb 2025 16:08:04 -0700 Subject: [PATCH 1/5] Update fhir resource package version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index e8f2035..5247d09 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ classifiers = [options] install_requires = deepdiff >=5.8, <6.0 - fhir.resources >=6.4, <7.0 + fhir.resources >=6.4, <7.1.0 numpy <2 pandas >=1.4 ,<1.5 pydantic >=1.9, <2.0 From 7b698f017ba6bd79a20fec99a7a97044b77f73eb Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Mon, 24 Feb 2025 16:11:12 -0700 Subject: [PATCH 2/5] Add local test directory to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5d43396..2e3034f 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ virtualenv/ notebooks/ .ipynb_checkpoints .history/ +local_test/ \ No newline at end of file From 95bb89772d22f20d4ac2ac9117fc1c2d703c47f4 Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Mon, 24 Feb 2025 16:15:34 -0700 Subject: [PATCH 3/5] Add demo directory to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2e3034f..009f542 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ virtualenv/ notebooks/ .ipynb_checkpoints .history/ -local_test/ \ No newline at end of file +local_test/ +demo/ \ No newline at end of file From a0305168605fc22d46f0b86e44dab7c0f2629765 Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Mon, 24 Feb 2025 16:16:06 -0700 Subject: [PATCH 4/5] Add HEDIS meta elements --- src/linuxforhealth/csvtofhir/fhirrs/meta.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/linuxforhealth/csvtofhir/fhirrs/meta.py b/src/linuxforhealth/csvtofhir/fhirrs/meta.py index 5d6809e..81ddeb7 100644 --- a/src/linuxforhealth/csvtofhir/fhirrs/meta.py +++ b/src/linuxforhealth/csvtofhir/fhirrs/meta.py @@ -13,6 +13,7 @@ def create_meta( ) -> Meta: meta: Meta = Meta.construct() meta.extension = [] + meta.tag = [] ext_tenant_id: Extension = Extension.construct(url=ExtensionUrl.META_TENANT_ID_EXTENSION_URL) ext_tenant_id.valueString = general_directives.get("tenantId") @@ -44,4 +45,17 @@ def create_meta( ext_source_record_type.valueCodeableConcept = fhir_utils.get_codeable_concept(None, None, None, "csv") meta.extension.append(ext_source_record_type) + # HEDIS profile URL logic based on resource type + if mapped_resource_type == "Patient": + meta.profile = [ + "https://ncqa.org/fhir/StructureDefinition/hedis-core-patient" + ] + + tag_hedis_data_source = fhir_utils.get_coding( + "https://ncqa.org/fhir/CodeSystem/hedis-data-source", + "administrative", + "Administrative" + ) + meta.tag.append(tag_hedis_data_source) + return meta From 6108bfdf5e1d79afb033f8033450f8e9be9b51f5 Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Mon, 24 Feb 2025 16:20:57 -0700 Subject: [PATCH 5/5] Remove meta extensions not needed for HEDIS --- src/linuxforhealth/csvtofhir/fhirrs/meta.py | 24 --------------------- 1 file changed, 24 deletions(-) diff --git a/src/linuxforhealth/csvtofhir/fhirrs/meta.py b/src/linuxforhealth/csvtofhir/fhirrs/meta.py index 81ddeb7..9068b2d 100644 --- a/src/linuxforhealth/csvtofhir/fhirrs/meta.py +++ b/src/linuxforhealth/csvtofhir/fhirrs/meta.py @@ -15,36 +15,12 @@ def create_meta( meta.extension = [] meta.tag = [] - ext_tenant_id: Extension = Extension.construct(url=ExtensionUrl.META_TENANT_ID_EXTENSION_URL) - ext_tenant_id.valueString = general_directives.get("tenantId") - meta.extension.append(ext_tenant_id) - - ext_source_file_id: Extension = Extension.construct( - url=ExtensionUrl.META_SOURCE_FILE_ID_EXTENSION_URL - ) - ext_source_file_id.valueString = file_name - meta.extension.append(ext_source_file_id) - - ext_source_event_trigger: Extension = Extension.construct( - url=ExtensionUrl.META_SOURCE_EVENT_TRIGGER_EXTENSION_URL - ) - ext_source_event_trigger.valueCodeableConcept = CodeableConcept.construct( - text=mapped_resource_type - ) - meta.extension.append(ext_source_event_trigger) - ext_process_timestamp: Extension = Extension.construct( url=ExtensionUrl.META_PROCESS_TIMESTAMP_EXTENSION_URL ) ext_process_timestamp.valueDateTime = datetime.utcnow().replace(tzinfo=timezone.utc).isoformat() meta.extension.append(ext_process_timestamp) - ext_source_record_type: Extension = Extension.construct( - url=ExtensionUrl.META_SOURCE_RECORD_TYPE_EXTENSION_URL - ) - ext_source_record_type.valueCodeableConcept = fhir_utils.get_codeable_concept(None, None, None, "csv") - meta.extension.append(ext_source_record_type) - # HEDIS profile URL logic based on resource type if mapped_resource_type == "Patient": meta.profile = [