org.apache.camel.component.hl7
Class HL7DataFormat
java.lang.Object
org.apache.camel.component.hl7.HL7DataFormat
- All Implemented Interfaces:
- org.apache.camel.spi.DataFormat
public class HL7DataFormat
- extends Object
- implements org.apache.camel.spi.DataFormat
HL7 DataFormat (supports v2.x of the HL7 protocol).
This data format supports two operations:
- marshal = from Message to String (can be used when returning as response using the HL7 MLLP codec)
- unmarshal = from String to Message (can be used when receiving streamed data from the HL7 MLLP codec).
This operation will also enrich the message by adding the MSH fields (MSH-3 to MSH-12) as headers on the message.
Uses the HAPI (HL7 API) for HL7 parsing.
Uses the default GenericParser from the HAPI API. This DataFormat only supports both the EDI based HL7
messages and the XML based messages.
The unmarshal operation adds these MSH fields as headers on the Camel message (key, MSH-field):
- CamelHL7SendingApplication = MSH-3
- CamelHL7SendingFacility = MSH-4
- CamelHL7ReceivingApplication = MSH-5
- CamelHL7ReceivingFacility = MSH-6
- CamelHL7Timestamp = MSH-7
- CamelHL7Security = MSH-8
- CamelHL7MessageType = MSH-9-1
- CamelHL7TriggerEvent = MSH-9-2
- CamelHL7MessageControl = MSH-10
- CamelHL7ProcessingId = MSH-11
- CamelHL7VersionId = MSH-12
All headers are String types.
- See Also:
HL7MLLPCodec
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HL7DataFormat
public HL7DataFormat()
marshal
public void marshal(org.apache.camel.Exchange exchange,
Object body,
OutputStream outputStream)
throws Exception
- Specified by:
marshal
in interface org.apache.camel.spi.DataFormat
- Throws:
Exception
unmarshal
public Object unmarshal(org.apache.camel.Exchange exchange,
InputStream inputStream)
throws Exception
- Specified by:
unmarshal
in interface org.apache.camel.spi.DataFormat
- Throws:
Exception
isValidate
public boolean isValidate()
setValidate
public void setValidate(boolean validate)
getParser
public ca.uhn.hl7v2.parser.Parser getParser()
setParser
public void setParser(ca.uhn.hl7v2.parser.Parser parser)
Apache Camel