ISReferral.LinkProblem

Description

This function links the patient's problem to the referral of the selected patient.

Syntax

object.LinkProblem aPatientProblem

Part Attribute Type Description
object Required
The object always implements the ISReferral interface
aPatientProblem In, Required
The patient's problem linked to the referral

Example

Link the patient's problem to the referral of the selected patient and display its ID.

sub main
  Dim aPatient
  Dim aFilter
  Dim aReferrals, aReferral
  Dim aProblemList
  Dim aProblem
  Dim aMessage

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

  aMessage = "INITIAL STATE:" & GetLinkedProblemsInfo(aReferrals)
  
  set aProblemList = aPatient.ProblemList
  for each aReferral in aReferrals 
    for each aProblem in aProblemList
      aReferral.LinkProblem aProblem
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "REFERRALS AFTER PROBLEMS LINKING:" & GetLinkedProblemsInfo(aReferrals) & vbNewLine

  Profile.MsgBox(aMessage)
end sub

function GetLinkedProblemsInfo(aReferrals)
  Dim aReferral
  Dim aInfo
  Dim aProblems, aProblem
  
  for each aReferral in aReferrals
    aInfo = aInfo & vbNewLine & "Referral Id: " & aReferral.Id
    set aProblems = aReferral.LinkedProblems
    if aProblems.Count > 0 then aInfo = aInfo & vbNewLine & "  Problem IDs: "   
    for each aProblem in aProblems
      aInfo = aInfo & aProblem.Id & ", "
    next
  next
  GetLinkedProblemsInfo = aInfo
end function  
Note: This function throws exception when the link between the objects already exists.

In Profile Client v8 on User Interface Linked Problems can be found in Patient > Patient Referrals > Open Outward Referral > Attachments > ticked items in Adverse > Diagnosis > Procedures > Social > Risk nodes.

See also

Version information

Added in v8.4.32