ISLetter.LinkFlowSheet

Description

This function links the flow sheet to the letter of the selected patient.

Syntax

object.LinkFlowSheet aFlowSheet

Part Attribute Type Description
object Required
The object always implements the ISLetter interface
aFlowSheet In, Required
The flow sheet linked to the letter

Example

Link the flow sheet to the letter of the selected patient and display its code.

sub main
  Dim aPatient
  Dim aFilter
  Dim aLetters, aLetter
  Dim aFlowSheets, aFlowSheet
  Dim aMessage
  
  Set aPatient = Profile.SelectPatient
  set aLetters = aPatient.GetLetters (1) ' slcfWordRTF

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

  set aFilter = Profile.CreateFlowSheetFilter
  aFilter.PatientId = aPatient.Id
  set aFlowSheets = Profile.LoadFlowSheets(aFilter)
  for each aLetter in aLetters 
    for each aFlowSheet in aFlowSheets
      aLetter.LinkFlowSheet aFlowSheet
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "LETTERS AFTER FLOWSHEETS LINKING:" & GetLinkedFlowSheetsInfo(aLetters) & vbNewLine

  Profile.MsgBox(aMessage)
end sub

function GetLinkedFlowSheetsInfo(aLetters)
  Dim aLetter
  Dim aInfo
  Dim aFlowSheets, aFlowSheet
  
  for each aLetter in aLetters
    aInfo = aInfo & vbNewLine & "Letter ID: " & aLetter.ID
    set aFlowSheets = aLetter.LinkedFlowSheets
    if aFlowSheets.Count > 0 then aInfo = aInfo & vbNewLine & "  FlowSheets Codes: "   
    for each aFlowSheet in aFlowSheets
      aInfo = aInfo & aFlowSheet.Code & ", "
    next
  next
  GetLinkedFlowSheetsInfo = aInfo
end function  
Note: This function throws exception when the link between the objects already exists.

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

Version information

Added in v8.4.59