ISEncounterFilter.StartFromId

Description

This filter property is used to load the collection of the encounters starting from the specified ID.

Syntax

object.StartFromId

Part Attribute Type Description
object Required
The object always implements the ISEncounterFilter interface

Return Value

int

Example

Display the number of the encounters loaded on the basis of the selected filter and some information about them.

Dim aPatient
Dim aFilter 
Dim aLastId
Dim aTotalCount
Dim aEncounters, aEncounter 
Dim aMessage
Dim i

set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateEncounterFilter
aFilter.PatientID = aPatient.ID
aFilter.StartFromId = 0
aFilter.MaxCount = 5
aFilter.SortMode = 4 'slsmIDAsc 

aLastId = 0
aTotalCount = 0
do
  set aEncounters = aPatient.LoadEncounters(aFilter)

  for i = 0 to aEncounters.Count - 1 
    set aEncounter = aEncounters.Item(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ") " &_
      "Date: " & aEncounter.Date & vbNewLine &_
      "ID: " & aEncounter.ID & vbNewLine &_
      "Patient: " & aPatient.SurnameFirstName & vbNewLine 
      
    aTotalCount = aTotalCount + 1 
    
    if aEncounter.Id > aLastId then aLastId = aEncounter.Id   
  next 
     
  aFilter.StartFromId = aLastId + 1
  aMessage = aMessage & vbNewLine &_
    "----------------------------" & vbNewLine
loop until aEncounters.Count = 0

aMessage = "Encounters Count: " & aTotalCount & vbNewLine & aMessage

Profile.MsgBox(aMessage) 
Note:

In Profile Client v8 on User Interface Encounter ID can be found in Clinical > Medical Record > Encounters > Open encounter > Encounter Properties > ID.

Version information

Added in v8.4.0