ISPatient.LoadPrescriptionsForContact

Description

This function returns the prescriptions for the patient, prescribed in the selected contact.

Syntax

object.LoadPrescriptionsForContact(aContactID)

Part Attribute Type Description
object Required
The object always implements the ISPatient interface
aContactID In, Required
int
ID of the patient's contact

Return Value

ISPrescriptions

Returns the prescriptions for the patient by contact ID.

Example

Display the number and the names of the prescriptions, prescribed in the selected contact.

Dim aPatient  
Dim aPrescriptions
Dim aPrescription
Dim aFilter
Dim aEncounters
Dim aFirstCase
Dim aContactID
Dim aMessage

Set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateEncounterFilter
aFilter.ProviderCode = "MM"
set aEncounters = aPatient.LoadEncounters(aFilter)

if aEncounters.Count = 0 then
  Profile.MsgBox ("No encounters!") 
else 
  aContactID = aEncounters.Item(0).Contacts(0).ID  
  set aPrescriptions = aPatient.LoadPrescriptionsForContact(aContactID)
  aMessage = "Prescriptions Count = " & aPrescriptions.Count 

  for i = 0 to aPrescriptions.Count - 1
    set aPrescription = aPrescriptions.Item(i)
    aMessage = aMessage & vbNewLine & aPrescription.RxName 
  next

  Profile.MsgBox(aMessage)  
end if
Note:

In Profile Client v8 on User Interface Prescriptions can be found in Clinical > Medical Record > Encounters > Scripts view.

Version information

Added in v7.8.0