public class NakFactory<T extends MllpAuditDataset> extends Object
Constructor and Description |
---|
NakFactory(Hl7v2TransactionConfiguration<T> config)
Short constructor which corresponds to
NakFactory(config, false, "ACK") . |
NakFactory(Hl7v2TransactionConfiguration<T> config,
boolean useCAckTypeCodes,
String defaultNakMsh9)
Generic constructor.
|
Modifier and Type | Method and Description |
---|---|
ca.uhn.hl7v2.model.Message |
createAck(ca.uhn.hl7v2.model.Message originalMessage)
Generates a transaction-specific HL7v2 ACK response message on the basis
of the original HAPI request message.
|
ca.uhn.hl7v2.model.Message |
createDefaultNak(ca.uhn.hl7v2.HL7Exception e)
Generates a "default" HL7v2 NAK message on the basis
of the thrown exception.
|
ca.uhn.hl7v2.model.Message |
createNak(ca.uhn.hl7v2.model.Message originalMessage,
ca.uhn.hl7v2.HL7Exception exception,
ca.uhn.hl7v2.AcknowledgmentCode ackTypeCode)
Generates an HL7v2 NAK response message on the basis
of the thrown exception and the original HAPI request message.
|
ca.uhn.hl7v2.model.Message |
createNak(ca.uhn.hl7v2.model.Message originalMessage,
Throwable t)
Generates an HL7v2 NAK response message on the basis
of the thrown exception and the original HAPI request message.
|
static String |
formatErrorMessage(Throwable t)
Formats and returns error message of an exception.
|
protected ca.uhn.hl7v2.AcknowledgmentCode |
getAckTypeCode(Throwable t)
Returns a HL7v2 acknowledgement type code that corresponds
to the given instance of
Throwable . |
protected Hl7v2TransactionConfiguration |
getConfig()
Returns configuration of the transaction served by this factory.
|
protected ca.uhn.hl7v2.HL7Exception |
getHl7Exception(Throwable t)
Returns a HL7v2 exception that corresponds
to the given instance of
Throwable . |
public NakFactory(Hl7v2TransactionConfiguration<T> config, boolean useCAckTypeCodes, String defaultNakMsh9)
config
- Configuration of the transaction served by this factory.useCAckTypeCodes
- if true
, HL7v2 acknowledgement codes
CA, CE, CR will be used instead of the default
AA, AE, AR.defaultNakMsh9
- desired contents of MSH-9 in this transaction's default NAKs.public NakFactory(Hl7v2TransactionConfiguration<T> config)
NakFactory(config, false, "ACK")
.config
- Configuration of the transaction served by this factory.public ca.uhn.hl7v2.model.Message createAck(ca.uhn.hl7v2.model.Message originalMessage) throws ca.uhn.hl7v2.HL7Exception, IOException
originalMessage
- original HAPI request message.ca.uhn.hl7v2.HL7Exception
IOException
public ca.uhn.hl7v2.model.Message createNak(ca.uhn.hl7v2.model.Message originalMessage, ca.uhn.hl7v2.HL7Exception exception, ca.uhn.hl7v2.AcknowledgmentCode ackTypeCode) throws ca.uhn.hl7v2.HL7Exception, IOException
exception
- thrown exception.originalMessage
- original HAPI request message.ackTypeCode
- HL7v2 acknowledgement type code.ca.uhn.hl7v2.HL7Exception
IOException
public ca.uhn.hl7v2.model.Message createNak(ca.uhn.hl7v2.model.Message originalMessage, Throwable t) throws ca.uhn.hl7v2.HL7Exception, IOException
t
- thrown exception.originalMessage
- original HAPI request message.ca.uhn.hl7v2.HL7Exception
IOException
public ca.uhn.hl7v2.model.Message createDefaultNak(ca.uhn.hl7v2.HL7Exception e)
e
- thrown exception.protected ca.uhn.hl7v2.HL7Exception getHl7Exception(Throwable t)
Throwable
.protected ca.uhn.hl7v2.AcknowledgmentCode getAckTypeCode(Throwable t)
Throwable
.public static String formatErrorMessage(Throwable t)
In particular, all line break characters must be removed, otherwise they will break the structure of an HL7 NAK.
t
- thrown exception.protected Hl7v2TransactionConfiguration getConfig()
Copyright © 2018 Open eHealth Foundation. All rights reserved.