Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/david navapbc/15514/hl7 oml aui fhir mapping #16619

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# $schema: ./../../../../../json_schema/fhir/hl7-to-fhir-mapping-resource-template.json

url:
type: STRING
valueOf: IN1.14

extension:
generateList: true
expressionType: nested
expressions:
- expressionType: nested
vars:
aui1: STRING_ALL, AUI.1
condition: $aui1 NOT_NULL
expressionsMap:
url:
type: STRING
valueOf: AUI.1
valueString:
type: STRING
expressionType: HL7Spec
valueOf: AUI.1
- expressionType: nested
vars:
aui2: STRING_ALL, AUI.2
condition: $aui2 NOT_NULL
expressionsMap:
url:
type: STRING
valueOf: AUI.2
valueString:
type: STRING
expressionType: HL7Spec
valueOf: AUI.2
- expressionType: nested
vars:
aui3: STRING_ALL, AUI.3
condition: $aui3 NOT_NULL
expressionsMap:
url:
type: STRING
valueOf: AUI.3
valueString:
type: STRING
expressionType: HL7Spec
valueOf: AUI.3
7 changes: 7 additions & 0 deletions prime-router/metadata/HL7/catchall/hl7/message/OML_O21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ resources:
isReferenced: true
repeats: false

- resourceName: Coverage
segment: .IN1
group: PATIENT.INSURANCE
resourcePath: segments/IN1/Coverage
repeats: true
isReferenced: true

- resourceName: ServiceRequest
segment: .ORC
group: ORDER
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# $schema: ./../../../../../json_schema/fhir/hl7-to-fhir-mapping-resource-template.json
JFisk42 marked this conversation as resolved.
Show resolved Hide resolved

resourceType: Coverage

id:
type: STRING
valueOf: "GeneralUtils.generateResourceId()"
expressionType: JEXL

extension:
expressionType: nested
generateList: true
expressions:
- expressionType: resource
valueOf: datatypes/AUI/AUIExtension
specs: IN1.14
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ elements:
hl7SegmentGroup: '/PATIENT/PATIENT_VISIT'
schema: classpath:/metadata/hl7_mapping/common/patient-visit.yml

- name: insurance
resource: 'Bundle.entry.resource.ofType(Coverage)'
# todo: update logic when Coverage.subscriber is mapped (IN1-16/IN1-17)
# resource: 'Bundle.entry.resource.ofType(Coverage).where(subscriber.resolve().id = %resource.entry.resource.ofType(Patient).id)'
schema: classpath:/metadata/hl7_mapping/resources/Coverage/IN1.yml
constants:
hl7SegmentGroup: '/PATIENT/INSURANCE'

- name: order
resource: Bundle.entry.resource.ofType(ServiceRequest)
condition: '%resource.count() > 0'
Expand Down Expand Up @@ -74,4 +82,4 @@ elements:
required: true
schema: classpath:/metadata/hl7_mapping/common/specimen.yml
constants:
hl7SpecimenFieldPath: /ORDER/OBSERVATION_REQUEST/SPECIMEN/SPM
hl7SpecimenFieldPath: /ORDER/OBSERVATION_REQUEST/SPECIMEN/SPM
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# $schema: ./../../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json

elements:

- name: aui-authorization-number
value: [ '%resource.extension.where(url = "AUI.1").value' ]
hl7Spec: [ '%{auiField}-1' ]

- name: aui-date
value: [ '%resource.extension.where(url = "AUI.2").value' ]
hl7Spec: [ '%{auiField}-2' ]

