ISPrescriptionFilter.StartFromId

Description

This filter property is used to load the collection of prescriptions starting from the specified prescription OID.

Syntax

object.StartFromId

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: This filter property sorts the loaded prescriptions by the dates.

In Profile Client v8 on User Interface prescription OID can be found in Clinical > Medical Record > Prescriptions > Prior Scripts > Details > ID.

Version information

Added in v8.2.0