ISLetter.UnlinkProblem

Description

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

Syntax

object.UnlinkProblem aPatientProblem

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

Example

Unlink the patient's problem from the letter.

sub main
  Dim aPatient
  Dim aLetters, aLetter
  Dim aProblems
  Dim aMessage

  Set aPatient = Profile.SelectPatient
  set aLetters = aPatient.GetLetters (1) ' slcfWordRTF

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

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

function GetLinkedProblemsInfo(aLetters)
  Dim aLetter
  Dim aInfo
  Dim aProblems, aProblem
   
  for each aLetter in aLetters
    aInfo = aInfo & vbNewLine & "Letter ID: " & aLetter.ID
    set aProblems = aLetter.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 Problems can be found and unlinked in Clinical > Medical Record > Documents > Open saved document > Attachments > ticked items in Adverse/Diagnosis/Procedures/Social/Risk nodes or in Organisation > Work Centre > Communication > Letters > Open saved document > Attachments > ticked items in Adverse/Diagnosis/Procedures/Social/Risk nodes.

See also

Version information

Added in v8.4.59