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
-
Method Summary
Modifier and TypeMethodDescriptionfromMessage
(@NonNull jakarta.jms.Message message) Returns aMessage
built from the JMS message type, using the specified HapiContext@NonNull jakarta.jms.Message
Returns aTextMessage
instance 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 aTextMessage
instance containing the HL7 message as string- Specified by:
toMessage
in interfaceMessageConverter
- Parameters:
o
- incoming object, can be either String orMessage
session
- JMS session- Returns:
- a
TextMessage
instance containing the HL7 message as string - Throws:
jakarta.jms.JMSException
MessageConversionException
-
fromMessage
public Object fromMessage(@NonNull @NonNull jakarta.jms.Message message) throws jakarta.jms.JMSException, MessageConversionException Returns aMessage
built from the JMS message type, using the specified HapiContext- Specified by:
fromMessage
in interfaceMessageConverter
- Parameters:
message
- JMSObjectMessage
orTextMessage
- Returns:
- a
Message
built from the JMS message type - Throws:
jakarta.jms.JMSException
MessageConversionException
-