ISMedicationsSet.AddToRefillMeds

Description

This function adds the patient's prescriptions to the prescription refill items.

Syntax

object.AddToRefillMeds aRefilItemsIDs, aIsPatientRequested, aSupplierId

Part Attribute Type Description
object Required
The object always implements the ISMedicationsSet interface
aRefilItemsIDs In, Required
IDs of the prescription refill items
aIsPatientRequested In, Required
bool
If aIsPatientRequested = True, all prescription refills that come from a patient will be shown
aSupplierId In, Required
int
ID of the supplier for the refill item

Example

Add the patient's prescriptions to the prescription refill items. Display the number of the prescription refill items before and after adding new prescriptions.

Dim aTr
Dim aPatient
Dim aMedicationsSet
Dim aPrescriptions, aPrescription
Dim aIntColl
Dim aRefillMeds, aRefillMed
Dim aIsPatientRequested
Dim aSupplier, aSupplierId
Dim aMessage
Dim i  

Set aTr = Profile.StartMapTransaction
set aPatient = Profile.SelectPatient                         
set aMedicationsSet = aPatient.Medications
set aPrescriptions = aMedicationsSet.All

set aIntColl = Profile.CreateIntCollection

for each aPrescription in aPrescriptions
  aIntColl.Add(aPrescription.OID)
next

set aRefillMeds = aMedicationsSet.RefillMeds

aMessage = "Refill Medications Count before = " & aRefillMeds.Count & vbNewLine

set aSupplier = Profile.LoadExternalProvider("FAX_PROV") 
aSupplierId = aSupplier.ID  
aIsPatientRequested = True

aMedicationsSet.AddToRefillMeds aIntColl, aIsPatientRequested, aSupplierId

aTr.SnapShot

set aRefillMeds = aMedicationsSet.RefillMeds

if not aRefillMeds is nothing then 
  aMessage = aMessage & "Refill Medications Count after = " & aRefillMeds.Count & vbNewLine 

  for i = 0 to aRefillMeds.Count - 1
    set aRefillMed = aRefillMeds.Items(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ". " &_
      "RxName: " & aRefillMed.RxPrescr.RxName 
  next    
end if

Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Refill Medications can be found in Organisation > Work Centre > Work > Prescription Refills > Pending Items.

See also

Version information

Added in v7.8.0
parameter aSupplierId added in v8.3.0