ISLetterRecipient.LetterId

Description

ID of the letter the recipient should receive.

Syntax

object.LetterId

Part Attribute Type Description
object Required
The object always implements the ISLetterRecipient interface
Restriction: This property is readonly.

Return Value

int

Example

Display some information about the letters and their recipients, including the subjects of the letters the recipients should receive.

sub main
  Dim aPatient
  Dim aLetters, aLetter
  Dim aMainRecipient
  Dim aCCRecipients, aCCRecipient
  Dim i
  Dim aMessage

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

  aMessage =_
    "The number of the letters of the selected format is " & aLetters.Count

  for i = 0 to aLetters.Count - 1
    set aLetter = aLetters.Item(i) 
    aMessage = aMessage & vbNewLine & "---------------" & vbNewLine &_
      "Letter Date: " & aLetter.Date & vbNewLine &_
      "Letter Subject: " & aLetter.Subject2 & vbNewLine  

    set aMainRecipient = aLetter.MainRecipient  
    if not aMainRecipient is nothing then                              
       aMessage = aMessage & vbNewLine &_
          "Main Recipient: " & vbNewLine & GetLetterRecipientInfo(aMainRecipient)      
    end if 

    aMessage = aMessage & vbNewLine & "CC Recipients: "   
    set aCCRecipients = aLetter.CCRecipients
    for each aCCRecipient in aCCRecipients
      aMessage = aMessage & vbNewLine & GetLetterRecipientInfo(aCCRecipient) 
    next  
  next

  Profile.MsgBox(aMessage)
end sub

function GetLetterRecipientInfo(aRecipient)
  Dim aProvider
  Dim aExtProvider
  Dim aPOS
  Dim aInfo
  Dim aLetter

  aInfo = vbNewLine &_
    "  Recipient Type: " & aRecipient.RecipientType & vbNewLine &_
    "  Is Main: " & aRecipient.IsMainRecipient & vbNewLine
    
  if aRecipient.ProviderId > 0 then
    set aProvider = Profile.LoadProviderById(aRecipient.ProviderId) 
    aInfo = aInfo & "  Provider: " & aProvider.FullName & vbNewLine 
  end if
    
  if aRecipient.ExternalProviderID > 0 then 
    set aExtProvider = Profile.LoadExternalProviderById(aRecipient.ExternalProviderID)
    aInfo = aInfo & "  External Provider: " & aExtProvider.FullName & vbNewLine 
  end if 
    
  if aRecipient.PatientId > 0 then
    set aPatient = Profile.LoadPatient(aRecipient.PatientId)
    aInfo = aInfo & "  Patient: " & aPatient.SurnameFirstName & vbNewLine  
  end if
  
  if aRecipient.LetterId > 0 then 
    set aLetter = Profile.LoadLetter(aRecipient.LetterId)
    aInfo = aInfo & "  Letter: " & aLetter.Subject2 & vbNewLine
  end if 
    
  if aRecipient.PosID > 0 then
    set aPOS = Profile.LoadProviderById(aRecipient.PosID) 
    aInfo = aInfo & "  Pos: " & aPOS.FullName & vbNewLine 
  end if

  GetLetterRecipientInfo = aInfo
end function 
Note: In Profile Client v8 on User Interface Letter ID cannot be found.

Letter Subject can be found in Clinical > Medical Record > Documents > Open saved document > Information and Recipients > Subject field or in Organisation > Work Centre > Communication > Letters > Open saved document > Information and Recipients > Subject field.

Version information

Added in v7.8.0