Class ApplicationWrapper

java.lang.Object
ca.uhn.hl7v2.protocol.ApplicationWrapper
All Implemented Interfaces:
ReceivingApplication<Message>

public class ApplicationWrapper extends Object implements ReceivingApplication<Message>
Wraps a legacy HAPI Application to convert it to a new style ReceivingApplication
  • Constructor Details

  • Method Details

    • processMessage

      Uses the contents of the message for whatever purpose the application has for this message, and returns an appropriate response message.
      Specified by:
      processMessage in interface ReceivingApplication<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.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

      public boolean canProcess(Message theMessage)
      Specified by:
      canProcess in interface ReceivingApplication<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.