Convert HL7 messages to/from XML

Verified
Added by iNTERFACEWARE

How to convert an HL7 message to and from an XML representation, using chm.toXml{} and chm.fromXml{}

Source Code
-- convert an HL7 message to XML representation
local xml = chm.toXml{vmd='example/demo.vmd', data=Data}

-- convert XML to an HL7 message
local Data = chm.fromXml{vmd='example/demo.vmd', data=xml}

-- convert an HL7 node tree to XML
local Msg = hl7.parse{vmd='example/demo.vmd', data=Data}
local xml = chm.toXml{vmd='example/demo.vmd', data=Msg:S()}
Description
How to convert an HL7 message to and from an XML representation, using chm.toXml{} and chm.fromXml{}
Usage Details

Demonstrates how to convert an HL7 message to or from an XML representation,  using chm.toXml{} and chm.fromXml{}.

How to use the snippet:

  • Use a channel component that has HL7 sample
    Note: You can import the SampleData.txt file if required
  • Paste the code into your script
  • Inspect the annotations to see how it works