public class Responder extends Object
Performs the responding role in a message exchange (i.e receiver of the first message, sender of the response; analagous to the server in a client-server interaction), according to HL7's original mode processing rules.
At the time of writing, enhanced mode, two-phase reply, continuation messages, and batch processing are unsupported.
| Constructor and Description |
|---|
Responder(Parser parser)
Creates a new instance of Responder that optionally validates parsing of
incoming messages using a system property.
|
Responder(Parser parser,
boolean checkParse)
Creates a new instance of Responder that optionally validates parsing of
incoming messages.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
logAndMakeErrorMessage(Exception e,
Segment inHeader,
Parser p,
String encoding)
Logs the given exception and creates an error message to send to the
remote system.
|
static void |
main(String[] args)
Test code.
|
protected String |
processMessage(String incomingMessageString)
Processes an incoming message string and returns the response message
string.
|
void |
registerApplication(Application a)
Registers an Application with this Responder.
|
public Responder(Parser parser) throws LLPException
ca.uhn.hl7v2.app.checkparse equals "true", parse integrity
is checked, i.e. each message is re-encoded and differences between the
received message text and the re-encoded text are written to the file
LLPExceptionpublic Responder(Parser parser, boolean checkParse)
validate - if true, encodes each incoming message after parsing it,
compares the result to the original message string, and prints
differences to the file "protected String processMessage(String incomingMessageString) throws HL7Exception
registerApplication. The Parser is obtained from the
Connection associated with this Responder.HL7Exceptionpublic static String logAndMakeErrorMessage(Exception e, Segment inHeader, Parser p, String encoding) throws HL7Exception
encoding - The encoding for the error message. If null, uses
default encodingHL7Exceptionpublic void registerApplication(Application a)
canProcess()) until one
of them accepts responsibility for the message. If none of the registered
applications can process the message, a DefaultApplication is used, which
simply returns an Application Reject message.Copyright © 2001-2012 University Health Network. All Rights Reserved.