Sidebar

How do I ensure that encoded escape characters output the desired text?

0 votes
521 views
asked Aug 29, 2016 by risa-p-1914 (310 points)

We had an incident where a transcriptionist utilized an "&" in the text of a document. It looks like it's part of the Diagnosis code, so it may always be delivered as such.   The source message coming from PowerScribe utilizes the escape character \T\ as recommended by HL7 in the message. But when it was output to our EMR, only the information prior to the \T\ came across. If I added a space between the slashes I was able to get the entire message to output in the emr, but it did not change \T\ in our EMR to an &. It just left it as a space. This scenario is pretty rare so far in our experience with QIE, but we will be integrating with our state HIE soon, and this scenario could become more common in the future.  Do I need to add a mapping look for escape charachters including \T\?  I thought QIE had the ability to identify the esape characters. Below is the example- changed with test patient information.  Maybe I'm not completely understanding how the encoded characters are supposed to work. Do I need to do a stringUtils.replace in the mapping always looking for each escape charaters? Please let me know how to resolve this for the future.  

 
MSGID 85341611 in Pscribe360 channel
 
OBX|1|FT|||\.br\CLINICAL HISTORY: R11.2 N\T\V (nausea and vomiting) 2 787.91 R19.7 Diarrhea 3 789.03 R10.31 Abdominal pain, chronic, right lower quadrant 4 789.03 G89.29 Abdominal pain, chronic, right lower quadrant right lower quadrant pain and right flank pain with nausea and vomiting.\.br\\.br\TECHNIQUE: (Text has been deleted for the example) Signature Date/Time: 8/24/2016 10:17 AM\.br\||||||F|||||758^Green MD^Adam|
 
In the above example, all that came through on the OBX line was CLINICAL HISTORY: R11.2 N 
If I added a space between N \T\ V it came through completely but did not add an & in the EMR. - see MSGID 85336341.

1 Answer

+1 vote
 
Best answer
When delimiters such as |^&\ are used inside of a field in an HL7 message, these characters must be encoded to prevent problems with the receiving system parsing the message. To fix this problem these characters are encoded as following:

| = \F\

^ = \S\

& = \T\

\ = \E\

You can also encode content by passing \Xdddd...\ where dd is the hex value of a character. The receiving system will then parse the HL7 message and then decode any of the characters found.

 

QIE does have two helper functions for encoding and decoding HL7 strings. To decode a message received you will pass the contents to qie.decodeHL7(content), and to encode a message you will call qie.encodeHL7(content).

Example:

var OBX = message.getNode('OBX-5');

OBX = qie.decodeHL7(OBX);

This will translate the above string "N\T\V (nausea and vomiting)" to "N&V (nausea and vomiting)".

To encode it back:

OBX = qie.encodeHL7(OBX);

This will translate it back to "N\T\V (nausea and vomiting)".
answered Aug 29, 2016 by amanda-w-3695 (4,840 points)
selected Aug 29, 2016 by risa-p-1914
...