ca.uhn.hl7v2.protocol
Interface ReceivingApplication

All Known Implementing Classes:
AppWrapper

public interface ReceivingApplication

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.

Version:
$Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:38 $ by $Author: jamesagnew $
Author:
Bryan Tripp

Method Summary
 boolean canProcess(Message theMessage)
           
 Message processMessage(Message theMessage, java.util.Map theMetadata)
          Uses the contents of the message for whatever purpose the application has for this message, and returns an appropriate response message.
 

Method Detail

processMessage

Message processMessage(Message theMessage,
                       java.util.Map theMetadata)
                       throws ReceivingApplicationException,
                              HL7Exception
Uses 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 message
theMetadata - message metadata (which may include information about where the message comes from, etc). This is the same metadata as in Transportable.
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

boolean canProcess(Message theMessage)
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.


Copyright © 2001-2011 University Health Network. All Rights Reserved.