- name: aui-source
value: [ '%resource.extension.where(url = "AUI.3").value' ]
hl7Spec: [ '%{auiField}-3' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# $schema: ./../../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json

constants:
hl7IN1Field: '%{hl7SegmentGroup}/IN1'

elements:

- name: aui-extension
resource: '%resource.extension.where(url = "IN1.14")'
schema: classpath:/metadata/hl7_mapping/datatypes/extensionAUI/AUI.yml
constants:
auiField: '%{hl7IN1Field}-14'
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package gov.cdc.prime.router.datatests.mappinginventory.aui

import gov.cdc.prime.router.datatests.mappinginventory.verifyHL7ToFHIRToHL7Mapping
import org.junit.jupiter.api.Test

class AUIExtensionTests {
@Test
fun `test AUI mapped to AUIExtension`() {
assert(
verifyHL7ToFHIRToHL7Mapping(
"catchall/aui/AUI-to-Extension",
// todo update the schema to OML_O21-base.yml when OML updates are merged to main
outputSchema = "classpath:/metadata/hl7_mapping/OML_O21/OML_O21-base.yml"
).passed
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package gov.cdc.prime.router.datatests.mappinginventory.in1

import gov.cdc.prime.router.datatests.mappinginventory.verifyHL7ToFHIRToHL7Mapping
import org.junit.jupiter.api.Test

class IN1Tests {
@Test
fun `test IN1 mapped to Coverage`() {
assert(
verifyHL7ToFHIRToHL7Mapping(
"catchall/in1/in1-to-Coverage",
outputSchema = "classpath:/metadata/hl7_mapping/OML_O21/OML_O21-base.yml"
).passed
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"resourceType": "Bundle",
"id": "1732324230716018000.38edba19-1d39-4040-85af-9f5f6248813c",
"meta": {
"lastUpdated": "2024-11-22T17:10:30.720-08:00"
},
"identifier": {
"system": "https://reportstream.cdc.gov/prime-router",
"value": "MSG00001"
},
"type": "message",
"entry": [
{
"fullUrl": "MessageHeader/1732324230752828000.fc7cea9d-d7ca-4378-91d4-ea97c86b4787",
"resource": {
"resourceType": "MessageHeader",
"id": "1732324230752828000.fc7cea9d-d7ca-4378-91d4-ea97c86b4787",
"meta": {
"tag": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0103",
"code": "P"
}
]
},
"eventCoding": {
"system": "http://terminology.hl7.org/CodeSystem/v2-0003",
"code": "O21",
"display": "OML^O21^OML_O21"
}
}
},
{
"fullUrl": "Patient/1732324231018814000.533db9a5-5375-4746-be23-f7140d4a3280",
"resource": {
"resourceType": "Patient",
"id": "1732324231018814000.533db9a5-5375-4746-be23-f7140d4a3280"
}
},
{
"fullUrl": "Coverage/1732324231019741000.a36368bf-6c63-4970-8948-034a92248964",
"resource": {
"resourceType": "Coverage",
"id": "1732324231019741000.a36368bf-6c63-4970-8948-034a92248964",
"extension": [
{
"url": "IN1.14",
"extension": [
{
"url": "AUI.1",
"valueString": "1701"
},
{
"url": "AUI.2",
"valueString": "19700101"
},
{
"url": "AUI.3",
"valueString": "DR TEETH AND THE ELECTRIC MAYHEM"
}
]
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MSH|^~\&|||||||OML^O21^OML_O21|MSG00001|P|2.5.1
PID|1
IN1||||||||||||||1701^19700101^DR TEETH AND THE ELECTRIC MAYHEM
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"resourceType": "Bundle",
"id": "1732324230716018000.38edba19-1d39-4040-85af-9f5f6248813c",
"meta": {
"lastUpdated": "2024-11-22T17:10:30.720-08:00"
},
"identifier": {
"system": "https://reportstream.cdc.gov/prime-router",
"value": "MSG00001"
},
"type": "message",
"entry": [
{
"fullUrl": "MessageHeader/1732324230752828000.fc7cea9d-d7ca-4378-91d4-ea97c86b4787",
"resource": {
"resourceType": "MessageHeader",
"id": "1732324230752828000.fc7cea9d-d7ca-4378-91d4-ea97c86b4787",
"meta": {
"tag": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0103",
"code": "P"
}
]
},
"eventCoding": {
"system": "http://terminology.hl7.org/CodeSystem/v2-0003",
"code": "O21",
"display": "OML^O21^OML_O21"
}
}
},
{
"fullUrl": "Patient/1732324231018814000.533db9a5-5375-4746-be23-f7140d4a3280",
"resource": {
"resourceType": "Patient",
"id": "1732324231018814000.533db9a5-5375-4746-be23-f7140d4a3280"
}
},
{
"fullUrl": "Coverage/1732324231019741000.a36368bf-6c63-4970-8948-034a92248964",
"resource": {
"resourceType": "Coverage",
"id": "1732324231019741000.a36368bf-6c63-4970-8948-034a92248964",
"extension": [
{
"url": "IN1.14",
"extension": [
{
"url": "AUI.1",
"valueString": "1701"
},
{
"url": "AUI.2",
"valueString": "19700101"
},
{
"url": "AUI.3",
"valueString": "DR TEETH AND THE ELECTRIC MAYHEM"
}
]
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MSH|^~\&|||||||OML^O21^OML_O21|MSG00001|P|2.5.1
PID|1
IN1||||||||||||||1701^19700101^DR TEETH AND THE ELECTRIC MAYHEM
Loading