ISOrdersLoader.MaxCount

Added in v8.5.0

Description

The maximum number of the orders included in the batch.

Syntax

object.MaxCount

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

Return Value

int

Example

Display the number of the orders and some information about them.

Dim aPatient
Dim aOrdersLoader
Dim aLastId
Dim aTotalCount
Dim aOrders, aOrder
Dim i
Dim aMessage    

Set aPatient = Profile.SelectPatient
set aOrdersLoader = Profile.CreateOrdersLoader
aOrdersLoader.Patient = aPatient
aOrdersLoader.ChangedSince = #01/01/2000#
aOrdersLoader.StartFromId = 0 
aOrdersLoader.MaxCount = 4 'the size of the batch

aLastId = 0
aTotalCount = 0
do

  set aOrders = aOrdersLoader.LoadOrders

  for i = 0 to aOrders.Count - 1
    set aOrder = aOrders.Item(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ") " &_
      "DT Modified: " & aOrder.GetDTModified & vbNewLine &_
      "    ID: " & aOrder.ID & vbNewLine &_
      "    GUID: " & aOrder.GUID & vbNewLine &_
      "    Clinical Detail: " & aOrder.ClinicalDetail & vbNewLine &_
      "    Dx Info: " & aOrder.DxInfo & vbNewLine &_
      "    Encounter: " & aOrder.Encounter.Date & vbNewLine &_ 
      "    Supplier Type: " & aOrder.SupplierType.Name & vbNewLine &_
      "    Supplier: " & aOrder.Supplier.FullName & vbNewLine &_
      "    Self Collect Date: " & aOrder.SelfCollectDate & vbNewLine &_
      "    Self Collect Text: " & aOrder.SelfCollectText & vbNewLine
    
    aTotalCount = aTotalCount + 1 
    
    if aOrder.ID > aLastId then aLastId = aOrder.ID            
  next 

  aOrdersLoader.StartFromId = aLastId + 1
  aMessage = aMessage & vbNewLine
loop until aOrders.Count = 0

aMessage = "Orders Count = " & aTotalCount & vbNewLine & aMessage   

Profile.MsgBox(aMessage)   
Note:

In Profile Client v8 on User Interface Orders can be found in Clinical > Medical Record > Past Orders.

Version information

Obsolete in v8.5.0