Inputs and output
| Input | Default | Meaning |
|---|---|---|
message | (required) | The XML document, or its JSON form. |
inputFormat | auto | auto (JSON when the input starts with {), xml or json. |
validateXml | true | Validate against the XSD before encoding. |
segmentTerminator | CR | CR, LF or CRLF. |
wrapInMllp | false | Add MLLP framing. |
schemaName, schemaFolder, allowUndefinedContent | As for Decode. |
Output: success, hl7Message and errors.
Example: a mapped ORU to ER7
"Encode_HL7": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"message": "@{outputs('Transform_to_ORU')}",
"validateXml": true
},
"serviceProviderConfiguration": {
"connectionName": "lamboHl7Codec",
"operationId": "encode",
"serviceProviderId": "/serviceProviders/lamboHl7Codec"
}
}
}- Delimiters come from MSH-1 and MSH-2 in the document.
- Positions come from the schema, looked up by the root element name (or
schemaName). Without a schema and without validation, positions come from the element names. - Groups are flattened, and trailing empty fields and components are trimmed.
- Extensions round-trip: content the XSD doesn't define (Z-segments, extra fields, components, repetitions) is left out of validation and encoded unchanged, so decoded messages can be encoded again.
To send the result over MLLP, pass body('Encode_HL7')?['hl7Message'] to the MLLP Connector's Send message.