Skip to content

Commit

Permalink
OBR -> Specimen Additions and Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JFisk42 committed Nov 15, 2024
1 parent 4622979 commit 25ea2eb
Show file tree
Hide file tree
Showing 31 changed files with 13,145 additions and 9,627 deletions.
155 changes: 155 additions & 0 deletions prime-router/metadata/HL7/catchall/hl7/segments/ORC/OBRExtension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,70 @@ extension:
valueOf: datatypes/EI/Identifier
expressionType: resource
specs: OBR.3
- expressionType: nested
vars:
obr8: OBR.8
condition: $obr8 NOT_NULL
generateList: true
expressionsMap:
url:
type: STRING
value: OBR.7, OBR.8
valuePeriod:
expressionType: nested
vars:
start: OBR.7
end: OBR.8
dateTimeIn: OBR.7
dateTimeOut: OBR.8
expressions:
- valueOf: datatypes/DR/Period
expressionType: resource
- expressionType: nested
vars:
obr7: OBR.7
obr8: OBR.8
condition: $obr7 NOT_NULL && $obr8 NULL
generateList: true
expressionsMap:
url:
type: STRING
value: OBR.7
valueDateTime:
expressionType: nested
vars:
dateTimeIn: OBR.7
expressions:
- type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
expressionType: JEXL
_valueDateTime:
expressionType: nested
expressionsMap:
extension_1:
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: hl7v2-date-time
valueString:
type: STRING
valueOf: OBR.7
expressionType: HL7Spec
- expressionType: nested
vars:
obr9: STRING, OBR.9
condition: $obr9 NOT_NULL
specs: OBR.9
generateList: true
expressionsMap:
url:
type: STRING
value: OBR.9
valueQuantity:
expressionType: resource
valueOf: datatypes/CQ/Quantity
- expressionType: nested
vars:
obr10: STRING_ALL, OBR.10
Expand Down Expand Up @@ -83,6 +147,97 @@ extension:
expressionType: resource
valueOf: datatypes/CWE/CodeableConcept
specs: OBR.13
- expressionType: nested
vars:
obr14: STRING, OBR.14
condition: $obr14 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.14
valueDateTime:
type: STRING
valueOf: "GeneralUtils.dateTimeWithZoneId(dateTimeIn,ZONEID)"
expressionType: JEXL
vars:
dateTimeIn: OBR.14
_valueDateTime:
condition: $obr14 NOT_NULL
expressionType: nested
vars:
obr14: OBR.14
expressionsMap:
extension:
generateList: true
expressionType: nested
expressionsMap:
url:
type: SYSTEM_URL
value: hl7v2-date-time
valueString:
type: STRING
valueOf: $obr14
expressionType: HL7Spec
- expressionType: nested
vars:
obr151: STRING_ALL, OBR.15.1
condition: $obr151 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.15.1
valueCodeableConcept:
valueOf: datatypes/CWE/CodeableConcept
expressionType: resource
specs: OBR.15.1
- expressionType: nested
vars:
obr152: STRING_ALL, OBR.15.2
condition: $obr152 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.15.2
valueCodeableConcept:
valueOf: datatypes/CWE/CodeableConcept
expressionType: resource
specs: OBR.15.2
- expressionType: nested
vars:
obr153: OBR.15.3
condition: $obr153 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.15.3
valueString:
type: STRING
valueOf: OBR.15.3
expressionType: HL7Spec
- expressionType: nested
vars:
obr154: STRING_ALL, OBR.15.4
condition: $obr154 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.15.4
valueCodeableConcept:
valueOf: datatypes/CWE/CodeableConcept
expressionType: resource
specs: OBR.15.4
- expressionType: nested
vars:
obr156: STRING_ALL, OBR.15.6
condition: $obr156 NOT_NULL
expressionsMap:
url:
type: STRING
value: OBR.15.6
valueCodeableConcept:
valueOf: datatypes/CWE/CodeableConcept
expressionType: resource
specs: OBR.15.6
- expressionType: nested
vars:
obr16: STRING_ALL, OBR.16
Expand Down
13 changes: 4 additions & 9 deletions prime-router/metadata/HL7/catchall/hl7/segments/ORC/Specimen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,16 @@ type:
specs: OBR.15.1

container:
condition: $obr152
condition: $obr152 NOT_NULL
expressionType: nested
generateList: true
vars:
obr152: OBR.15.2
expressionsMap:
additiveCodeableConcept:
expressionType: nested
expressions:
- expressionType: nested
expressionsMap:
text:
type: STRING
valueOf: OBR.15.2
expressionType: HL7Spec
valueOf: datatypes/CWE/CodeableConcept
expressionType: resource
specs: OBR.15.2

collection:
condition: $obr7 NOT_NULL || $obr8 NOT_NULL || $obr9 NOT_NULL || $obr10 NOT_NULL || $obr15 NOT_NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ elements:
constants:
obrFieldPath: '/ORDER(%{orderIndex})/OBSERVATION_REQUEST/OBR'

- name: observation-request-specimen
resource: '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR")'
schema: classpath:/metadata/hl7_mapping/resources/Specimen/OBR.yml
constants:
obrFieldPath: '/ORDER(%{orderIndex})/OBSERVATION_REQUEST/OBR'

- name: observation-request-note
resource: '%resource.note'
resourceIndex: noteIndex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ elements:
constants:
obrFieldPath: '/PATIENT_RESULT(%{patientIndex})/ORDER_OBSERVATION(%{orderIndex})/OBR'

