ISLetter.LinkedEncounters

Description

This function returns the encounters linked to each letter of the selected patient.

Syntax

object.LinkedEncounters()

Part Attribute Type Description
object Required
The object always implements the ISLetter interface

Return Value

ISEncounters

Returns IDs of the linked encounters for each letter of the selected patient.

Example

Display IDs of the linked encounters for each letter of the selected patient.

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

  Profile.MsgBox(aMessage)
end sub

function GetLinkedEncountersInfo(aLetters)
  Dim aLetter
  Dim aEncounters, aEncounter
  Dim aInfo
  
  for each aLetter in aLetters
    aInfo = aInfo & vbNewLine & "Letter ID: " & aLetter.Id
    set aEncounters = aLetter.LinkedEncounters
    if aEncounters.Count > 0 then aInfo = aInfo & vbNewLine &_
      "  Linked Encounters IDs: "   
    for each aEncounter in aEncounters
      aInfo = aInfo & aEncounter.Id & ", "
    next
  next
  GetLinkedEncountersInfo = aInfo
end function 
Note:

In Profile Client v8 on User Interface Linked Encounters can be found in Clinical > Medical Record > Documents > Open saved document > Attachments > Encounters or in Organisation > Work Centre > Communication > Letters > Open saved document > Attachments > Encounters.

Version information

Added in v8.4.59