ISList.Sort

Description

This function adds several patient cases to the list, sort the list by case IDs, display case IDs and the titles that are presented in the list.

Syntax

object.Sort aMode

Part Attribute Type Description
object Required
The object always implements the ISList interface
aMode In, Required
The integer value that sorts the items of the collection

Example

Fill in the list with the user-selected patients and display case IDs and the titles that are presented in the list.

Dim aCaseList
Dim aSearchLists 
Dim aCases
Dim aCase
Dim aMessage
Dim i

Set aCaseList = Profile.CreateList

const aPatientCount = 5
for i = 1 to aPatientCount
  set aSearchLists = Profile.Lookup_GetPatientsCases(1, "Select Cases")
  set aCases = aSearchLists.Cases
 
  for each aCase in aCases
    aCaseList.Add(aCase)  
  next
next

aMessage = "The number of cases in the list is " & aCaseList.Count & vbNewLine

aMessage = aMessage & vbNewLine & "The list before sorting:" & vbNewLine
for each aCase in aCaseList
  aMessage = aMessage & vbNewLine & " - " & aCase.Id & " " & aCase.CaseTitle
next 

aCaseList.Sort(0) 'lsmCaseIdUp 

aMessage = aMessage & vbNewLine & "------" & vbNewLine &_ 
  "The list after sorting:" & vbNewLine
for each aCase in aCaseList
  aMessage = aMessage & vbNewLine & " - " & aCase.Id & " " & aCase.CaseTitle
next 

Profile.MsgBox(aMessage)
Note:

Version information

Added in v7.8.0