Skip to content

Commit

Permalink
Merge branch 'engagement/hl7data-improvements' of https://github.com/…
Browse files Browse the repository at this point in the history
…CDCgov/prime-reportstream into engagement/hl7data-improvements
  • Loading branch information
oslynn committed Feb 27, 2025
2 parents 17fd137 + 26a5eb9 commit 75876bd
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ elements:
- name: set-obr-16-13-if-not-practitioner
resource: 'Bundle.entry.resource.ofType(Practitioner)'
condition: '%npiResource.value.exists().not()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/xcn-practitioner").extension("XCN.13").value[x]'
bundleProperty: '%resource.identifier.type.coding.code'
value: [ '"U"' ]

- name: set-obr-16-13-if-practitioner
resource: 'Bundle.entry.resource.ofType(Practitioner)'
condition: '%npiResource.value.exists()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/xcn-practitioner").extension("XCN.13").value[x]'
bundleProperty: '%resource.identifier.type.coding.code'
value: [ '"NPI"' ]
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ elements:
value: ['""']
bundleProperty: '%resource.code.text'

# TODO if new ORU extension move all the commented sections over
#OBX-15(1).2 Producer's ID [CWE] > Text (ST)
- name: suppress-producers-id-text
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field").value.join(",").contains("OBX.15")).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-organization").value.coding.where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding").value = "coding")'
condition: '%resource.exists()'
value: [ '""' ]
bundleProperty: '%resource.display'

#OBX-15(1).3 Producer's ID [CWE] > Name of Coding System (ID)
- name: suppress-producers-id-coding-system
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field").value.join(",").contains("OBX.15")).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-organization").value.coding.where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding").value = "coding").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding-system")'
condition: '%resource.value.exists()'
value: [ '""' ]
bundleProperty: '%resource.value[x]'
# - name: suppress-producers-id-text
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field").value.join(",").contains("OBX.15")).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-organization").value.coding.where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding").value = "coding")'
# condition: '%resource.exists()'
# value: [ '""' ]
# bundleProperty: '%resource.display'
#
# #OBX-15(1).3 Producer's ID [CWE] > Name of Coding System (ID)
# - name: suppress-producers-id-coding-system
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field").value.join(",").contains("OBX.15")).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-organization").value.coding.where(extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding").value = "coding").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding-system")'
# condition: '%resource.value.exists()'
# value: [ '""' ]
# bundleProperty: '%resource.value[x]'

#OBX-19(1).1.1 Date/Time of the Analysis [DTM] > Date/Time (DTM)
- name: aoe-analysis-date
Expand All @@ -34,34 +35,35 @@ elements:
value: [ 'Bundle.entry.resource.ofType(Observation).first().issued' ]

#OBX-23(1).2 Performing Organization Name [XON~] > Organization Name Type Code (IS)
- name: suppress-performing-organization-name-type-code
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/organization-name-type")[0].value.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding")'
condition: '%resource.value.coding.code.exists()'
value: [ '""' ]
bundleProperty: '%resource.value.coding.code'

#OBX-23(1).6 Performing Organization Name [XON~] > Assigning Authority (HD)
- name: suppress-performing-organization-assigning-authority-universal-id
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").exists()'
value: [ '""' ]
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").value[x]'

- name: suppress-performing-organization-assigning-authority-id-type
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type").exists()'
value: [ '""' ]
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type").value[x]'
# - name: suppress-performing-organization-name-type-code
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/organization-name-type")[0].value.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding")'
# condition: '%resource.value.coding.code.exists()'
# value: [ '""' ]
# bundleProperty: '%resource.value.coding.code'
#
# #OBX-23(1).6 Performing Organization Name [XON~] > Assigning Authority (HD)
# - name: suppress-performing-organization-assigning-authority-universal-id
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
# condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").exists()'
# value: [ '""' ]
# bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").value[x]'

- name: suppress-performing-organization-assigning-authority-namespace-id
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").exists()'
value: [ '""' ]
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").value[x]'
# - name: suppress-performing-organization-assigning-authority-id-type
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
# condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type").exists()'
# value: [ '""' ]
# bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type").value[x]'
#
# - name: suppress-performing-organization-assigning-authority-namespace-id
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization).identifier.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority")'
# condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").exists()'
# value: [ '""' ]
# bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").value[x]'

