Map Entire HL7 Messages or Segments
For HL7 and X12 messages, the mapTree()
and mapRange()
functions efficiently copy messages between identical structures.
Both functions simply map the elements in a node sequentially, therefore you should only use these functions to map messages with identical structures (identical fields and identical order).
For example, these are useful for performing HL7 to HL7 mapping when you are only making minimal changes to a message passing through.
mapTree()
function maps a single node
-- map the entire MSH segment
OutboundMessage.MSH:mapTree(InboundMessage.MSH)
mapRange()
function maps a range of nodes.
-- maps the first seven segments
OutboundMessage:mapRange(InboundMessage,1,7)Â
You can see an example of these used in our HL7 to HL7 Map component.