Mapping data between any of the different types of node trees follows a very similar pattern, see the other “Mapping Messages:” tutorials in this section for examples.
These are the steps:
- Create a source node tree structure
- Create target node tree
- Use assignment statements to map the data from the source node tree to the target node tree
Tip: If you want to modify the message data see the “Transforming Messages:” tutorials in this section. Mapping and transformation use very similar techniques, the main difference is the intention: When you are mapping you are just copying the data, when you are transforming a message you are modifying the data (as well as copying it).
The code for Mapping HL7 to Database, Mapping HL7 to JSON and Mapping HL7 to Database all follow the same pattern.
Mapping HL7 to XML:
Note: Mapping to XML varies slightly as it uses the
:setInner() function to assign values.