Class Hl7v2TransactionConfiguration<AuditDatasetType extends MllpAuditDataset>
java.lang.Object
org.openehealth.ipf.commons.ihe.core.TransactionConfiguration<AuditDatasetType>
org.openehealth.ipf.commons.ihe.hl7v2.Hl7v2TransactionConfiguration<AuditDatasetType>
- Direct Known Subclasses:
PdqTransactionConfiguration
public class Hl7v2TransactionConfiguration<AuditDatasetType extends MllpAuditDataset>
extends TransactionConfiguration<AuditDatasetType>
Endpoint-agnostic parameters of an HL7v2-based transaction.
- Author:
- Dmytro Rud
-
Constructor Summary
ConstructorDescriptionHl7v2TransactionConfiguration
(String name, String description, boolean isQuery, AuditStrategy<AuditDatasetType> clientAuditStrategy, AuditStrategy<AuditDatasetType> serverAuditStrategy, Version[] hl7Versions, String sendingApplication, String sendingFacility, ErrorCode requestErrorDefaultErrorCode, ErrorCode responseErrorDefaultErrorCode, String[] allowedRequestMessageTypes, String[] allowedRequestTriggerEvents, String[] allowedResponseMessageTypes, String[] allowedResponseTriggerEvents, boolean[] auditabilityFlags, boolean[] responseContinuabilityFlags, HapiContext hapiContext) Constructor.Hl7v2TransactionConfiguration
(String name, String description, boolean isQuery, AuditStrategy<AuditDatasetType> clientAuditStrategy, AuditStrategy<AuditDatasetType> serverAuditStrategy, Version hl7Version, String sendingApplication, String sendingFacility, ErrorCode requestErrorDefaultErrorCode, ErrorCode responseErrorDefaultErrorCode, String allowedRequestMessageType, String allowedRequestTriggerEvent, String allowedResponseMessageType, String allowedResponseTriggerEvent, boolean auditabilityFlag, boolean responseContinuabilityFlag, HapiContext hapiContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkMessageAcceptance
(Message message, boolean isRequest) Performs acceptance test of the given message.void
checkMessageAcceptance
(String messageType, String triggerEvent, String messageStructure, String version, boolean isRequest) Performs acceptance test of the message with the given attributes.void
checkRequestAcceptance
(Message message) Performs transaction-specific acceptance test of the given request message.void
checkResponseAcceptance
(Message message) Performs transaction-specific acceptance test of the given response message.String[]
String[]
String[]
String[]
Version[]
boolean
isAuditable
(String messageType) Returnstrue
when request messages of the given type are auditable.boolean
isContinuable
(String messageType) Returnstrue
when request messages of the given type can be split by means of interactive continuation.boolean
isDataStartSegment
(List<String> segments, int index) Returnstrue
if the given element of the given list contains a start segment of a data record.boolean
isFooterStartSegment
(List<String> segments, int index) Returnstrue
if the given element of the given list contains a segment which belongs to segments following the data records ("footer").<M extends Message>
Mrequest()
Likerequest(String, String)
, but uses the first configured request message type and the first configured trigger event as defaults.<M extends Message>
MLikerequest(String, String)
, but uses the first configured request message type as default.<M extends Message>
MMakes a valid request for this transaction.Methods inherited from class org.openehealth.ipf.commons.ihe.core.TransactionConfiguration
getClientAuditStrategy, getDescription, getName, getServerAuditStrategy, isQuery, isStrict, setStrict
-
Constructor Details
-
Hl7v2TransactionConfiguration
public Hl7v2TransactionConfiguration(String name, String description, boolean isQuery, AuditStrategy<AuditDatasetType> clientAuditStrategy, AuditStrategy<AuditDatasetType> serverAuditStrategy, Version[] hl7Versions, String sendingApplication, String sendingFacility, ErrorCode requestErrorDefaultErrorCode, ErrorCode responseErrorDefaultErrorCode, String[] allowedRequestMessageTypes, String[] allowedRequestTriggerEvents, String[] allowedResponseMessageTypes, String[] allowedResponseTriggerEvents, boolean[] auditabilityFlags, boolean[] responseContinuabilityFlags, HapiContext hapiContext) Constructor.- Parameters:
hl7Versions
- HL7 versions for acceptance checks (MSH-12). The first version of this array is used for default NAKs.sendingApplication
- sending application for default NAKs (MSH-3).sendingFacility
- sending application for default NAKs (MSH-4).requestErrorDefaultErrorCode
- default error code for request-related NAKs.responseErrorDefaultErrorCode
- default error code for response-related NAKs.allowedRequestMessageTypes
- array of allowed request message types, e.g.{"ADT", "MDM"}
.allowedRequestTriggerEvents
- array of allowed request trigger events for each request message type, e.g.{"A01 A02 A03", "T06 T07 T08"}
.allowedResponseMessageTypes
- array of allowed response message types, e.g.{"ACK", "RSP"}
.allowedResponseTriggerEvents
- array of allowed response trigger events for each message type, ignored for messages of type "ACK".auditabilityFlags
- flags of whether the messages of corresponding message type should be audited. Ifnull
, the transaction will not perform any auditing.responseContinuabilityFlags
- flags of whether the messages of corresponding message type should support HL7 response continuations. Ifnull
, no continuations will be supported.hapiContext
- transaction-specific HAPI Context
-
Hl7v2TransactionConfiguration
public Hl7v2TransactionConfiguration(String name, String description, boolean isQuery, AuditStrategy<AuditDatasetType> clientAuditStrategy, AuditStrategy<AuditDatasetType> serverAuditStrategy, Version hl7Version, String sendingApplication, String sendingFacility, ErrorCode requestErrorDefaultErrorCode, ErrorCode responseErrorDefaultErrorCode, String allowedRequestMessageType, String allowedRequestTriggerEvent, String allowedResponseMessageType, String allowedResponseTriggerEvent, boolean auditabilityFlag, boolean responseContinuabilityFlag, HapiContext hapiContext)
-
-
Method Details
-
isAuditable
Returnstrue
when request messages of the given type are auditable. -
isContinuable
Returnstrue
when request messages of the given type can be split by means of interactive continuation. When this method returns true, the request message structure must be able to contain segments RCP, QPD, DSC; and the response message structure -- segments DSC, QAK. -
isDataStartSegment
Returnstrue
if the given element of the given list contains a start segment of a data record. -
checkRequestAcceptance
Performs transaction-specific acceptance test of the given request message.- Parameters:
message
-Message
object.- Throws:
Hl7v2AcceptanceException
-
checkResponseAcceptance
Performs transaction-specific acceptance test of the given response message.- Parameters:
message
-Message
object.- Throws:
Hl7v2AcceptanceException
-
checkMessageAcceptance
public void checkMessageAcceptance(Message message, boolean isRequest) throws Hl7v2AcceptanceException Performs acceptance test of the given message.- Parameters:
message
- HAPIMessage
object.isRequest
-true
iff the message is a request.- Throws:
Hl7v2AcceptanceException
- when the message is not acceptable.
-
checkMessageAcceptance
public void checkMessageAcceptance(String messageType, String triggerEvent, String messageStructure, String version, boolean isRequest) throws Hl7v2AcceptanceException Performs acceptance test of the message with the given attributes.- Parameters:
messageType
- value from MSH-9-1, can be empty ornull
.triggerEvent
- value from MSH-9-2, can be empty ornull
.messageStructure
- value from MSH-9-3, can be empty ornull
.version
- value from MSH-12, can be empty ornull
.isRequest
-true
iff the message under consideration is a request.- Throws:
Hl7v2AcceptanceException
- when the message is not acceptable.
-
getParser
-
request
Makes a valid request for this transaction. Note that the individual transaction types may overload this method, e.g. using a concrete response type.- Parameters:
messageType
- message type, e.g. ADTtrigger
- trigger event, e.g. A01- Returns:
- HAPI message created using the correct HapiContext
- Throws:
HL7v2Exception
- if the message type or trigger event is not valid for this transaction
-
request
Likerequest(String, String)
, but uses the first configured request message type as default. -
request
Likerequest(String, String)
, but uses the first configured request message type and the first configured trigger event as defaults. -
getSendingApplication
-
getSendingFacility
-
getRequestErrorDefaultErrorCode
-
getResponseErrorDefaultErrorCode
-
getHapiContext
-
getAllowedRequestMessageTypes
-
getAllowedRequestTriggerEvents
-
getAllowedResponseMessageTypes
-
getAllowedResponseTriggerEvents
-
getHl7Versions
-