ISReferral.LinkedUsualPrescriptions

Description

This function returns the prescriptions linked to each referral of the selected patient.

Syntax

object.LinkedUsualPrescriptions()

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

Return Value

ISUsualPrescriptions

Returns IDs of the linked prescriptions for each referral of the selected patient.

Example

Display IDs of the linked prescriptions for each referral of the selected patient.

sub main
  Dim aPatient
  Dim aFilter
  Dim aReferrals
  Dim aMessage

  Set aPatient = Profile.SelectPatient
  set aFilter = Profile.CreateReferralsFilter
  aFilter.Patient = aPatient
  set aReferrals = Profile.LoadReferrals(aFilter)

  aMessage = "INITIAL STATE:" & GetLinkedUsuslaMedicationsInfo(aReferrals)
  
  Profile.MsgBox(aMessage)
end sub

function GetLinkedUsuslaMedicationsInfo(aReferrals)
  Dim aReferral
  Dim aUsualPrescriptions, aUsualPrescription
  Dim aInfo

  for each aReferral in aReferrals
    aInfo = aInfo & vbNewLine & "Referral Id: " & aReferral.Id
    set aUsualPrescriptions = aReferral.LinkedUsualPrescriptions
    if aUsualPrescriptions.Count > 0 then aInfo = aInfo & vbNewLine & "  Med IDs: "   
    for each aUsualPrescription in aUsualPrescriptions
      aInfo = aInfo & aUsualPrescription.Oid & ", "
    next
  next
  GetLinkedUsuslaMedicationsInfo = aInfo
end function  
Note:

In Profile Client v8 on User Interface Usual Prescriptions can be found in Patient > Patient Referrals > Open Outward Referral > Attachments > ticked items in Usual Medications node.

Version information

Added in v8.4.32