#OBX-24(1).6 Performing Organization Address [XAD~] > Country (ID)
- name: suppress-performing-organization-address-country
resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization)'
condition: '%resource.address.country.exists()'
value: [ '""' ]
bundleProperty: '%resource.address.country'
# TODO can we remove this?
# - name: suppress-performing-organization-address-country
# resource: 'Bundle.entry.resource.ofType(ServiceRequest).supportingInfo.resolve().performer.resolve().ofType(Organization)'
# condition: '%resource.address.country.exists()'
# value: [ '""' ]
# bundleProperty: '%resource.address.country'
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
## Suppresses Device information OBX-18-1,OBX-18-2,OBX-18-3
elements:
##OBX-18-1
- name: suppress-device-name
resource: 'Bundle.entry.resource.ofType(Device).identifier'
value: [ '""' ]
bundleProperty: '%resource.value'

##OBX-18-2
- name: suppress-device-namespace_id
resource: 'Bundle.entry.resource.ofType(Device).identifier'
condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").exists()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").value[x]'
value: [ '""' ]
# TODO figure out what to do with OBX-18 since some files may need the field values?
# ##OBX-18-1
# - name: suppress-device-name
# resource: 'Bundle.entry.resource.ofType(Device).identifier'
# value: [ '""' ]
# bundleProperty: '%resource.value'

# ##OBX-18-2
# - name: suppress-device-namespace_id
# resource: 'Bundle.entry.resource.ofType(Device).identifier'
# condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").exists()'
# bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id").value[x]'
# value: [ '""' ]

##OBX-18-3
- name: suppress-device-universal-id
resource: 'Bundle.entry.resource.ofType(Device).identifier'
condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").exists()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").value[x]'
value: [ '""' ]
# - name: suppress-device-universal-id
# resource: 'Bundle.entry.resource.ofType(Device).identifier'
# condition: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").exists()'
# bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/assigning-authority").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id").value[x]'
# value: [ '""' ]

##OBX-18-3 different mappings
- name: suppress-device-type-id
Expand All @@ -35,9 +36,9 @@ elements:

##PID-10-9
- name: suppress-patient-pid-10-9-value
resource: 'Bundle.entry.resource.ofType(Patient)'
condition: '%resource.extension("http://ibm.com/fhir/cdm/StructureDefinition/local-race-cd").exists()'
bundleProperty: '%resource.extension("http://ibm.com/fhir/cdm/StructureDefinition/local-race-cd").value.text'
resource: 'Bundle.entry.resource.ofType(Patient).extension("http://ibm.com/fhir/cdm/StructureDefinition/local-race-cd")'
condition: '%resource.exists()'
bundleProperty: '%resource.value.text'
value: [ '""' ]

##PID-22-ethnic-value (Hispanic or Latino)
Expand All @@ -54,9 +55,9 @@ elements:
bundleProperty: '%resource.code.text'
value: [ '""' ]

#SPM-4-9
- name: suppress-patient-spm-4-9
resource: 'Bundle.entry.resource.ofType(Specimen).type'
#SPM-1-8
- name: suppress-specimen-spm-1-8
resource: 'Bundle.entry.resource.ofType(Specimen).collection.bodySite'
condition: '%resource.text.exists()'
value: [ '""' ]
bundleProperty: '%resource.text'
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,22 @@ elements:
bundleProperty: '%resource.collection.bodySite.coding[0].display'
value: [ '%resource.collection.bodySite.text' ]

- name: sr-observation-producer-id-identifier
resource: 'Bundle.entry.resource.ofType(Observation)'
condition: '%resource.performer.exists().not()'
bundleProperty: '%resource.performer'
value: [ '%diagnosticReport.basedOn.resolve().performer' ]

- name: sr-observation-producer-id-hl7use
resource: 'Bundle.entry.resource.ofType(Observation).performer.resolve()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field")[1].value[x]'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field")[0].value[x]'
value: [ '"OBX.15"' ]

- name: sr-observation-performing-org-hl7use
resource: 'Bundle.entry.resource.ofType(Observation).performer.resolve()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field")[0].value[x]'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field")[1].value[x]'
value: [ '"OBX.25"' ]

- name: sr-observation-producer-id-identifier
resource: 'Bundle.entry.resource.ofType(Observation)'
condition: '%resource.performer.exists().not()'
bundleProperty: '%resource.performer'
value: [ '%diagnosticReport.basedOn.resolve().performer' ]

