Skip to content

Commit

Permalink
15500 in1 mappings (#16836)
Browse files Browse the repository at this point in the history
* coverage hl7 -> fhir mapping

* coverage extension hl7 -> fhir, date handling

* coverage fhir -> hl7

* fixes to coverage, auiextension

* fixes, test updates

* remove unused mapping, test fixes

* add cxidentifier to organization, remove in1.15 from in1extension

* map coverage.beneficiary, add orm in1 mapping
  • Loading branch information
jack-h-wang authored Jan 2, 2025
1 parent 345f93c commit a46da3b
Show file tree
Hide file tree
Showing 25 changed files with 6,700 additions and 1,233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
url: "http://hl7.org/fhir/StructureDefinition/patient-animal"
- id: "relationship"
url: "https://hl7.org/fhir/StructureDefinition/relationship"
- id: "extension-subscriber-id"
url: "http://hl7.org/fhir/R5/StructureDefinition/extension-subscriberId"

## Datatypes

Expand Down Expand Up @@ -281,6 +283,10 @@
- id: "nte-annotation"
url: "https://reportstream.cdc.gov/fhir/StructureDefinition/nte-annotation"

# IN1 -> Coverage
- id: "in1-coverage"
url: "https://reportstream.cdc.gov/fhir/StructureDefinition/in1-coverage"

## Generic

# internal indicator of sender, usable for filtering
Expand All @@ -297,9 +303,11 @@
url: "https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Component"

# Date time as hl7v2 string
# This extension exists because HL7 dates have very little restrictions (i.e. YYYY-MM, YYYY-MM-DD HH, YYYY-MM-DD HH:MM)
# are all valid, but the FHIR specs has much stricter rules. In order to reliably generate the same HL7 message, this extension
# is used to capture what was in the original HL7 message and then exclusively used when mapping FHIR->HL7
# These extensions exist because HL7 dates have very little restrictions (i.e. YYYY-MM, YYYY-MM-DD HH, YYYY-MM-DD HH:MM)
# are all valid, but the FHIR specs has much stricter rules. In order to reliably generate the same HL7 message, these
# extensions are used to capture what was in the original HL7 message and then exclusively used when mapping FHIR->HL7
- id: "hl7v2-date"
url: "https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2-date"
- id: "hl7v2-date-time"
url: "https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2-date-time"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

url:
type: STRING
valueOf: IN1.14
valueOf: $auiExtensionName

extension:
generateList: true
Expand Down
47 changes: 47 additions & 0 deletions prime-router/metadata/HL7/catchall/hl7/datatypes/DT/Period.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# $schema: ./../../../../../json_schema/fhir/hl7-to-fhir-mapping-resource-template.json

start:
condition: $dateIn NOT_NULL
type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateIn,ZONEID)"
expressionType: JEXL
vars:
dateIn: $start
_start:
expressionType: nested
condition: $start NOT_NULL
expressionsMap:
extension_1:
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: hl7v2-date
valueString:
type: STRING
valueOf: $start
expressionType: HL7Spec

end:
condition: $dateIn NOT_NULL
type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateIn,ZONEID)"
expressionType: JEXL
vars:
dateIn: $end
_end:
expressionType: nested
condition: $end NOT_NULL
expressionsMap:
extension_1:
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: hl7v2-date
valueString:
type: STRING
valueOf: $end
expressionType: HL7Spec
149 changes: 78 additions & 71 deletions prime-router/metadata/HL7/catchall/hl7/datatypes/XON/Organization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,85 +14,92 @@ name:

identifier:
expressionType: nested
vars:
xon3: XON.3
xon4: XON.4
xon5: XON.5
xon6: XON.6
xon7: XON.7
xon8: XON.8
xon10: String, XON.10
expressionsMap:
value_1:
condition: $xon10 NULL
type: STRING
expressionType: HL7Spec
valueOf: XON.3
value_2:
condition: $xon10 NOT_NULL
type: STRING
expressionType: HL7Spec
valueOf: XON.10
type:
condition: $xon7 NOT_NULL
expressions:
- condition: $CXIdentifier NOT_NULL
valueOf: datatypes/CX/Identifier
expressionType: resource
specs: $CXIdentifier
- condition: $CXIdentifier NULL
expressionType: nested
generateList: true
vars:
xon3: XON.3
xon4: XON.4
xon5: XON.5
xon6: XON.6
xon7: XON.7
xon8: XON.8
xon10: String, XON.10
expressionsMap:
coding:
value_1:
condition: $xon10 NULL
type: STRING
expressionType: HL7Spec
valueOf: XON.3
value_2:
condition: $xon10 NOT_NULL
type: STRING
expressionType: HL7Spec
valueOf: XON.10
type:
condition: $xon7 NOT_NULL
expressionType: nested
generateList: true
expressionsMap:
code:
valueOf: XON.7
coding:
expressionType: nested
generateList: true
expressionsMap:
code:
valueOf: XON.7
type: STRING
expressionType: HL7Spec
system:
type: STRING
value: "http://terminology.hl7.org/CodeSystem/v2-0203"
extension_1-checkDigitSchema:
condition: $xon5 NOT_NULL
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: naming-system-check-digit
valueCode:
valueOf: XON.5
type: STRING
expressionType: HL7Spec
system:
extension_2-checkDigit:
condition: $xon4 NOT_NULL
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: identifier-check-digit
valueString:
type: STRING
value: "http://terminology.hl7.org/CodeSystem/v2-0203"
extension_1-checkDigitSchema:
condition: $xon5 NOT_NULL
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: naming-system-check-digit
valueCode:
valueOf: XON.5
type: STRING
expressionType: HL7Spec
extension_2-checkDigit:
condition: $xon4 NOT_NULL
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: identifier-check-digit
valueString:
type: STRING
expressionType: HL7Spec
valueOf: XON.4
extension_3-assigningAuthority:
condition: $xon6 NOT_NULL
generateList: true
expressionType: resource
valueOf: datatypes/HD/ExtensionAssigningAuthority
specs: XON.6
extension_4-location:
condition: $xon8 NOT_NULL
generateList: true
expressionType: nested
vars:
xon8: String, XON.8
expressionsMap:
url:
type: SYSTEM_URL
value: identifier-location
valueReference:
expressionType: reference
valueOf: datatypes/HD/Location
specs: XON.8
expressionType: HL7Spec
valueOf: XON.4
extension_3-assigningAuthority:
condition: $xon6 NOT_NULL
generateList: true
expressionType: resource
valueOf: datatypes/HD/ExtensionAssigningAuthority
specs: XON.6
extension_4-location:
condition: $xon8 NOT_NULL
generateList: true
expressionType: nested
vars:
xon8: String, XON.8
expressionsMap:
url:
type: SYSTEM_URL
value: identifier-location
valueReference:
expressionType: reference
valueOf: datatypes/HD/Location
specs: XON.8

address:
condition: $XADAddress NOT_NULL
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# $schema: ./../../../../../json_schema/fhir/hl7-to-fhir-mapping-resource-template.json

resourceType: RelatedPerson

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

name:
expressionType: resource
valueOf: datatypes/XPN/HumanName
7 changes: 7 additions & 0 deletions prime-router/metadata/HL7/catchall/hl7/message/ORM_O01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ resources:
additionalSegments:
- .PV2

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

- resourceName: OrderObservation
segment: .ORDER_DETAIL.OBSERVATION.OBX
group: ORDER
Expand Down
Loading

0 comments on commit a46da3b

Please sign in to comment.