Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • The maptree and maprange functions copy messages between identical structures.

  • Useful for cases when you are not transforming a message, only implementing minimal changes.

  • same inbound/outbound message type and structure

mapTree and mapRange

...

When you want to copy over whole messages or segments between HL7 messages, mapTree and mapRange will do it most efficiently.

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

Code Block
-- map the entire MSH segment
OutboundMessage.MSH:mapTree(InboundMessage.MSH)

...

This maps the whole MSH segment.

mapRange() function maps a range of nodes.

Code Block
-- maps the first seven segments
OutboundMessage:mapRange(InboundMessage,1,7) 

...

This maps over the first seven segments.

...

You can use this under two conditions:

...

You are mapping between HL7 node trees.

...

You are mapping between similar message structures (messages or segments share the same definition). That means identical fields and identical order.

...

You can see an example of these used in our HL7 to HL7 Map component.