ISPrescriptionFilter.MaxNumber

Description

This filter property is used to load the maximum number of the prescriptions. The maximum number is determined by the user.

Syntax

object.MaxNumber

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

Return Value

int

Example

Display the number of the prescriptions loaded on the basis of the selected filter and divided into the batches. Display their start dates and the names of the Rx medications.

Dim aFilter
Dim aTotalCount
Dim aPrescriptions, aPrescription
Dim aLastId
Dim i
Dim aMessage

Set aFilter = Profile.CreatePrescriptionFilter
aFilter.Patient = Profile.SelectPatient
aFilter.StartFromId = 0
aFilter.MaxNumber = 5 'The size of batch

aTotalCount = 0
do
  set aPrescriptions = Profile.LoadPrescriptions(aFilter)

  aLastId = 0
  for i = 0 to aPrescriptions.Count - 1
    set aPrescription = aPrescriptions.Item(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ") " & aPrescription.RxName &_ 
      " (start date: " & aPrescription.StartDate & ")"   
   
    aTotalCount = aTotalCount + 1

    if aPrescription.OID > aLastId then aLastId = aPrescription.OID   
  next   
  aFilter.StartFromId = aLastId + 1
  aMessage = aMessage & vbNewLine
loop until aPrescriptions.Count = 0

aMessage = "The number of the loaded prescriptions is "  & aTotalCount &_ 
  vbNewLine & aMessage

Profile.MsgBox(aMessage)  
Note:

Version information

Added in v8.2.0