ISPatientMessage.ConversationId

Description

ID of the conversation the patient's messages are part of.

Syntax

object.ConversationId

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

Return Value

int

Example

Display the number of the patient's messages loaded on the basis of the selected filter, their text, conversation ID and the participants of the conversation.

Dim aPatient
Dim aProvider
Dim aDateTo
Dim aCount
Dim aConversations
Dim aConversation
Dim aIntCollection
Dim aFilter
Dim aPatMessages
Dim aPatMessage
Dim aMessage 

Set aProvider = Profile.LoadProvider("MM")

if aProvider.ID = 0 then
  Profile.MsgBox("There is no provider with the specified code")
  exit sub
end if

aDateTo = #04/23/2019#
aCount = 0

set aConversations = Profile.LoadFullConversationsByParticipant(aProvider.ID, aDateTo, aCount)
set aIntCollection = Profile.CreateIntCollection


for each aConversation in aConversations
  aIntCollection.Add(aConversation.ConversationId)
next

set aFilter = Profile.CreatePatientMessagesFilter 
aFilter.ConversationIds = aIntCollection
 
set aPatMessages = Profile.LoadPatientMessages(aFilter)

aMessage = "Patient Messages Count = " & aPatMessages.Count & vbNewLine  

for i = 0 to aPatMessages.Count - 1
  set aPatMessage = aPatMessages.Item(i)
  
  if aPatMessage.PatientId > 0 then
    set aPatient = Profile.LoadPatient(aPatMessage.PatientId)
    aMessage = aMessage & "Patient: " & vbTab & aPatient.SurnameFirstname & vbTab
  else
    aMessage = aMessage & "Patient: " & vbTab & "    -      " & vbTab        
  end if  
  
  if aPatMessage.ProviderId > 0 then 
    set aProvider = Profile.LoadProviderById(aPatMessage.ProviderId)
    aMessage = aMessage & "Prov: " & vbTab & aProvider.FullName & vbTab
  else
    aMessage = aMessage & "Prov: " & vbTab & "    -      " & vbTab    
  end if

  aMessage = aMessage & "Text: " & vbTab & aPatMessage.Text & " (Conversation ID: " &_ 
    aPatMessage.ConversationId & ")" & vbNewLine
next
  
Profile.MsgBox(aMessage)   
Note:

In Profile Client v8 on User Interface Conversation Id cannot be found, but Conversations can be found in Organisation > Work Centre > Communication > Conversations.

Version information

Added in v8.4.0