ISLetter.UnlinkFlowSheet

Description

This function unlinks the flow sheet from the letter of the selected patient.

Syntax

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

Unlink the flow sheet from the letter of the selected patient.

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

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

  for each aLetter in aLetters
    set aFlowSheets = aLetter.LinkedFlowSheets    
    for i = aFlowSheets.Count - 1 to 0 step -1
      aLetter.UnlinkFlowSheet aFlowSheets.Item(i)
    next
  next
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "LETTERS AFTER FLOWSHEETS UNLINKING:" & GetLinkedFlowSheetsInfo(aLetters) & vbNewLine

  Profile.MsgBox(aMessage)
end sub

function GetLinkedFlowSheetsInfo(aLetters)
  Dim aInfo
  Dim aFlowSheets, aFlowSheet
  Dim aLetter

  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:

In Profile Client v8 on User Interface Flow Sheets can be found and unlinked 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