Class HL7v2
java.lang.Object
org.openehealth.ipf.platform.camel.hl7.HL7v2
Factory class for commonly used HL7-related expressions, predicates and
processors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.camel.builder.ValueBuilder
ack()
static org.apache.camel.builder.ValueBuilder
ack
(AcknowledgmentCode acknowledgmentCode) static org.apache.camel.builder.ValueBuilder
ack
(AcknowledgmentCode acknowledgmentCode, String message, ErrorCode errorCode) static Message
bodyMessage
(Exchange exchange) Returns the HAPI Message from the message body.static org.apache.camel.builder.ValueBuilder
static Predicate
static Predicate
messageConformsTo
(HapiContext hapiContext) static Predicate
messageConformsTo
(Expression expression) static org.apache.camel.builder.ValueBuilder
Returns a response to the message in the body, using the provided event type and trigger eventstatic Expression
set
(String terserSpec, Expression value) static org.apache.camel.builder.ValueBuilder
staticResponse
(String message) Returns a constant response message.static Processor
Returns a validating Camel processor for a message.static Processor
validatingProcessor
(HapiContext context) Returns a validating Camel processor for a message.
-
Method Details
-
get
- Returns:
- Expression that extracts data from HL7 messages based on a HAPI Terser expression
-
set
- Returns:
- Expression that sets data in a HL7 messages based on a HAPI Terser expression
-
ack
public static org.apache.camel.builder.ValueBuilder ack()- Returns:
- Expression that creates an acknowledgement to a message
-
ack
- Returns:
- Expression that creates an acknowledgement to a message using a given code
-
ack
public static org.apache.camel.builder.ValueBuilder ack(AcknowledgmentCode acknowledgmentCode, String message, ErrorCode errorCode) - Returns:
- Expression that creates an acknowledgement to a message using a given code, message and error details
-
response
Returns a response to the message in the body, using the provided event type and trigger event- Parameters:
eventType
- event type, e.g. ADTtriggerEvent
- trigger event, e.g. A01- Returns:
- expression that generates the response for the body message
-
staticResponse
Returns a constant response message. Useful for mocks and tests only- Parameters:
message
- constant message- Returns:
- expression that generates a static message using the same HapiContext as the message in the body
-
validatingProcessor
Returns a validating Camel processor for a message. The actual validation rules to be used is defined in the message's HapiContext. UnlikemessageConforms()
, this processor throws an exception with details about the validation result instead of just returning true or false.- Returns:
- a validating Camel processor for a message
-
validatingProcessor
Returns a validating Camel processor for a message. The actual validation rules to be used is defined in the message's HapiContext. UnlikemessageConforms()
, this processor throws an exception with details about the validation result instead of just returning true or false.- Parameters:
context
- HAPI context- Returns:
- a validating Camel processor for a message
-
messageConforms
- Returns:
- Predicate that returns true if the message validates successfully
-
messageConformsTo
- Returns:
- Predicate that returns true if the message validates successfully using a dedicated HapiContext
-
messageConformsTo
- Returns:
- Predicate that returns true if the message validates successfully using an expression that returns
a
ValidationContext
.
-
bodyMessage
Returns the HAPI Message from the message body. If the body is a string, it is parsed on the fly- Parameters:
exchange
- exchange- Returns:
- HAPI message
- Throws:
HL7Exception
-