ISLetter.UnlinkFamilyProblem

Description

This function unlinks the family problem from the letter of the selected patient.

Syntax

object.UnlinkFamilyProblem aFamilyProblem

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

Example

Unlink the family problem from the letter of the selected patient.

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

  Set aPatient = Profile.SelectPatient
  set aLetters = aPatient.GetLetters (1) ' slcfWordRTF
  
  aMessage = "INITIAL STATE:" & GetLinkedFamilyProblemsInfo(aLetters)

  for each aLetter in aLetters
    set aProblems = aLetter.LinkedFamilyProblems  
    for i = aProblems.Count - 1 to 0 step -1
      aLetter.UnlinkFamilyProblem aProblems.Item(i)
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "LETTERS AFTER FAMILY PROBLEMS UNLINKING:" & GetLinkedFamilyProblemsInfo(aLetters) & vbNewLine

  Profile.MsgBox(aMessage)
end sub

function GetLinkedFamilyProblemsInfo(aLetters)
  Dim aLetter
  Dim aInfo
  Dim aProblems, aProblem
   
  for each aLetter in aLetters
    aInfo = aInfo & vbNewLine & "Letter ID: " & aLetter.Id
    set aProblems = aLetter.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:

In Profile Client v8 on User Interface Family Problems can be found and unlinked in Clinical > Medical Record > Documents > Open saved document > Attachments > Family History or in Organisation > Work Centre > Communication > Letters > Open saved document > Attachments > Family History.

See also

Version information

Added in v8.4.59