Package ca.uhn.hl7v2.protocol
Interface ReceivingApplication<T extends Message>
- All Known Implementing Classes:
AcceptApplication,ApplicationWrapper,AppWrapper,ClassBasedReceivingApplication,DefaultApplication
public interface ReceivingApplication<T extends Message>
From an HL7 messaging perspective, a ReceivingApplication is a consumer of a messages. Once a parser parses an incoming message, the message would normally be forwarded to an application of some sort (e.g. a lab system) which would process the message in some way meaningful for it, and then return a response.
If you are wondering how to integrate HAPI into an existing server application, this is probably the place. Create a class that implements ReceivingApplication, then look at HL7Server and ApplicationRouter to see how to get HAPI to listen for messages on a socket and pass them to your ReceivingApplication.
Note that this interface replaces ca.uhn.hl7v2.app.Application in HAPI 0.5.- Author:
- Bryan Tripp
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(T theMessage) processMessage(T 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.
-
Method Details
-
processMessage
Message processMessage(T 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.- 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
- 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.
-