ISCDOTransaction.GetAsEncounter

Description

This function returns the CDO transaction as ISEncounter.

Syntax

object.GetAsEncounter()

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

Return Value

ISEncounter

Returns the CDO transaction as ISEncounter.

Example

Display some information about the CDO transactions, including the diagnosis descriptions for the contacts of the encounters.

Dim aPatient
Dim aFilter 
Dim aCDOTransactions, aCDOTransaction
Dim aEncounter
Dim aContacts, aContact 
Dim aMessage
Dim i
Dim j

Set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateCDOTransFilter
aFilter.PatientId = aPatient.Id
aFilter.TransactionTypes = 1 'tsotweEncounters
set aCDOTransactions = Profile.LoadCDOTransactions(aFilter)

aMessage = "CDO Transactions Count = " & aCDOTransactions.Count & vbNewLine
for i = 0 to aCDOTransactions.Count - 1
  set aCDOTransaction = aCDOTransactions.Item(i)
  aMessage = aMessage & vbNewLine & (i + 1) & ") " &_
    "Created on: " & aCDOTransaction.CreatedOn & vbNewLine &_
    "     Code: " & aCDOTransaction.Code & vbNewLine &_
    "     ID: " & aCDOTransaction.ID & vbNewLine &_
    "     GUID: " & aCDOTransaction.GUID & vbNewLine &_
    "     DisplayDate: " & aCDOTransaction.DisplayDate & vbNewLine
    
  set aEncounter = aCDOTransaction.GetAsEncounter
  if not aEncounter is nothing then
    set aContacts = aEncounter.Contacts 
    aMessage = aMessage & "  Encounter information:" & vbNewLine
    for j = 0 to aContacts.Count - 1
      set aContact = aContacts.Item(j)
      aMessage = aMessage & " - " & aContact.DiagnosisDescription & vbNewLine
    next 'j    
  end if  
next 'i    

Profile.MsgBox(aMessage)
Note:

In Profile Client v8 on User Interface Encounters can be found in Clinical > Medical Record > Results.

Version information

Added in v7.8.0