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.Modifier and Type | Method and Description |
---|---|
boolean |
canProcess(T theMessage) |
Message |
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.
|
Message processMessage(T theMessage, Map<String,Object> theMetadata) throws ReceivingApplicationException, HL7Exception
theMessage
- an inbound HL7 messagetheMetadata
- message metadata (which may include information about where the message comes
from, etc). This is the same metadata as in Transportable.getMetadata()
.ReceivingApplicationException
- if there is a problem internal to the application (for example
a database problem)HL7Exception
- if there is a problem with the messageboolean canProcess(T theMessage)
theMessage
- an inbound HL7 messageCopyright © 2001–2017 University Health Network. All rights reserved.