Prevent escaping of HL7 special characters

Added by iNTERFACEWARE

How to prevent escaping of special characters like "&" in an HL7 message

Source Code
function main(Data)
   local Msg, Name = hl7.parse{vmd='example/demo.vmd', data = Data} 
   local Out = hl7.message{vmd='example/demo.vmd', name = Name} 
   
   Out:mapTree(Msg)
   
   -- message processing goes here...
      
   local S = Out.OBX:S()
   trace(S)
      
   -- This will "unescape" \T\ at the start of any segment 
   -- not just OBX - you can add extra logic if needed
   S = S:gsub('|\\T\\','|&')
   trace(S)
   
end

function string.startsWith(s,c)
   if s:find(c,1,true)==1 then return true end
end
Description
How to prevent escaping of special characters like "&" in an HL7 message