ISLetter.LinkProblem

Description

This function links the patient's problem to the letter.

Syntax

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

Link the patient's problem to the letter and display its ID.

sub main
  Dim aPatient
  Dim aLetters, aLetter
  Dim aProblemList
  Dim aProblem
  Dim aMessage

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

  aMessage = "INITIAL STATE:" & GetLinkedProblemsInfo(aLetters)
  
  set aProblemList = aPatient.ProblemList
  for each aLetter in aLetters 
    for each aProblem in aProblemList
      aLetter.LinkProblem aProblem
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "LETTERS AFTER PROBLEMS LINKING:" & 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: This function throws exception when the link between the objects already exists.

In Profile Client v8 on User Interface Problems can be found and linked 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