ISReferral.UnlinkProblem

Description

This function unlinks the patient's problem from the referral.

Syntax

object.UnlinkProblem 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

Unlink the patient's problem from the referral.

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

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

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

  for each aReferral in aReferrals
    set aProblems = aReferral.LinkedProblems  
    for i = aProblems.Count - 1 to 0 step -1
      aReferral.UnlinkProblem aProblems.Item(i)
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "REFERRALS AFTER PROBLEMS UNLINKING:" & GetLinkedProblemsInfo(aReferrals) & vbNewLine
    
  Profile.MsgBox(aMessage)
end sub

function GetLinkedProblemsInfo(aReferrals)
  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:

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