Class HL7MessageConverter
java.lang.Object
org.openehealth.ipf.platform.camel.hl7.converter.HL7MessageConverter
- All Implemented Interfaces:
MessageConverter
HL7MessageConverter helps serializing a HL7 message to and from a string for the purpose of
routing it through a JMS queue. The same converter should be used on consumer and producer side.
HAPI HL7 message objects have a reference to a transient parser, which in return has the reference
to the valid HapiContext. After deserialization, the context and parser references have to be
re-established.
Currently, this class accepts String and HAPI message objects only. Deserialization will always
produce a HAPI Message object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromMessage(@NonNull jakarta.jms.Message message) Returns aMessagebuilt from the JMS message type, using the specified HapiContext@NonNull jakarta.jms.MessageReturns aTextMessageinstance containing the HL7 message as string
-
Constructor Details
-
HL7MessageConverter
-
-
Method Details
-
toMessage
@NonNull public @NonNull jakarta.jms.Message toMessage(@NonNull @NonNull Object o, @NonNull @NonNull jakarta.jms.Session session) throws jakarta.jms.JMSException, MessageConversionException Returns aTextMessageinstance containing the HL7 message as string- Specified by:
toMessagein interfaceMessageConverter- Parameters:
o- incoming object, can be either String orMessagesession- JMS session- Returns:
- a
TextMessageinstance containing the HL7 message as string - Throws:
jakarta.jms.JMSExceptionMessageConversionException
-
fromMessage
public Object fromMessage(@NonNull @NonNull jakarta.jms.Message message) throws jakarta.jms.JMSException, MessageConversionException Returns aMessagebuilt from the JMS message type, using the specified HapiContext- Specified by:
fromMessagein interfaceMessageConverter- Parameters:
message- JMSObjectMessageorTextMessage- Returns:
- a
Messagebuilt from the JMS message type - Throws:
jakarta.jms.JMSExceptionMessageConversionException
-