Use this connector to read or write HL7 documents into (or from) the canonical ER7 message structure.
This structure is a hierarchy of Java Maps and Lists. You use either DataWeave or code to manipulate them.
Each transaction structure is defined in the schemas.
The message itself contains the following keys, some of which apply only to either the read operation or the write operation, as indicated:
| Key Name |
Description |
ACK (read only) |
Message generated by the module during the read operation. The MSA-01 acknowledgment code value is based on the parser configuration settings. |
Data (read or write) |
Wrapper for message data, with a key matching the message structure ID value that links to the actual data. Allows different messages to be included in the metadata and handled in DataWeave mappings. |
Delimiters (read or write) |
The delimiters used for the message.
The characters in the string of delimiters are interpreted based on their position in string, in the following order: component separator, repetition separator, escape character, and subcomponent separator, with a value of U indicating no value in that position. |
Errors (read only) |
A list of errors associated with the input message. |
Id |
Message structure ID. |
MSH (read only) |
Link that receives MSH segment data. |
Name (read only) |
Message structure name. |
Individual messages have their own maps, with keys matching the segments of the message. For example, an ACK message uses the message structure ID ACK, and the data for the sent or received ACK message is an ACK value in the data map. The ACK message is itself a map, and the segments and groups of the message are represented as maps (in the case of singleton instances) or lists of maps (for repeating instances) with positional keys.
In two special cases, use generic handling for data that is not included in a schema definition.
The first case is HL7 values of the varies type. Because these values consist of any structure of components and subcomponents that can be repeated, the parser uses a list of map representations for each varies of type. The keys in each map are generated as the value is parsed, matching standard HL7 value names with two digits used for each nesting level.
For example, a simple text value for an OBX-05 Observation Value field would use the key OBX-05 in a map. If there are two components present, they use keys OBX-05-01 and OBX-05-02.
The second case is when extension segments have tags that match a pattern configured under parser options. These are similar in structure to the varies values, with the exception of only being within a single map for the entire segment.
The maps containing extension segment data are added to the basic message map in lists with the key ExtensionSegs. In addition to the actual extension segment data, the map for the extension segment contains two other keys:
| Key |
Description |
Ident |
The extension segment identifier (tag). |
Position |
The position of the segment within the message structure, as a two-digit string. This is the same as the position of the immediately preceding defined segment, as defined in the schema. If a ZVN extension segment is used following the EVN segment in an ADT_A01 message structure, the ZVN is at position 03). |
If extension segments are used in nested groups, the list containing those segments are included in the map representing that group. Extension segments are ordered by position in the lists created by the parser, and must also be ordered by position when writing.
About Sending Acknowledgments
An ACK (acknowledgment) message is an HL7 message that enables you to acknowledge to a message sender that your application has received a message. ACK messages are the same as any other HL7 message write operations, except that you set the ACK message to what was generated during the read operation as the output message under a Data key.
<hl7-edi:read config-ref="HL7_EDI__Configuration1" doc:name="HL7 EDI"/>\
...
<dw:transform-message doc:name="Create Outgoing Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
Name: "ACK",
MSH: payload.ACK.MSH,
Id: "ACK",
Data: {
ACK: payload.ACK
}
}]]></dw:set-payload>
</dw:transform-message>
<hl7-edi:write config-ref="HL7_EDI__Configuration" messageStructure="InMessage" doc:name="ACK"/>
...
<file:outbound-endpoint responseTimeout="10000" doc:name="File" path="output" outputPattern="ack.edi"/>
The generated ACK messages have MSH data set up for sending back to the sender of the original message, so you don’t need to change anything in the data to perform the send.
If you include an ACK message schema in your configuration, that schema is used to both receive and generate ACK messages. If you don’t specify an ACK schema, the standard hl7/v2_5_1/ACK.esl schema default is used.