ISReferral.LinkFamilyProblem

Description

This function links the family problem to the referral of the selected patient.

Syntax

object.LinkFamilyProblem aFamilyProblem

Part Attribute Type Description
object Required
The object always implements the ISReferral interface
aFamilyProblem In, Required
The family problem linked to the referral

Example

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

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

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

  aMessage = "INITIAL STATE:" & GetLinkedFamilyProblemsInfo(aReferrals)

  set aProblems = aPatient.LoadFamilyProblems
  for each aReferral in aReferrals 
    for each aProblem in aProblems
      aReferral.LinkFamilyProblem aProblem
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "REFERRALS AFTER FAMILY PROBLEMS LINKING:" & GetLinkedFamilyProblemsInfo(aReferrals) & vbNewLine

  Profile.MsgBox(aMessage)
end sub

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

In Profile Client v8 on User Interface Family Problems can be found in Patient > Patient Referrals > Open Outward Referral > Attachments > ticked items in Family History node.

See also

Version information

Added in v8.4.32