Sidebar

Please explain the use of a tilde or squiggly ("~") in the hpath

+1 vote
9.8K views
asked Mar 21, 2014 by rich-c-2789 (16,240 points)
Please explain the use of a tilde or squiggly ("~") in the hpath.  I need to acces some data that follows a tilde ("~") but I am not sure what path to use in my channel.

1 Answer

0 votes
 
Best answer

First, lets list the HL7 delimiters taken from the CDC HL7 Version 2.5.1 Implementation Guide for Immunization Messaging:

Delimiters: Delimiter characters are used to separate segments, fields and components in an HL7 message.
The delimiter values are given in MSH-2 and used throughout the message. Applications must use agreed
upon delimiters to parse the message. Messages used in this Guide SHALL use the following delimiters:
     <CR> = Segment Terminator;
     | = Field Separator;
     ^ = Component Separator;
     & = Sub-Component Separator;
     ~ = Repetition Separator;
     \ = Escape Character.

Now lets look at an example using sample data:



On line two in the above example notice how the HPath changes from PID-3[1].4 when the cursor is positioned on the first "GEHC" versus PID-3[2].4 when positioned on the second "GEHC"

Because the tilde is the Repetition Separator, the instance for PID-3 is incremented from 1 to 2. I think this can be better explained by another example. In this example I simply removed the tilde ("~"). Which in this case doesn't makes sense but just to illustrate:



Above results in a HPath of PID-3[1].8.

Reading the HPath from right to left, lets compare the HPath for the second "GEHC", using the CDC specs:

PID-3[2].4 = Get the forth (.4) component of the second ([2]) repetition of the third (-3) field in the first PID (PID) segment.

PID-3[1].8 = Get the eighth (.8) component of the first ([1]) repetition of the third (-3) field in the first PID (PID) segment.

Note that PID and PID[1] are equivalent. We could write PID-3[2].4 as PID[1]-3[2].4

For more examples on using HPath see the section "HL7 - Node Path Syntax" in chapter "Node Paths" of the reference manual that ships with QIE.

answered Mar 21, 2014 by rich-c-2789 (16,240 points)
selected Mar 25, 2014 by brandon-w-8204
...