ISPatientIterator.Open

Description

This function loads the collection of the patients on the basis of the selected filter.

Syntax

object.Open piFilter

Part Attribute Type Description
object Required
The object always implements the ISPatientIterator interface
piFilter In, Required
The object that defines conditions for filtering

Example

Display the collection of the patients and their IDs loaded on the basis of the selected filter, the number of the patients and the maximum ID in the collection.

Dim aIterator  
Dim aFilter  
Dim aCount
Dim aId
Dim aExistsPatientId
Dim aMaxID 
Dim aCanProcessItem
Dim aPatient
Dim aMessage

Set aIterator = Profile.CreatePatientIterator
set aFilter = Profile.CreatePatientFilter
aFilter.Folder = "A1234"
aIterator.Open(aFilter)
aCount = aIterator.Count
aId = 8021
aExistsPatientId = aIterator.ExistsPatientId(aId)
aMaxID = aIterator.MaxID

aMessage = "Patients Count = " & aCount & "; " & "the patient with ID " & aId &_
 " is in the list: " & aExistsPatientId & "; " & "max ID: " & aMaxID & vbNewLine & vbNewLine
 
aMessage = aMessage & "Selected Patients: " & vbNewLine
aIterator.Reset
aCanProcessItem = aIterator.Next

i = 1
do while aCanProcessItem 
  set aPatient = aIterator.Patient
  aMessage = aMessage & vbNewLine & i & ")  " &_
   aPatient.FirstName & " " & aPatient.LastName &_
   " ( " & aIterator.PatientId & " ) "
  i = i + 1
  aCanProcessItem = aIterator.Next
loop

Profile.MsgBox(aMessage)  
Note:

See also

Version information

Added in v7.8.0