Question
· Apr 5, 2018

trying to copy an ampersand into the Value of an assign action

I am trying to copy a string that includes an ampersand into OBX.3.1

I have tried multiple combinations of escape sequences and single/double quotes and about everything I can think of, but I cannot get the ampersand into the OBX3.1 field.

Discussion (6)2
Log in or sign up to continue

I believe I have it figured out.... I changed the value to "&GDT"

it is the way the Ensemble Tester was showing that threw me off : (

When I would run the DTL through the tester and hover over the result field, it would show 3.1.2, but when I actually used the transform in a rule and ran the same message through, it showed up in the destination system in 3.1.1.

I guess this is a life lesson, don't trust the output message in the Test Transform !    I wasted a couple hours trying different combinations and characters.....grrrrrrr

You may already understand this, but it bears repeating: If your intent is to include a literal ampersand symbol, you should also change the sub-component separator in MSH-2 in keeping with the formal HL7 spec.

Unfortunately, many vendors don't understand (or bother to handle) HL7 escaped characters, and some of them don't even pay attention to the values in MSH-2 ... leaving us forced to generate what is essentially badly-formed HL7.

Excellent point Jeffrey, I've only seen the symbol's changed in MSH-2 during an HL7 training course I took many many moons ago, but you are technically correct.

I do think the popup that comes up in Ensemble in the Message Viewer and the DTL Tester is misleading though, since the ampersand is a subcomponent separator, shouldn't the popup show 3.1.1.1 rather than 3.1.2    ?

The cursor is hovering over the 2nd sub-component of the first component of the field. 3 is the field, 3.1 is the first component of the field, 3.1.1 is the first sub-component of the first component of the field, and 3.1.2 is the second sub-component of the first component of the field. If the field has repetitions (delimited by a ~), the first repetition would be referenced as 3(1), with its components and sub-components referenced as 3(1).1, 3(1).1.1, 3(1).1.2, etc.