- name: sr-observation-producer-id-cwe-identifier
resource: 'Bundle.entry.resource.ofType(Observation).performer.resolve()'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-organization").valueCodeableConcept.coding.code'
Expand Down Expand Up @@ -598,6 +598,10 @@ elements:
bundleProperty: 'Bundle.entry.resource.ofType(ServiceRequest).requester.resolve().practitioner.resolve().address.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/xad-address").extension("https://reportstream.cdc.gov/fhir/StructureDefinition/sad-address-line").extension("SAD.1").value[x]'
value: [ 'Bundle.entry.resource.ofType(ServiceRequest).requester.resolve().practitioner.resolve().address.line[0]' ]

- name: sr-service-request-requester-address-street-2
bundleProperty: 'Bundle.entry.resource.ofType(ServiceRequest).requester.resolve().practitioner.resolve().address.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/xad-address").extension("XAD.2").value[x]'
value: [ 'Bundle.entry.resource.ofType(ServiceRequest).requester.resolve().practitioner.resolve().address.line[1]' ]

# order-effective-date
- name: sr-service-request-orc-order-effective-date
bundleProperty: 'Bundle.entry.resource.ofType(ServiceRequest).extension("https://reportstream.cdc.gov/fhir/StructureDefinition/orc-common-order").extension("ORC.15").value[x]'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
constants:
hl7ObservationPath: '/PATIENT_RESULT/ORDER_OBSERVATION/OBSERVATION(%{resultIndex})'

elements:
# OBX 15.2
- name: obx-producer-text
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists()'
value: [ '""' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-15-2' ]

# OBX 15.3
- name: obx-producer-coding-system-name
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists()'
value: [ '""' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-15-3' ]

# OBX 23-2
- name: obx-organization-name-type-code
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists().not()'
value: [ '"L"' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-23-2' ]

# OBX 23-2 - Remove tag if AOE
- name: obx-organization-name-type-code-aoe
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists()'
value: [ '""' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-23-2' ]

# OBX 23-6.1-3
- name: obx-assigning-authority-namespace-id
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists().not()'
value: [ '"CLIA"' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-23-6-1' ]

- name: obx-assigning-authority-universal-id
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists().not()'
value: [ '"2.16.840.1.113883.4.7"' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-23-6-2' ]

- name: obx-assigning-authority-universal-id-type
condition: '%resource.code.coding.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code").value.where(code in ("AOE")).exists().not()'
value: [ '"ISO"' ]
hl7Spec: [ '%{hl7ObservationPath}/OBX-23-6-3' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# $schema: ./../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json

hl7Class: ca.uhn.hl7v2.model.v27.message.ORU_R01
extends: classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml

elements:
- name: obx-shadow
resource: 'Bundle.entry.resource.ofType(Observation)'
condition: '%resource.count() > 0'
schema: classpath:/metadata/hl7_mapping/ORU_R01/OBX-shadow.yml
resourceIndex: resultIndex

# ORC 21.7
- name: orc-identifier-type-code
value: [ '""' ]
hl7Spec: [ /PATIENT_RESULT/ORDER_OBSERVATION/ORC-21-7 ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hl7Class: ca.uhn.hl7v2.model.v251.message.ORU_R01

extends: classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-base.yml
extends: classpath:/metadata/hl7_mapping/ORU_R01/ORU_R01-shadow.yml

elements:
- name: ms-name-of-the-sender-application-Namespace-Id
Expand All @@ -18,12 +18,11 @@ elements:
value: [ '"MSDOH"' ]
hl7Spec: [ 'MSH-6-1' ]

- name: ms-receiving-facility-universal-ID
condition: 'true'
value: [ '"2.16.840.1.114222.1.3645"' ]
hl7Spec: [ 'MSH-6-2' ]

- name: ms-receiving-facility-universal-ID-Type
condition: 'true'
value: [ '"ISO"' ]
hl7Spec: [ 'MSH-6-3' ]
# Suppress the XON.10 value in Organization
# prime-router/src/main/resources/metadata/hl7_mapping/receivers/Common/remove-orc-21-10/remove-orc-21-10.yml
# TODO remove if new extension for ORU-R01 base
- name: suppress-organization-orc-21-10
resource: 'Bundle.entry.resource.ofType(ServiceRequest).requester.resolve().organization.resolve().extension("https://reportstream.cdc.gov/fhir/StructureDefinition/xon-organization").extension("XON.10")'
condition: '%resource.value.exists()'
value: [ '""' ]
hl7Spec: [ '/PATIENT_RESULT/ORDER_OBSERVATION/ORC-21-10' ]

0 comments on commit 75876bd

Please sign in to comment.