hl7.resource.Observation.yml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hl7v2-fhir-converter Show documentation
Show all versions of hl7v2-fhir-converter Show documentation
FHIR converter is a Java based library that enables converting Hl7v2 messages to FHIR resources
#
# (C) Copyright IBM Corp. 2020, 2021
#
# SPDX-License-Identifier: Apache-2.0
#
#Observation resource
---
resourceType: Observation
id:
type: STRING
valueOf: 'UUID.randomUUID()'
expressionType: JEXL
identifier_1: #joins filler | placer | MSH.7 with whatever gets returned from BUILD_FROM_CWE. that magic happens in identifier_Observation
valueOf: datatype/Identifier_Observation
generateList: true
expressionType: resource
vars:
obx3: BUILD_IDENTIFIER_FROM_CWE, OBX.3
fillpla: STRING, ORC.3.1 | OBR.3.1 | ORC.2.1 | OBR.2.1 | MSH.7
constants:
sys: "urn:id:extID"
joinChar: '-'
identifier_2:
condition: $valueIn NOT_NULL
valueOf: datatype/Identifier_var
generateList: true
expressionType: resource
vars:
valueIn: OBX.21.1
systemCX: OBX.21.2
identifier_3:
condition: $id NOT_NULL
valueOf: datatype/Identifier_Observation
generateList: true
expressionType: resource
vars:
obx3: BUILD_IDENTIFIER_FROM_CWE, OBX.5
fillpla: STRING, ORC.3.1 | OBR.3.1 | ORC.2.1 | OBR.2.1 | MSH.7
constants:
sys: "urn:id:extID"
joinChar: '-'
status:
type: OBSERVATION_STATUS
default: unknown
valueOf: OBX.11
expressionType: HL7Spec
# When OBX's are missing or TX based, we don't want to create an Observation.
# When TX, because content is already appended to an associated DiagnosticReport or DocumentReference
# Logic: if OBX exists AND ( (OBX.2 exists AND OBX.2 is NOT TX) OR (OBX.2 is null/empty) ) AND OBX.3 NOT NULL CREATE the Observation.
# 'code' is set 'required: true' to cause all or nothing creation logic
# The expression is nested and values are passed to the nested so that BOTH values control the 'all or nothing'
code:
expressionType: nested
required: true
vars:
obx3: OBX.3
obx2: STRING, OBX.2
expressions:
- condition: $obx3 NOT_NULL && $obx2 NOT_EQUALS_STRING TX
valueOf: datatype/CodeableConcept
expressionType: resource
specs: $obx3
subject:
valueOf: datatype/Reference
expressionType: resource
specs: $Patient
encounter:
valueOf: datatype/Reference
expressionType: resource
specs: $Encounter
effectiveDateTime:
type: DATE_TIME
valueOf: OBX.14 | OBX.19
expressionType: HL7Spec
issued:
type: DATE_TIME
valueOf: OBR.22 | OBX.19
expressionType: HL7Spec
valueString:
condition: $obx2 EQUALS ST
type: STRING_ALL
valueOf: OBX.5
expressionType: HL7Spec
vars:
obx2: STRING, OBX.2
valueQuantity_1:
valueOf: datatype/Quantity
expressionType: resource
condition: $obx2 EQUALS NM
vars:
value: OBX.5
unit: OBX.6.1
code: OBX.6.1
obx2: STRING, OBX.2
resolvedSystem: SYSTEM_URL, OBX.6.3
valueQuantity_2:
valueOf: datatype/Quantity
expressionType: resource
condition: $obx2 EQUALS SN && $separator NULL
vars:
value: OBX.5.2
unit: OBX.6.1
code: OBX.6.1
comparator: OBX.5.1
obx2: STRING, OBX.2
separator: STRING, OBX.5.3
resolvedSystem: SYSTEM_URL, OBX.6.3
valueQuantity_3:
valueOf: datatype/Quantity
expressionType: resource
condition: $obx2 EQUALS SN && $separator NOT_NULL && $separator NOT_EQUALS ':' && $separator NOT_EQUALS '/'
vars:
value: OBX.5.2
unit: OBX.6.1
code: OBX.6.1
comparator: OBX.5.1
obx2: STRING, OBX.2
separator: STRING, OBX.5.3
resolvedSystem: SYSTEM_URL, OBX.6.3
valueCodeableConcept:
condition: $obx2 EQUALS CF || $obx2 EQUALS CNE || $obx2 EQUALS CWE || $obx2 EQUALS CE
valueOf: datatype/CodeableConcept
generateList: true
expressionType: resource
specs: OBX.5
vars:
obx2: STRING, OBX.2
valuePeriod:
condition: $obx2 EQUALS DR
valueOf: datatype/Period
expressionType: resource
vars:
code: OBX.5
obx2: STRING, OBX.2
valueDateTime:
condition: $obx2 EQUALS DT || $obx2 EQUALS DTM
type: DATE_TIME
valueOf: OBX.5
expressionType: HL7Spec
vars:
obx2: STRING, OBX.2
valueTime:
condition: $obx2 EQUALS TM
type: TIME
valueOf: OBX.5
expressionType: HL7Spec
vars:
obx2: STRING, OBX.2
valueRatio_1:
condition: $obx2 EQUALS SN && $separator NOT_NULL && $separator EQUALS ':'
valueOf: datatype/Ratio
expressionType: resource
specs: OBX.5
vars:
numerator: SN.2
denominator: SN.4
obx2: STRING, OBX.2
separator: STRING, SN.3
valueRatio_2:
condition: $obx2 EQUALS SN && $separator NOT_NULL && $separator EQUALS '/'
valueOf: datatype/Ratio
expressionType: resource
specs: OBX.5
vars:
numerator: SN.2
denominator: SN.4
obx2: STRING, OBX.2
separator: STRING, SN.3
interpretation:
valueOf: datatype/CodeableConcept
expressionType: resource
specs: OBX.8
note_1:
valueOf: datatype/Annotation
expressionType: resource
condition: $obx3 EQUALS 48767-8
specs: OBX
vars:
obx3: STRING, OBX.3.1
annotationText: STRING, OBX.5
note_2:
valueOf: datatype/Annotation
condition: $annotationText NOT_NULL
expressionType: resource
vars:
annotationText: NTE.3 *&, GeneralUtils.concatenateWithChar(annotationText, ' \n')
bodySite:
valueOf: datatype/CodeableConcept
expressionType: resource
specs: OBX.20
method:
valueOf: datatype/CodeableConcept
expressionType: resource
specs: OBX.17
referenceRange:
valueOf: secondary/ReferenceRange
condition: $textValue NOT_NULL
generateList: true
expressionType: resource
specs: OBX.7
vars:
low: OBX.7, GeneralUtils.extractLow(low)
high: OBX.7, GeneralUtils.extractHigh(high)
appliestoValue: OBX.10
textValue: OBX.7
typeValue: OBX.10
unit: OBX.6
performer_1:
condition: $performerValue NOT_NULL
valueOf: resource/Practitioner
generateList: true
expressionType: reference
specs: OBX.16
vars:
performerValue: OBX.16
performer_2:
condition: $performerValue2 NOT_NULL
valueOf: resource/Organization
generateList: true
expressionType: reference
specs: OBX.23
vars:
performerValue2: OBX.23
orgAddressXAD: OBX.24
orgContactXCN: OBX.25
constants:
# Observation Organization needs an ADMIN purpose
orgContactPurposeCode: 'ADMIN'
orgContactPurposeSystemCode: 'contactentity-type'
orgContactPurposeDisplay: 'Administrative'
orgContactPurposeText: 'Organization Medical Director'
device:
condition: $deviceValue NOT_NULL
valueOf: resource/Device
generateList: true
expressionType: reference
specs: OBX.18
vars:
deviceValue: OBX.18
category:
condition: $specimen NOT_NULL
valueOf: datatype/CodeableConcept_var
generateList: true
expressionType: resource
vars:
system: SYSTEM_URL, $system_code
specimen: SPM.4
constants:
code: 'laboratory'
system_code: 'observation-category'
display: 'Laboratory'