Question
· Mar 23

How to Remove Escape character using IRIS DTL

have the following in an SIU messages: AIS|1||COLO \T\ EGD^COLONOSCOPY \T\ EGD|||||||Can||

Question: Is there a way to remove the escape character /T/ using the IRIS dtl?

Tried Function: ReplaceStr; Translate, Strip to no avail.

thanks

Product version: IRIS 2023.3
Discussion (4)3
Log in or sign up to continue

If the target of your transformation is an HL7 message you should not unescape HL7 content, if you do it your HL7 message will be invalid.

In your example \T\ is the escape of the "&" character that is a field separator.

If the target of your transformation is not an HL7 message then you do need to unescape your fields.

Instead of using $translate or $replace I suggest using the Unescape() method in the EnsLib.HL7.Segment class, this assure you are unescaping all possible escaped character.
The Unescape() method is in the segment class, so first you need to reference a segment (any segment), then the Unescape() method. I'd use the MSH segment, so your method call will be:
source.GetSegmentAt("MSH").Unescape()

Then all you need is to pass the field reference, for exaple:

source.GetSegmentAt("MSH").Unescape(source.{AIS:UniversalServiceIdentifier.Identifier})
or/and:
source.GetSegmentAt("MSH").Unescape(source.{AIS:UniversalServiceIdentifier.Text})