View raw Markdown
type: fhirpath-docsource: fhirpath/input/pages/appendices.md

Dependencies

{% include dependency-table-short.xhtml %}

IP Statements

{% include ip-statements.xhtml %}

<a name="hl7v2"></a>

Use of FHIRPath on HL7 Version 2 messages

{: .appendix }

FHIRPath can be used against HL7 V2 messages. This UML diagram summarizes the Object Model on which the FHIRPath statements are written:

Class Model for HL7 V2{: height="456",width="760"}

In this Object Model:

Some example queries:

Message.segment.where(code = 'PID').field[3].element.first().simple()

Get the value of the first component in the first repeat of PID-3

Message.segment[2].elements(3).simple()

Get a collection with is the string values of all the repeats in the 3rd element of the 2nd segment. Typically, this assumes that there are no repeats, and so this is a simple value.

Message.segment.where(code = 'PID').field[3].element.where(component[4].value = 'MR').simple()

Pick out the MR number from PID-3 (assuming, in this case, that there's only one PID segment in the message. No good for an A17). Note that this returns the whole Cell - e.g. |value^^MR|, though often more components will be present)

Message.segment.where(code = 'PID').elements(3).where(component[4].value = 'MR').component[1].text

Same as the last, but pick out just the MR value

Message.group('PATIENT').group('PATIENT_OBSERVATION').item.ofType(Segment)
  .where(code = 'OBX' and elements(2).exists(components(2) = 'LN')))

Return any OBXs from the patient observations (and ignore others e.g. in a R01 message) segments that have LOINC codes. Note that if the parser cannot properly parse the Abstract Message Syntax, group() must fail with an error message.

FHIRPath Tooling and Implementation

{: .appendix }

The list of known tooling and implementation projects for the FHIRPath language has been moved to the HL7 confluence site{:target="_blank"}

Cross Version Analysis

{% include cross-version-analysis-inline.xhtml %}

Global Profiles

{% include globals-table.xhtml %}