- name: observation-request-specimen
resource: '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR")'
schema: classpath:/metadata/hl7_mapping/resources/Specimen/OBR.yml
constants:
obrFieldPath: '/PATIENT_RESULT(%{patientIndex})/ORDER_OBSERVATION(%{orderIndex})/OBR'

- name: observation-request-diagnostic-report
resource: '%resource'
schema: classpath:/metadata/hl7_mapping/resources/DiagnosticReport/OBR.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ elements:
value: [ '%resource.occurrence.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-6' ]

- name: observation-collected-datetime
condition: '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.is(dateTime)'
value: [ '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-7' ]

- name: observation-collected-datetime-start
condition: '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.is(Period)'
value: [ '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.start.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-7' ]

- name: observation-collected-end-datetime
condition: '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.is(Period)'
value: [ '%resource.specimen.resolve().where(extension(%`rsext-hl7v2Segment`).value = "OBR").collection.collected.end.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-8' ]

- name: ordering-provider-from-practitioner
condition: '%context.requester.resolve().is(Practitioner) and %context.requester.resolve().extension(%`rsext-hl7v2Field`).value = "OBR.16"'
schema: classpath:/metadata/hl7_mapping/resources/Practitioner/XCN.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ elements:
constants:
eiFieldPath: '%{obrFieldPath}-3'

- name: observation-collected-datetime
value: [ '%resource.extension.where(url = "OBR.7").value.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-7' ]

- name: observation-collected-period-start
resource: '%resource.extension.where(url = "OBR.7, OBR.8").value.start'
schema: classpath:/metadata/hl7_mapping/datatypes/dateTime/DTMorDT.yml
constants:
dtmFieldPath: '%{obrFieldPath}-7'

- name: observation-collected-period-end
resource: '%resource.extension.where(url = "OBR.7, OBR.8").value.end'
schema: classpath:/metadata/hl7_mapping/datatypes/dateTime/DTMorDT.yml
constants:
dtmFieldPath: '%{obrFieldPath}-8'

- name: specimen-collection-volume
resource: '%resource.extension.where(url = "OBR.9").value'
schema: classpath:/metadata/hl7_mapping/datatypes/Quantity/CQ.yml
constants:
cqFieldPath: '%{obrFieldPath}-9'

- name: collector-identifier
resource: '%resource.extension.where(url = "OBR.10").value.resolve()'
schema: classpath:/metadata/hl7_mapping/resources/Practitioner/XCN.yml
Expand All @@ -39,6 +61,38 @@ elements:
constants:
cweField: '%{obrFieldPath}-13'

- name: specimen-received-datetime
value: [ '%resource.extension.where(url = "OBR.14").value.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-14' ]

- name: specimen-source-name
resource: '%resource.extension.where(url = "OBR.15.1").value'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-1'

- name: specimen-source-additives
resource: '%resource.extension.where(url = "OBR.15.2").value'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-2'

- name: specimen-source-collection-method-freetext
value: [ '%resource.extension.where(url = "OBR.15.3").value' ]
hl7Spec: [ '%{obrFieldPath}-15-3' ]

- name: specimen-source-body-site
resource: '%resource.extension.where(url = "OBR.15.4").value'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-4'

- name: specimen-source-collection-method-code
resource: '%resource.extension.where(url = "OBR.15.6").value'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-6'

- name: call-back-phone-number-obr-from-extension
condition: '%context.requester.where(extension(%`rsext-callback-number`).value.extension(%`rsext-hl7v2Field`).value[%telecomIndex] = "OBR.17").exists().not()'
resource: '%resource.extension.where(url = "https://reportstream.cdc.gov/fhir/StructureDefinition/callback-number").value'
Expand Down Expand Up @@ -128,7 +182,6 @@ elements:
cneFieldPath: '%{obrFieldPath}-45(%{cweIndex})'
resourceIndex: cweIndex


- name: medically-necessary-duplicate-procedure
resource: '%resource.extension.where(url = "OBR.48").value'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# $schema: ./../../../../../../../metadata/json_schema/fhir/fhir-to-hl7-mapping.json

elements:

- name: observation-collected-datetime
condition: '%resource.collection.collected.is(dateTime)'
value: [ '%resource.collection.collected.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-7' ]

- name: observation-collected-datetime-start
condition: '%resource.collection.collected.is(Period)'
value: [ '%resource.collection.collected.start.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-7' ]

- name: observation-collected-end-datetime
condition: '%resource.collection.collected.is(Period)'
value: [ '%resource.collection.collected.end.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-8' ]

- name: specimen-collection-volume
resource: '%resource.collection.quantity'
constants:
cqFieldPath: '%{obrFieldPath}-9'
schema: classpath:/metadata/hl7_mapping/datatypes/Quantity/CQ.yml

- name: specimen-received-datetime
value: [ '%resource.receivedTime.extension(%`rsext-hl7v2-date-time`).value' ]
hl7Spec: [ '%{obrFieldPath}-14' ]

- name: specimen-source-name
resource: '%resource.type'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-1'

- name: specimen-source-additives
resource: '%resource.container.additive'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-2'

- name: specimen-source-collection-method-freetext
value: [ '%resource.note.where(extension(%`rsext-hl7v2Component`).value = "OBR.15.3").text' ]
hl7Spec: [ '%{obrFieldPath}-15-3' ]

- name: specimen-source-body-site
resource: '%resource.collection.bodySite'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-4'

- name: specimen-source-collection-method-code
resource: '%resource.condition'
schema: classpath:/metadata/hl7_mapping/datatypes/codeableConcept/CWE.yml
constants:
cweField: '%{obrFieldPath}-15-6'

Large diffs are not rendered by default.

Loading

0 comments on commit 25ea2eb

Please sign in to comment.