IMPAX 6.5.1 Client Knowledge Base: Extended > Administering IMPAX > Configuring dictation > Configuring the IMPAX Reporting solution > Creating feed worklists

Sample feed worklist script


Using the feed worklist feature, you can define IMPAX worklists based on IMPAX RIS criteria. You can use the sample script below as a basis for your feed worklists. The lines in bold can be customized and the lines in italic describe the purpose of the previous line.

Note:

Note:

The first highlighted line param_UseGUI ="1" determines if the RIS worklist feed dialog is displayed or not. When enabled, the following settings do not apply.

Option Strict Off
Imports System
Imports System.Windows.Forms

Module Script
Sub Main()

  Dim param_UseGUI
  Dim param_Exec
  Dim param_FilterType
  Dim param_FilterName
  Dim param_UseDates
  Dim param_DateBegin
  Dim param_DateEnd
  Dim param_OneStudy

  Dim myOptions As String
  Dim oReg
  Dim strKeyPath  
  Dim nbr

  Dim objAxQDLink
  Dim strXMLActiveContext  
  Dim importType As Integer  
  Dim pos As Integer
  importType=0   
  nbr=0  
  
  const HKEY_LOCAL_MACHINE = &H80000002
  
  param_UseGUI      ="1"
 [Defines whether or not the popup dialog is displayed. When enabled, the other settings below do not matter]
  param_Exec        ="1"      '1=import 2=cycle
 [Import the resulting worklist in ListArea, or immediately cycle the worklist in Text/ImageArea]
  param_FilterType  ="1"      '1=request 2=report 3=dictation
	[Apply a request, report or dictation feed worklist filter]
  param_FilterName  ="test_req_1"
	[Name of the filter to apply]
  param_UseDates    ="1"
	[Use date constraints when applying the filter]
  param_DateBegin   ="28/07/2008"
 [If UseDates is enabled, enter start date here]
  param_DateEnd     ="27/12/2008"
	[If UseDates is enabled, enter end date here]
  param_OneStudy    ="0"
	[Return one or multiple studies per report/request/dictation]

  myOptions = "param_UseGui=" + param_UseGUI + ";param_Exec=" + param_Exec + ";param_FilterType=" + param_FilterType + ";param_FilterName=" + param_FilterName + ";param_UseDates=" + param_UseDates + ";param_DateBegin=" + param_DateBegin + ";param_DateEnd=" + param_DateEnd + ";param_UseMultiple=" + param_OneStudy  

  oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") 
  strKeyPath = "SOFTWARE\Quadrat\FeedWorklistOptions"
  oReg.CreateKey(HKEY_LOCAL_MACHINE,strKeyPath)  
  oReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath,"Options",myOptions)

  Shell("C:\temp\feedWorklist\feedworklist.exe", vbNormalFocus, True, -1)
 [Defines location of the feedworklist.exe file.]

  oReg.DeleteKey(HKEY_LOCAL_MACHINE, strKeyPath)

  objAxQDLink = CreateObject("AxQDLink.AX_QDLink")  
  strXMLActiveContext = objAxQDLink.ContentXML  
  'MsgBox(strXMLActiveContext)  

  pos = InStr(1, strXMLActiveContext, "*", vbTextCompare)
 
  If pos>0
    ClearSearchWorkList() 
    ClearDisplay()
    ClearCycleList() 
  End If 


  If pos>1

    Dim constraint As System.Text.StringBuilder = New System.Text.StringBuilder
    Dim p As Integer
    Dim ctr As Integer
    Dim val As String
   
    pos = InStr(1, strXMLActiveContext, ":", vbTextCompare)
    If pos>0
      val  = Left(strXMLActiveContext, pos-1)
      strXMLActiveContext = Right(strXMLActiveContext, Len(strXMLActiveContext)-pos)      
      If val="import"
        importType=0  
      End If 
      If val="cycle"
        importType=1        
      End If
    End If

    If importType=0
      ctr=0
      pos=1  
      constraint.Append("((study.accession_number= ")
    
      While pos>0
        pos = InStr(1, strXMLActiveContext, ",", vbTextCompare)
        If (pos=1)
          strXMLActiveContext= Right(strXMLActiveContext, Len(strXMLActiveContext)-1)
          pos = InStr(1, strXMLActiveContext, ",", vbTextCompare)
        End If
        If pos>0
          val  = Left(strXMLActiveContext, pos-1)
          strXMLActiveContext = Right(strXMLActiveContext, Len(strXMLActiveContext)-pos)
          constraint.Append("""")
          constraint.Append( val )
          'MsgBox(val)
          ctr=ctr+1
          constraint.Append("""")
          constraint.Append(") or (study.accession_number= ")        
        Else
          p = InStr(1, strXMLActiveContext, "*", vbTextCompare)
          val  = Left(strXMLActiveContext, p-1)        
          constraint.Append("""")        
          constraint.Append( val )
          'MsgBox(val)
          ctr = ctr+1
          constraint.Append("""")
          constraint.Append("))")            
        End If
      End While

      'MsgBox(constraint.ToString())
      If ctr > 0
        ScriptListArea.AddToSearchWorkListWithConstraintString(constraint.ToString())               
        nbr = ScriptListArea.SelectAllInSearchWorkList()
        ScriptListArea.SelectWorklistItem(1)
        If (nbr < ctr)
          MsgBox("Only "+ CStr(nbr) + " of the " + CStr(ctr) + " studies are added to the worklist due to missing Impax data", vbOKOnly, "RIS Worklist feed")
        End if
      End If
    Else
      If importType=1
        Dim actVal As String
        If Len(strXMLActiveContext)>0
          pos=1  
          ctr=0
          actVal=""

          While pos>0
            pos = InStr(1, strXMLActiveContext, ",", vbTextCompare)
            If (pos=1)
              strXMLActiveContext= Right(strXMLActiveContext, Len(strXMLActiveContext)-1)
              pos = InStr(1, strXMLActiveContext, ",", vbTextCompare)
            End If
            If pos>0
              val  = Left(strXMLActiveContext, pos-1)
              strXMLActiveContext = Right(strXMLActiveContext, Len(strXMLActiveContext)-pos)              
              AddToDisplayListWithAcn(val, StudyOpenActions.CycleList)            
            Else
              p = InStr(1, strXMLActiveContext, "*", vbTextCompare)
              val  = Left(strXMLActiveContext, p-1)                 
              AddToDisplayListWithAcn(val, StudyOpenActions.CycleList)
            End If
            If ctr=0
              actVal = val
              ctr=ctr+1
            End If
          End While
          DisplayWorklist()
          If Len(actVal)>0
            ActivateStudyInDisplayWithAcn(actVal)
          End If
        End If
      End If
    End If
  End If 


End Sub
End Module

Topic number: 98621

Applies to: IMPAX 6.5.1 Client Knowledge Base