Class HL7MessageConverter
- java.lang.Object
-
- org.openehealth.ipf.platform.camel.hl7.converter.HL7MessageConverter
-
- All Implemented Interfaces:
MessageConverter
public class HL7MessageConverter extends Object implements 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 Constructor Description HL7MessageConverter(HapiContext hapiContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
fromMessage(javax.jms.Message message)
Returns aMessage
built from the JMS message type, using the specified HapiContextjavax.jms.Message
toMessage(Object o, javax.jms.Session session)
Returns aTextMessage
instance containing the HL7 message as string
-
-
-
Constructor Detail
-
HL7MessageConverter
public HL7MessageConverter(HapiContext hapiContext)
-
-
Method Detail
-
toMessage
public javax.jms.Message toMessage(Object o, javax.jms.Session session) throws javax.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:
javax.jms.JMSException
MessageConversionException
-
fromMessage
public Object fromMessage(javax.jms.Message message) throws javax.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:
javax.jms.JMSException
MessageConversionException
-
-