Parse an HL7 message
Verified
Added by iNTERFACEWARE
How to parse an HL7 message and create an HL7 output message
Source Code
local Msg, Name = hl7.parse{vmd='example/demo.vmd',data=Data} local Out = hl7.message{vmd='example/demo.vmd',name=Name}
Description
How to parse an HL7 message and create an HL7 output message
Usage Details
When you parse an HL7 input message you also need to create an HL7 output message. The reason for this is that hl7.parse()
returns a read-only node tree (so you always have an unchanged copy of the original message). Therefore you also need to use hl7.message()
to create a writable node tree to use when mapping, filtering and transforming the message.
How to use the snippet:
- Paste the code into a Filter or To Translator script
- Change the vmd parameter if you want to use a different VMD file
- Do not change the data parameter (99.9% of the time it is correct as is)
More Information
Added by iNTERFACEWARE
Use table.remove() to delete an element from a table
Added by iNTERFACEWARE
Use node.remove() to delete an element from a table,
Added by iNTERFACEWARE
Use node.setInner() to set the value of an XML node, only works for XML nodes
Added by iNTERFACEWARE
Use util.sleep() to pause code execution for the specified number of milliseconds
Added by iNTERFACEWARE
Use node.append() to append a node to an XML node tree
Added by iNTERFACEWARE
Use table.insert() to insert an element into a table
Added by iNTERFACEWARE
How to parse an X12 message using x12.parse()
Added by iNTERFACEWARE
Use os.ts.difftime() to get the time in seconds between two time, this function allows for time zones and daylight saving
Added by iNTERFACEWARE
Use os.fs.glob() to return to process a list of filenames and statistics matching a specified pattern
Added by iNTERFACEWARE
Use node.insert() to insert a node into an XML node tree
Added by iNTERFACEWARE
Use node.child() to return the node of the specified name, works for all node types
Added by iNTERFACEWARE
Use node.childCount() to count the number of children for a specified node, works for all node types
Added by iNTERFACEWARE
Use node.isKey() to check if a node is the primary key for a database table, this method only for table node trees
Added by iNTERFACEWARE
Use node.isLeaf() to check if a node is a leaf node (has no children), works for all node types
Added by iNTERFACEWARE
Use node.isNull() to check if a node is null (not present), works for all node types
Added by iNTERFACEWARE
Use node.nodeName() to get the name of a node, works for all node types
Added by iNTERFACEWARE
Use node.nodeValue() to get the value of a leaf node, works for all node types
Added by iNTERFACEWARE
Use node.nodeType() to get the type of a node, works for all node types
Added by iNTERFACEWARE
Use node.setNodeValue() to set the value of a leaf node, works for all node types