Ancestor: HL7Connect.Events.Base

Called by an incoming scripted message interface basis. If the script determines that a message is to be generated, then it should create one and send it using the SendMessage method

The script is called under two different circumstances (as configured). Either it is called on a regular schedule, or it is called when there are items in the virtual queue to be processed. If the event is called because there is a message or document in a virtual queue, then either the IncomingMessage or IncomingDocument properties will be non-null, and the script must set IncomingHandled to true - or else the same message will be processed repeatedly

Note that this is the one place in HL7Connect where documents and messages can mix - this event requires an outgoing message, but either documents or messages will come in, depending on the configuration of the interface

KScript: the generated content is sent to the kernel as a document (One document per execution). IncomingHandled is set to true if the script executes and the message is accepted.

Properties

HL7Connect.Exchange.Message IncomingMessage;
   The message that is being handled, if the event is being called because a message has been queued to a virtual queue that the incoming scripted interface is triggered on.

HL7Connect.Exchange.Document IncomingDocument;
   The Document that is being handled, if the event is being called because a Document has been queued to a virtual queue that the incoming scripted interface is triggered on.

HL7Connect.Exchange.DicomMessage IncomingDicom;
   The Dicom Message that is being handled, if the event is being called because a Dicom Message has been queued to a virtual queue that the incoming scripted interface is triggered on.

bool IncomingHandled;
   If the event is being called in response to a message or document in a virtual queue, this must be set to true to tell the kernel to remove the message from the virtual queue - else the script will be called again indefinitely.

You can safely leave IncomingHandled = false; there is always a short break (at least 1 second) before repeating the script after IncomingHandled is false to keep the load on the system down


Methods

HL7Connect.Cda.ClinicalDocument MakeDocument();
   Start building a CDA document. The document is created, but no properties are set other than the mandatory typeId.

HL7Connect.Ccd.Builder UseCCD(HL7Connect.Cda.ClinicalDocument oDocument, bool bBuild);
   Use the CCD builder with a document.

The CCD builder wraps the CDA document with a set of object builders based on the CCD specification. The CCD builder builds the CDA document in the background. Note that you can work with either the CDA document or the CCD builder, and you can mix the use. In fact, you have to, since the CCD specification makes a set of rules about how to use the CDA document, but it is incomplete.

Important note: when the CCD Builder works with the lists, it keeps links into the underlying CDA list. For exxample, the CCD builder uses the section list. If you add a section through the CCD builder, but then delete the section in the underlying document, unpredictable effects will result. Either use the CCD Builder to add sections, or reset the CCD Builder list if you edit the sections directly.

If you set build = true, then the CCD Builder will (re)initialise the document, ensuring that it conforms to the CCD specification to the degree possible as information is possible. If you set build = false, the CCD builder will read the document to the degree possible, and then you can edit/update the document.

void SendDocument(HL7Connect.Cda.ClinicalDocument ADocument);
   Send the Document to the kernel as a new incoming Document.

If sending the document fails, an exception will be thrown

void SendDocumentEx(HL7Connect.Cda.ClinicalDocument ADocument, string ASourceParameter);
   Send the Document to the kernel as a new incoming Document. The second parameter is passed to any incoming scripts as the source parameter on the event

If sending the document fails, an exception will be thrown


© Kestral Computing P/L 2000 - 2003. HL7Connect v2.00-063 generated on 30-Nov 2015.
Keywords: IncomingDicom, IncomingDocument, IncomingHandled, IncomingMessage, MakeDocument, SendDocument, SendDocumentEx, UseCCD, HL7Connect.Events.CheckDocument, CheckDocument