-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add CP to Extension mappings #16767
Add CP to Extension mappings #16767
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# $schema: ./../../../../../json_schema/fhir/hl7-to-fhir-mapping-resource-template.json | ||
|
||
url: | ||
type: SYSTEM_URL | ||
value: composite-price | ||
|
||
extension: | ||
expressionType: nested | ||
generateList: true | ||
expressions: | ||
- expressionType: nested | ||
expressionsMap: | ||
url: | ||
type: SYSTEM_URL | ||
value: hl7v2Field | ||
valueString: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: $cpExtensionName | ||
- expressionType: nested | ||
vars: | ||
cp11: STRING, CP.1 | ||
condition: $cp11 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
value: CP.1.1 | ||
valueDecimal: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.1.1 | ||
- expressionType: nested | ||
vars: | ||
cp12: STRING, CP.1.2 | ||
condition: $cp12 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
value: CP.1.2 | ||
valueString: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.1.2 | ||
- expressionType: nested | ||
vars: | ||
cp2: STRING, CP.2 | ||
condition: $cp2 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
valueOf: CP.2 | ||
valueString: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.2 | ||
- expressionType: nested | ||
vars: | ||
cp3: STRING, CP.3 | ||
condition: $cp3 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
valueOf: CP.3 | ||
valueDecimal: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.3 | ||
- expressionType: nested | ||
vars: | ||
cp4: STRING, CP.4 | ||
condition: $cp4 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
valueOf: CP.4 | ||
valueDecimal: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.4 | ||
- expressionType: nested | ||
vars: | ||
cp5: STRING_ALL, CP.5 | ||
condition: $cp5 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
value: CP.5 | ||
valueCodeableConcept: | ||
valueOf: datatypes/CWE/CodeableConcept | ||
specs: CP.5 | ||
expressionType: resource | ||
- expressionType: nested | ||
vars: | ||
cp6: STRING, CP.6 | ||
condition: $cp6 NOT_NULL | ||
expressionsMap: | ||
url: | ||
type: STRING | ||
valueOf: CP.6 | ||
valueString: | ||
type: STRING | ||
expressionType: HL7Spec | ||
valueOf: CP.6 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,36 @@ extension: | |
expressions: | ||
- expressionType: resource | ||
valueOf: datatypes/AUI/AUIExtension | ||
specs: IN1.14 | ||
specs: IN1.14 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these values will move to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't get to this before the codeowner review was left. In the interest of not making reviewers revise an already approved PR I left a comment to have this be done as part of the main IN1 work. #15500 |
||
- expressionType: resource | ||
vars: | ||
in137: STRING, IN1.37 | ||
condition: $in137 NOT_NULL | ||
valueOf: datatypes/CP/CPExtension | ||
constants: | ||
cpExtensionName: IN1.37 | ||
specs: IN1.37 | ||
- expressionType: resource | ||
vars: | ||
in138: STRING, IN1.38 | ||
condition: $in138 NOT_NULL | ||
valueOf: datatypes/CP/CPExtension | ||
constants: | ||
cpExtensionName: IN1.38 | ||
specs: IN1.38 | ||
- expressionType: resource | ||
vars: | ||
in140: STRING, IN1.40 | ||
condition: $in140 NOT_NULL | ||
valueOf: datatypes/CP/CPExtension | ||
constants: | ||
cpExtensionName: IN1.40 | ||
specs: IN1.40 | ||
- expressionType: resource | ||
vars: | ||
in141: STRING, IN1.41 | ||
condition: $in141 NOT_NULL | ||
valueOf: datatypes/CP/CPExtension | ||
constants: | ||
cpExtensionName: IN1.41 | ||
specs: IN1.41 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# $schema: ./../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json | ||
|
||
hl7Class: ca.uhn.hl7v2.model.v27.message.OML_O21 | ||
hl7Class: fhirengine.translation.hl7.structures.fhirinventory.message.OML_O21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was changed to get around some very uncommon edge cases. There is a ticket to update ORU-based mappings with the same change: #16755 This scenario appears to only occur for fields which have been Withdrawn between HL7 2.5.1 and 2.7. This causes the field type to be set to NULLDT by Hapi. This hasn't been an issue with other fields as Hapi will still handle them appropriate when going from a complex fhir type to NULLDT. However, in the case where the withdrawn field has complex subfields (Ex: IN1.38), there will be data modification or loss. |
||
|
||
constants: | ||
# Prefix for RS custom extension URLs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# $schema: ./../../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json | ||
|
||
elements: | ||
|
||
- name: cp-price-quantity | ||
value: [ '%resource.extension.where(url = "CP.1.1").value' ] | ||
hl7Spec: [ '%{cpField}-1-1' ] | ||
|
||
- name: cp-price-denomination | ||
value: [ '%resource.extension.where(url = "CP.1.2").value' ] | ||
hl7Spec: [ '%{cpField}-1-2' ] | ||
|
||
- name: cp-price-type | ||
value: [ '%resource.extension.where(url = "CP.2").value' ] | ||
hl7Spec: [ '%{cpField}-2' ] | ||
|
||
- name: cp-from-value | ||
value: [ '%resource.extension.where(url = "CP.3").value' ] | ||
hl7Spec: [ '%{cpField}-3' ] | ||
|
||
- name: cp-to-value | ||
value: [ '%resource.extension.where(url = "CP.4").value' ] | ||
hl7Spec: [ '%{cpField}-4' ] | ||
|
||
- name: cp-range-units | ||
resource: '%resource.extension.where(url = "CP.5").value' | ||
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml | ||
constants: | ||
cweField: '%{cpField}-5' | ||
|
||
- name: cp-range-type | ||
value: [ '%resource.extension.where(url = "CP.6").value' ] | ||
hl7Spec: [ '%{cpField}-6' ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package gov.cdc.prime.router.datatests.mappinginventory.cp | ||
|
||
import gov.cdc.prime.router.datatests.mappinginventory.verifyHL7ToFHIRToHL7Mapping | ||
import org.junit.jupiter.api.Test | ||
|
||
class CPTests { | ||
@Test | ||
fun `test CP mapped to CPExtension`() { | ||
assert( | ||
verifyHL7ToFHIRToHL7Mapping( | ||
"catchall/cp/cp-to-extension", | ||
outputSchema = "classpath:/metadata/hl7_mapping/OML_O21/OML_O21-test.yml" | ||
).passed | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted in standup, this pattern is somewhat cobbled together from other extension mapping patterns because of its uniqueness.
CP is somewhat unique in that:
With that in mind, the idea here is to create something that is more formalized than simply adding each field to Resource.extension by itself. This allows CP to be noted as such when it shows up, and makes it easier to send CP data if a FHIR sender ever needed to do so.
Still, this is what made sense to me, so if there is a format that better fits existing/future patterns I'm open to it.