From 6edc13aca41cde08b9697f65635311629bbd99f3 Mon Sep 17 00:00:00 2001 From: oslynn Date: Fri, 3 Jan 2025 11:10:16 -0600 Subject: [PATCH 1/3] Carbon Health Onboarding - Test MO --- prime-router/settings/STLTs/MO/mo-phd.yml | 61 +++++++++++-------- .../common/datetime-to-local-us-central.yml | 12 ++++ 2 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 prime-router/src/main/resources/metadata/fhir_transforms/common/datetime-to-local-us-central.yml diff --git a/prime-router/settings/STLTs/MO/mo-phd.yml b/prime-router/settings/STLTs/MO/mo-phd.yml index 78413606360..6403bb69053 100644 --- a/prime-router/settings/STLTs/MO/mo-phd.yml +++ b/prime-router/settings/STLTs/MO/mo-phd.yml @@ -33,8 +33,10 @@ replaceUnicodeWithAscii: false useBlankInsteadOfUnknown: null truncateHDNamespaceIds: true + truncateHl7Fields: "MSH-3-1, PID-3-3, PID-3-6, ORC-2-2, ORC-7-10-5, OBR-2-2,\ + \ OBR-3-2, SPM-2-1-2, SPM-2-2-2, ORC-21-1, OBX-23-1, BX-15.1, OBX-23.10 " usePid14ForPatientEmail: false - convertTimestampToDateTime: null + convertTimestampToDateTime: "true" cliaForOutOfStateTesting: null cliaForSender: {} phoneNumberFormatting: "STANDARD" @@ -48,51 +50,53 @@ receivingOrganization: null convertPositiveDateTimeOffsetToNegative: false stripInvalidCharsRegex: null - convertDateTimesToReceiverLocalTime: false + convertDateTimesToReceiverLocalTime: true useHighPrecisionHeaderDateTimeFormat: false type: "HL7" truncationConfig: truncateHDNamespaceIds: true truncateHl7Fields: - "MSH-3-1" - - "PID-3-3" - - "PID-3-6" - - "ORC-2-2" - - "ORC-7-10-5" - "OBR-2-2" - "OBR-3-2" + - "OBX-15.1" + - "OBX-23-1" + - "OBX-23.10" + - "ORC-2-2" + - "ORC-21-1" + - "ORC-7-10-5" + - "PID-3-3" + - "PID-3-6" - "SPM-2-1-2" - "SPM-2-2-2" - - "ORC-21-1" - - "OBX-23-1" - - "OBX-15-1" - - "OBX-23-10" customLengthHl7Fields: {} jurisdictionalFilter: - - "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state = 'MO') or (Bundle.entry.resource.ofType(Patient).address.state = 'MO')" + - "(Bundle.entry.resource.ofType(ServiceRequest)[0].requester.resolve().organization.resolve().address.state\ + \ = 'MO') or (Bundle.entry.resource.ofType(Patient).address.state = 'MO')" qualityFilter: - # Message id is not empty (MSH-10) - - "Bundle.identifier.value.exists()" + - "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists()\ + \ or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or\ + \ (Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists()))" + - "Bundle.entry.resource.ofType(Patient).birthDate.exists()" - "Bundle.entry.resource.ofType(Patient).name.family.exists()" - "Bundle.entry.resource.ofType(Patient).name.given.count() > 0" - - "Bundle.entry.resource.ofType(Patient).birthDate.exists()" - # Specimen type (SPM-4) is not empty + - "Bundle.entry.resource.ofType(Patient).where(address.line[0].empty() and address.postalCode.empty()\ + \ and telecom.where(system = 'phone').value.empty() and telecom.where(system\ + \ = 'email').value.empty()).count() = 0" - "Bundle.entry.resource.ofType(Specimen).where(type.empty()).count() = 0" - # Patient has at least a street address(PID-11-1), postal code (PID-11-5),phone(PID-13) or email(PID-13-4) - - "Bundle.entry.resource.ofType(Patient).where(address.line[0].empty() and address.postalCode.empty() and telecom.where(system = 'phone').value.empty() and telecom.where(system = 'email').value.empty()).count() = 0" - - "((Bundle.entry.resource.ofType(Specimen).collection.collectedPeriod.exists() or Bundle.entry.resource.ofType(Specimen).collection.collected.exists()) or (Bundle.entry.resource.ofType(ServiceRequest).occurrence.exists() or Bundle.entry.resource.ofType(Observation).effective.exists()))" + - "Bundle.identifier.value.exists()" routingFilter: [] processingModeFilter: [] reverseTheQualityFilter: false conditionFilter: - # Positive COVID (840539006), Positive COVID-antibody (895448002) Positive MPOX (414015000) - - "%resource.where(interpretation.coding.code = 'A').code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code in ('840539006'|'895448002'|'414015000')).exists()" + - "%resource.where(interpretation.coding.code = 'A').code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code\ + \ in ('414015000'|'840539006'|'895448002')).exists()" mappedConditionFilter: [] deidentify: false deidentifiedValue: "" timing: operation: "MERGE" - numberPerDay: 12 + numberPerDay: 1440 initialTime: "01:20" timeZone: "EASTERN" maxReportCount: 100 @@ -101,11 +105,14 @@ onlyOncePerDay: false description: "" transport: - type: SFTP - host: sftp - port: 22 - filePath: ./upload - credentialName: DEFAULT-SFTP - enrichmentSchemaNames: [] + host: "sftp" + port: "22" + filePath: "./upload" + credentialName: "DEFAULT-SFTP" + type: "SFTP" + externalName: null + enrichmentSchemaNames: + - "classpath:/metadata/fhir_transforms/common/handle-aoe-unknown-value/handle-aoe-unknown-value.yml" + - "classpath:/metadata/fhir_transforms/common/datetime-to-local-us-central.yml" timeZone: "CENTRAL" dateTimeFormat: "LOCAL" \ No newline at end of file diff --git a/prime-router/src/main/resources/metadata/fhir_transforms/common/datetime-to-local-us-central.yml b/prime-router/src/main/resources/metadata/fhir_transforms/common/datetime-to-local-us-central.yml new file mode 100644 index 00000000000..28eda40e8a1 --- /dev/null +++ b/prime-router/src/main/resources/metadata/fhir_transforms/common/datetime-to-local-us-central.yml @@ -0,0 +1,12 @@ +elements: + - name: hl7-datetime-to-local + resource: "Bundle.descendants().where(url='https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2-date-time')" + bundleProperty: "%resource.value[x]" + value: ["%resource.value.changeTimezone('US/Central','LOCAL')"] + + - name: message-date-time-to-local + resource: 'Bundle.entry.resource.ofType(MessageHeader).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/msh-message-header").extension("MSH.7")' + condition: '%resource.value.exists()' + bundleProperty: '%resource.value[x]' + value: ["%resource.value.changeTimezone('US/Central','LOCAL')"] + From 0af5f7153cc0c39ac3d6eda35e06e1f9649d30b6 Mon Sep 17 00:00:00 2001 From: oslynn Date: Mon, 6 Jan 2025 15:10:00 -0600 Subject: [PATCH 2/3] Fixed truncation HL7 fields --- prime-router/settings/STLTs/MO/mo-phd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prime-router/settings/STLTs/MO/mo-phd.yml b/prime-router/settings/STLTs/MO/mo-phd.yml index 6403bb69053..9452ef0295e 100644 --- a/prime-router/settings/STLTs/MO/mo-phd.yml +++ b/prime-router/settings/STLTs/MO/mo-phd.yml @@ -59,9 +59,9 @@ - "MSH-3-1" - "OBR-2-2" - "OBR-3-2" - - "OBX-15.1" + - "OBX-15-1" - "OBX-23-1" - - "OBX-23.10" + - "OBX-23-10" - "ORC-2-2" - "ORC-21-1" - "ORC-7-10-5" From 93b47d3407d2dd4bfb35ac1625c62cfdae13b7f1 Mon Sep 17 00:00:00 2001 From: oslynn Date: Mon, 6 Jan 2025 15:52:12 -0600 Subject: [PATCH 3/3] Fixed setting fields --- prime-router/settings/STLTs/MO/mo-phd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prime-router/settings/STLTs/MO/mo-phd.yml b/prime-router/settings/STLTs/MO/mo-phd.yml index 9452ef0295e..631dc746cd5 100644 --- a/prime-router/settings/STLTs/MO/mo-phd.yml +++ b/prime-router/settings/STLTs/MO/mo-phd.yml @@ -34,7 +34,7 @@ useBlankInsteadOfUnknown: null truncateHDNamespaceIds: true truncateHl7Fields: "MSH-3-1, PID-3-3, PID-3-6, ORC-2-2, ORC-7-10-5, OBR-2-2,\ - \ OBR-3-2, SPM-2-1-2, SPM-2-2-2, ORC-21-1, OBX-23-1, BX-15.1, OBX-23.10 " + \ OBR-3-2, SPM-2-1-2, SPM-2-2-2, ORC-21-1, OBX-23-1, BX-15-1, OBX-23-10 " usePid14ForPatientEmail: false convertTimestampToDateTime: "true" cliaForOutOfStateTesting: null