public class DefaultApplication extends Object implements ReceivingApplication<Message>
Modifier and Type | Field and Description |
---|---|
static String |
MSG_INTERNAL_ERROR |
static String |
MSG_NO_APPROPRIATE_DEST |
Constructor and Description |
---|
DefaultApplication()
New instance which always returns an acknowledgment code of
AcknowledgmentCode.AR and
a message indicating that no appropriate handler could be found. |
DefaultApplication(AcknowledgmentCode theAcknowledgmentCode)
New instance which always uses the given acknowledgment code, and generates an
appropriate message for the given code, according to the following rules:
|
DefaultApplication(AcknowledgmentCode theAcknowledgmentCode,
String theMessage)
New instance which always uses the given acknowledgment code and message
|
Modifier and Type | Method and Description |
---|---|
boolean |
canProcess(Message in)
Returns true.
|
static Message |
makeACK(Message message)
Deprecated.
|
static Message |
makeACK(Segment inboundHeader)
Deprecated.
|
Message |
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.
|
public static final String MSG_INTERNAL_ERROR
public static final String MSG_NO_APPROPRIATE_DEST
public DefaultApplication()
AcknowledgmentCode.AR
and
a message indicating that no appropriate handler could be found.MSG_NO_APPROPRIATE_DEST
public DefaultApplication(AcknowledgmentCode theAcknowledgmentCode)
New instance which always uses the given acknowledgment code, and generates an appropriate message for the given code, according to the following rules:
theAcknowledgmentCode
- The code to always use (must not be null)public DefaultApplication(AcknowledgmentCode theAcknowledgmentCode, String theMessage)
theAcknowledgmentCode
- The code to always use (must not be null)theMessage
- The message (may be null, in which case no message will be given)public boolean canProcess(Message in)
canProcess
in interface ReceivingApplication<Message>
in
- an inbound HL7 messagepublic static Message makeACK(Message message) throws HL7Exception, IOException
Message.generateACK()
ca.uhn.hl7v2.util.MessageIDGenerator
. Also note that the ACK
messages returned is the same version as the version stated in the
inbound MSH if there is a generic ACK for that version, otherwise a
version 2.4 ACK is returned. MSA-1 is set to AA by default.message
- message
the MSH segment if the inbound messageHL7Exception
IOException
public static Message makeACK(Segment inboundHeader) throws HL7Exception, IOException
Message.generateACK()
HL7Exception
IOException
public Message processMessage(Message theMessage, Map<String,Object> theMetadata) throws ReceivingApplicationException
ReceivingApplication
processMessage
in interface ReceivingApplication<Message>
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)Copyright © 2001–2017 University Health Network. All rights reserved.