Skip to main content

EnsLib.HL7.Operation.ReplyStandard

abstract class EnsLib.HL7.Operation.ReplyStandard extends EnsLib.HL7.Operation.Standard, EnsLib.EDI.ServiceInterface

This is an abstract superclass for HL7 Operations that can receive a reply to a sent HL7 message

Property Inventory

Method Inventory

Parameters

parameter AllowNonMSA = 0;
Don't report an error for reply messages containing no MSA:1 field (Deprecated - use Setting ReplyCodeActions instead of subclassing)
parameter IndexACKs = 0;
[Deprecated] The SaveReplies property/setting should be used instead. Index ACKs if IndexReplies is also true and SearchTable class is given
parameter IndexReplies = 1;
[Deprecated] The SaveReplies property/setting should be used instead. If SearchTableClass is given, use it to index any replies (including ACKs unless IndexACKs=0 or OK and SaveOKACKs=0)
parameter SETTINGS = ReplyCodeActions,NoFailWhileDisconnected,SaveReplies;
Inherited description: List of properties can be set as settings in the configuration file format is a comma separated list of property names
parameter SaveOKACKs = 0;
[Deprecated] The SaveReplies property/setting should be used instead. Save OK ACKs
parameter SetReplyDocType = 1;
Set the DocType and MessageTypeCategory properties of the reply message if possible
parameter WarnACKControlId = 1;
Log a Warning if the reply MSA:2 ControlId does not match the original message's control ID (Deprecated - use Setting ReplyCodeActions instead of subclassing)

Properties

property %Parser as EnsLib.HL7.Parser;
Property methods: %ParserGet(), %ParserGetSwizzled(), %ParserIsValid(), %ParserNewObject(), %ParserSet()
property %replyActionMap [ MultiDimensional ];
parsed array property of ReplyCodeActions setting
Property methods: %replyActionMapDisplayToLogical(), %replyActionMapGet(), %replyActionMapIsValid(), %replyActionMapLogicalToDisplay(), %replyActionMapLogicalToOdbc(), %replyActionMapNormalize(), %replyActionMapSet()
property ReplyCodeActions as %String (MAXLEN = 1000);

A comma-separated list of codes specifying what action this Operation will take on receipt of various types of ACK response messages and other reply status conditions. The format of the list is:
<code>=<action>,<code>=<action>,...
Types of reply status condition are identified by a specification code: A <code> value starting with a colon - e.g. :<char><char> represents a literal value found in field MSA:1 of the response message. Also, the following special code values may be used:

  • :?A - matches AA or CA values (Accept)
  • :?E - matches AE or CE values (Error)
  • :?R - matches AR or CR values (Reject)
  • :_ - matches replies with an empty MSA:1 field
  • :* - matches any MSA:1 value not matched otherwise (default=F)
  • :~ - matches replies that do not contain an MSA segment
  • :I? - matches where the reply MSA:2 ControlId does not match the ControlId of the original message
  • :T? - matches where the reply MSH:9 Type name does not match the schema's declared reply type for the original message

The default behavior is ':?R=RF,:?E=S,:~=S,:?A=C,:*=S,:I?=W,:T?=C'
This means for NACKs received with error code AR or CR retry, while codes AE or CE suspend the current outbound message and move on to the next.

Also, the following standard status conditions may be used:

  • E - Error status returned from message handler
  • E#<statuscode> - Error status returned from message handler has status code equal to <statuscode>
  • E*<text> - Error status returned from message handler contains text string <text>
  • X - there is no reply message at all

The following values for <actions> may be used alone or in combinations:

  • C - Treat the message as Completed OK.
  • W - Log a warning. If no other non-warning <actions> are triggered, the message will be treated as Completed OK.
  • R - Retry the message according to the configured RetryInterval and FailureTimeout; finally Fail unless a different action is also specified.
  • S - Suspend the message, log an error, and move on to try the next message.
  • D - Disable the Operation, log an error and restore the message to the front of the Operation's queue.
  • F - Fail with an error and move on to try the next message from the Operation's queue.
An example of a valid ReplyCodeActions specification is 'E#6301=R,E#<Ens>ErrGeneral=RD,E=F'. This specification will result in a retry when error code 6301 is encountered. When error code <Ens>ErrGeneral is encountered, the Operation first retries to send the message until FailureTimeout and then, if the error continues, it disables the Operation instead of failing. Any other errors will cause the Operation to fail processing of the current message and return the error status to the caller, without retrying first.

The default behavior is 'E=F'. Thus any error status will result in the error being logged and returned to the caller, no retries will be attempted, and the Operation will move on to try the next message from its queue.

All codes where <actions> consists of only 'W' (for 'log a Warning') will be evaluated, and a warning will be generated for each matching <code>. Other <code> values will be evaluated in left-to-right order, executing the first matching <code> that has a non-warning <actions> value. As noted in the details for the 'W' flag, an error that only triggers 'W' <actions> will be treated as Completed OK.

Property methods: ReplyCodeActionsDisplayToLogical(), ReplyCodeActionsGet(), ReplyCodeActionsIsValid(), ReplyCodeActionsLogicalToDisplay(), ReplyCodeActionsLogicalToOdbc(), ReplyCodeActionsNormalize(), ReplyCodeActionsSet()
property SaveReplies as %String (VALUELIST = ",None,NotOKs,All,IndexNotOKs,IndexAll") [ InitialExpression = $select(..#IndexReplies: "Index"_$select(..#IndexACKs: "All", 1: "NotOKs"), ..#SaveOKACKs: "All", 1: "NotOKs") ];
Save a copy of reply messages sent back to the remote system. Also optionally index them using the configured SearchTableClass, if any.
The options for this setting are as follows:
  • None : Don't save or index any reply messages.
  • NotOKs : Save replies that are not a simple OK ACK message: e.g. error NACKS and query responses.
  • All : Save a copy of all reply messages sent back to the remote system.
  • IndexNotOKs : Save replies that are not a simple OK ACK message and index them using the configured SearchTable. This is the default behaviour, unless IndexReplies, SaveOKACKs or IndexACKs has been overridden in this class.
  • IndexAll : Save a copy of all reply messages and index them using the configured SearchTable.
Property methods: SaveRepliesDisplayToLogical(), SaveRepliesGet(), SaveRepliesIsValid(), SaveRepliesLogicalToDisplay(), SaveRepliesLogicalToOdbc(), SaveRepliesNormalize(), SaveRepliesSet()

Methods

method GetSegmentTerminator() as %String
Return the segment terminator string that the Parser will use.
method IOLogDiscard(pSC As %Status, pNote As %String, pDiscard As %GlobalCharacterStream)
Add discarded characters to IO Archive
method OnGetReplyAction(pRequest As EnsLib.HL7.Message, Output pResponse As EnsLib.HL7.Message, ByRef pSC As %Status) as %String
Construct and return an Action string consisting of supported action code letters, based on qualities of the Request, Response, and Error Status.
method OnInit() as %Status
Inherited description: This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
method OnMessage(pRequest As EnsLib.HL7.Message, Output pResponse As EnsLib.HL7.Message) as %Status
Inherited description: This is the default message handler. All request types not declared in the message map are delivered here
method OnReplyDocument(ByRef pReplyDocument As EnsLib.HL7.Message, pRequest As EnsLib.HL7.Message)
Override this method to modify or delete or log the reply (ACK) message document object
method SendMessage(pMsgOut As EnsLib.HL7.Message, Output pMsgIn As EnsLib.HL7.Message, pExpectedSequenceNumber As %String) as %Status
method buildReplyActionMap() as %Status
build parsed array property of ReplyCodeActions setting

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab