I have ran a sample message through, and it appears as though Ensemble is
not un-escaping the \S| to ^ on the way out, so the receiving system is
displaying the result as: x10\S\9/L
I do the reverse of this, but you'll get the idea...
ClassMethod Unescape(pData As %String = "") As %String [ Final ]
{
Set replace("\.br\")=$C(13)
Set replace("\F\")="|"
Set replace("\R\")="~"
Set replace("\S\")="^"
Set replace("\E\")="\"
Set replace("\T\")="&"
Quit $$replaceArray^EnsUtil(pData,.replace)
}
Thanks, Gary
________________________________
From: ensemble-in-healthcare@googlegroups.com
[mailto:ensemble-in-healthcare@googlegroups.com] On Behalf Of Marc Lang
Sent: Friday, May 11, 2012 10:41 AM
To: InterSystems: Ensemble in Healthcare
Subject: [InterSystems-EnsHlth] HL7 Escape Characters Help
Hi,
We have a supplied who currently sends labs results in HL7 like this:
I have ran a sample message through, and it appears as though Ensemble
is not un-escaping the \S| to ^ on the way out, so the receiving system
is displaying the result as: x10\S\9/L
Any idea how I would get ensemble to un-escape?
Thanks
-- You received this message because you are subscribed to the Google
Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to
Ensemble-in-Healthcare@googlegroups.com
To unsubscribe from this group, send email to
Ensemble-in-Healthcare-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
Sorry, think I understand now - I need to unescape the entire message, and
send the unescaped message out to receiving system, as it appears to do no
unescaping, and treats x10\S\9/L as literal
My production is a simple TCP HL7 Service / Router w Transform / TCP HL7
Operation
On 11 May 2012 15:40, Marc Lang <marc.c.l...@gmail.com> wrote:
> I have ran a sample message through, and it appears as though Ensemble is
> not un-escaping the \S| to ^ on the way out, so the receiving system is
> displaying the result as: x10\S\9/L
To recap - it sounds like you have a sending lab system and a receiving system that are both non-compliant in the same way and thus are happy together. Now the lab system wants to get compliant with the HL7 escaping standard but the receiving system isn't going to change.
Since the lab results are in a pretty strict format you can probably just use a DTL to unescape the fields you know will need it, to prepare them for sending to the non-compliant receiving application.
There are methods Escape() and Unescape() in class EnsLib.HL7.Segment that you can use.
> Sorry, think I understand now - I need to unescape the entire message, > and send the unescaped message out to receiving system, as it appears > to do no unescaping, and treats x10\S\9/L as literal
> My production is a simple TCP HL7 Service / Router w Transform / TCP > HL7 Operation
> On 11 May 2012 15:40, Marc Lang <marc.c.l...@gmail.com > <mailto:marc.c.l...@gmail.com>> wrote:
> Hi,
> We have a supplied who currently sends labs results in HL7 like this:
> I have ran a sample message through, and it appears as though
> Ensemble is not un-escaping the \S| to ^ on the way out, so the
> receiving system is displaying the result as: x10\S\9/L
> Any idea how I would get ensemble to un-escape?
> Thanks
> -- > You received this message because you are subscribed to the Google > Groups "InterSystems: Ensemble in Healthcare Community" group.
> To post to this group, send email to > Ensemble-in-Healthcare@googlegroups.com
> To unsubscribe from this group, send email to > Ensemble-in-Healthcare-unsubscribe@googlegroups.com
> For more options, visit this group at > http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
The Escape() and Unescape() methods are designed to work on a segment instance because it is critical for them to know what the separators apply to the segment content being modified. However this means you can't use the standard assign statements generated by drag-and-drop in the DTL editor, you have to use a code block something like this:
<code> Set tSegObj=source.GetSegmentAt("OBX") </code>
then a standard assign:
<assign property=target.{OBX:6} value=tSegObj.Unescape(tSegObj.GetValueAt(6)) />
or
<assign property=target.{OBX:6} value=tSegObj.Unescape(source.{OBX:6}) />
> To recap - it sounds like you have a sending lab system and a > receiving system that are both non-compliant in the same way and thus > are happy together. Now the lab system wants to get compliant with the > HL7 escaping standard but the receiving system isn't going to change.
> Since the lab results are in a pretty strict format you can probably > just use a DTL to unescape the fields you know will need it, to > prepare them for sending to the non-compliant receiving application.
> There are methods Escape() and Unescape() in class EnsLib.HL7.Segment > that you can use.
> Ted
> On 5/11/2012 10:55 AM, Marc Lang wrote:
>> Sorry, think I understand now - I need to unescape the entire >> message, and send the unescaped message out to receiving system, as >> it appears to do no unescaping, and treats x10\S\9/L as literal
>> My production is a simple TCP HL7 Service / Router w Transform / TCP >> HL7 Operation
>> On 11 May 2012 15:40, Marc Lang <marc.c.l...@gmail.com >> <mailto:marc.c.l...@gmail.com>> wrote:
>> Hi,
>> We have a supplied who currently sends labs results in HL7 like this:
>> I have ran a sample message through, and it appears as though
>> Ensemble is not un-escaping the \S| to ^ on the way out, so the
>> receiving system is displaying the result as: x10\S\9/L
>> Any idea how I would get ensemble to un-escape?
>> Thanks
>> -- >> You received this message because you are subscribed to the Google >> Groups "InterSystems: Ensemble in Healthcare Community" group.
>> To post to this group, send email to >> Ensemble-in-Healthcare@googlegroups.com
>> To unsubscribe from this group, send email to >> Ensemble-in-Healthcare-unsubscribe@googlegroups.com
>> For more options, visit this group at >> http://groups.google.com/group/Ensemble-in-Healthcare?hl=en