Package ca.uhn.hl7v2.protocol
Class ApplicationWrapper
java.lang.Object
ca.uhn.hl7v2.protocol.ApplicationWrapper
- All Implemented Interfaces:
ReceivingApplication<Message>
Wraps a legacy HAPI
Application to convert it to a new
style ReceivingApplication-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(Message theMessage) processMessage(Message theMessage, Map<String, Object> theMetadata) Uses the contents of the message for whatever purpose the application has for this message, and returns an appropriate response message.
-
Constructor Details
-
ApplicationWrapper
Constructor- Parameters:
theApplication- The application to wrap
-
-
Method Details
-
processMessage
public Message processMessage(Message theMessage, Map<String, Object> theMetadata) throws ReceivingApplicationException, HL7ExceptionUses the contents of the message for whatever purpose the application has for this message, and returns an appropriate response message.- Specified by:
processMessagein interfaceReceivingApplication<Message>- Parameters:
theMessage- an inbound HL7 messagetheMetadata- message metadata (which may include information about where the message comes from, etc). This is the same metadata as inTransportable.getMetadata().- Returns:
- an appropriate application response (for example an application ACK or query response). Appropriate responses to different types of incoming messages are defined by HL7.
- Throws:
ReceivingApplicationException- if there is a problem internal to the application (for example a database problem)HL7Exception- if there is a problem with the message
-
canProcess
- Specified by:
canProcessin interfaceReceivingApplication<Message>- Parameters:
theMessage- an inbound HL7 message- Returns:
- true if this ReceivingApplication wishes to accept the message. By returning true, this Application declares itself the recipient of the message, accepts responsibility for it, and must be able to respond appropriately to the sending system.
-