Ancestor: HL7Connect.Events.InterfaceBase

This event is called when a message is received from an interface and the message has passed the sequence numbering and HL7 Validation checks. It exists to allow the user to impose custom validation checks, do message translation, and send the messages to interfaces or virtual queues.

The event handler can do anything it wants with the Message but it must leave it parsable and with the compulsory headers in the MSH populated. If the interface wishes to reject the message, it should set ErrorMessage and optionally ErrorCode

The message is logged prior to this event.

XSLT: the input is the original message, the output replaces the original message

Properties

HL7Connect.Exchange.Message Message;
   A handle to the actual message received

string ErrorMessage;
   Read/Write the error message, which will go in MSA-3. The error message will be ignored unless you also set an ErrorCode or ResponseCode. You can also set the ErrorMessage using SetError (consult SetErrorfor more information)

string ErrorCode;
   Read/Write the errorCode. The error message will be ignored unless you also set an ErrorMessage. You can also set the ErrorCode using SetError. The error Code is one of the numerical codes that goes in MSA-6. The code in MSA-1 is derived from this error code using the table in the v2 standard. (consult SetErrorfor more information)

Note that for backward compatibility reasons, setting ErrorCode will also change the value of ResponseCode. Set ResponseCode second if you wish to set both values.

string ResponseCode;
   Read/Write the ResponseCode. Valid values are "AA", "AE", "AR", "CA", "CE", "CR".

If ErrorMessage is empty, the ResponseCode must be "AA" (the default value) or "CA". If Error message is not empty, the code should be one of the other values. If the error message is not empty, and the ResponseCode is AA or CA, then the response code will be altered to the appropriate response code determined from the value of the ErrorCode Consult SetErrorCodefor more information)

Note that for backward compatibility reasons, setting ErrorCode will also change the value of ResponseCode. Set ResponseCode second if you wish to set both values.

Note that setting ResponseCode to "AA" or "CA" won't stop the kernel from actually handling the message and setting response code itself. Consult Handledfor more information)

bool Handled;
   If this is set to true then the message will be acknowledged as accepted and the message won't actually be passed to the kernel. Only use this to accept a message instead of passing it to the kernel. If you want to return an AE or an ER, use ErrorCodeResponseCode or SetErrorinstead


Methods

void SendToInterface(string Name);
   Send the message to the named (message) interface.

Note that this is not immediate; instead, the message will be added to the queue after the script finishes executing

void SendToInterfaceWithParams(string Name, string OutTranslationParam, string InTranslationParam);
   Send the message to the named (message) interface with translation parameters for the scripts.

Note that this is not immediate; instead, the message will be added to the queue after the script finishes executing

void SendToVirtualQueue(string Name);
   Send the message to the named virtual queue.

Note that this is not immediate; instead, the message will be added to the queue after the script finishes executing

void SendToVirtualQueueWithPartition(string Name, string Partition);
   Send the message to the named virtual queue with a specified partition.

Note that this is not immediate; instead, the message will be added to the queue after the script finishes executing

void SetError(string Code, string Message);
   Call this to tell HL7Connect to reject the message. A NACK message will be built based on the information provided in this call.

The Message goes in MSA-3. The code goes in MSA-6. The MSA-1 value is derived from the code using the table found in the v2 standard (against MSA-6), either AE or AR. Use SetErrorCode to specify the MSA-1 code directly.

(consult SetErrorCodefor an example)

void SetErrorCode(string message, string responseCode, string errorCode);
   Call this to tell HL7Connect to reject the message. A NACK message will be built based on the information provided in this call.

The message goes in MSA-3. The responseCode goes in MSA-1, and the errorCode goes in MSA-6, if provided

Example of usage:


© Kestral Computing P/L 2000 - 2003. HL7Connect v2.00-063 generated on 30-Nov 2015.
Keywords: Message, SendToInterface, ErrorCode, ErrorMessage, Handled, ResponseCode, SendToInterfaceWithParams, SendToVirtualQueue, SendToVirtualQueueWithPartition, SetError, SetErrorCode, HL7Connect.Events.ReceiveMessage, ReceiveMessage