ISMedicationsSet.RemoveRefillMed

Description

This function removes the prescription refill item.

Syntax

object.RemoveRefillMed(aPrescrID)

Part Attribute Type Description
object Required
The object always implements the ISMedicationsSet interface
aPrescrID In, Required
int
ID of the prescription refill item

Return Value

bool

Example

Remove the prescription refill items with the specified Rx name. Display the number of the prescription refill items before and after removing.

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

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 before removing = " &_
    aRefillMeds.Count & vbNewLine 
end if

for i = 0 to aRefillMeds.Count - 1
  set aRefillMed = aRefillMeds.Items(i)
  if aRefillMed.RxPrescr.RxName = "Pentasa" then 
    aMedicationsSet.RemoveRefillMed(aRefillMed.ID)
  end if
next    

aTr.SnapShot

set aRefillMeds = aMedicationsSet.RefillMeds

aMessage = aMessage & "Refill Medications Count after removing = " &_
  aRefillMeds.Count & vbNewLine 

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.

Version information

Added in v7.8.0