ScriptEvent

Top  Previous  Next

Object: EHL7.CommandoProcessor

FileName: EHL7.dll

 

EVENT

 

Name: ScriptEvent

Parameters:

 

1. eventName (String) The name of the event
2. eventParms (String) User defined data

 

Description: Built into the CommandoScript objects is the SMEvent object.  Authors of CommandoScript projects may use this object to raise events to the framework running the processor.  In the Commando HL7 workbench there are only 3 values in the eventName parameter that mean anything, they are:

 

1. CANCEL - Causes the script to cancel processing
2. ERROR - Causes the script to cancel processing
3. TRACE - Causes the data in <eventParms> to be displayed in a scrolling progress trace list.

 

In Commando, all other values are ignored.

 

In the CommandoProcessor object this event is raised to you for ANY value passed in <eventName>.  If the <eventName> parameter is "CANCEL" or "ERROR", the object will automatically handle the situation and processing will be cancelled after the event is raised.  But any other value is yours to use as you see fit.

 

Example:

 

CommandoScript Code Snippet:

 

With oMSG

   If Ucase(.GetFieldValue(sPID, 5, 1)) = "SMITH" Then

          'The patient's last name is smith

          SMEvent.Raise "FOUNDSMITH", "The processor found someone named Smith"

   End If

End With 

 

 

Your Code Snippet for the processor's ScriptEvent handler

 

Private Sub oProcessor_ScriptEvent(eventName, eventParms)

   If eventName = "FOUNDSMITH" Then 

      MsgBox eventParms, vbInformation, "Alert"

   End If

End Sub

 

 

Related Items: EasyHL7 Events in VB, ProcessorUnloaded