ISPatientEncounters.LastOf

Description

This function returns the specified number of the last patient's encounters with the selected disease for the specified number of the last days.

Syntax

object.LastOf(aItemCount, aDayCount, aDxCode, isNonNotes)

Part Attribute Type Description
object Required
The object always implements the ISPatientEncounters interface
aItemCount In, Required
int
The number of the last patient's encounters to return
aDayCount In, Required
int
The number of the last days the patient's encounters are being searched for
aDxCode In, Required
string
The disease code
isNonNotes In, Required
bool
Does not affect anything

Return Value

ISEncounters

Returns the specified number of the last patient's encounters with the selected disease for the specified number of the last days.

Example

Display the specified number of the last patient's encounters with the selected disease for the specified number of the last days, their dates and contacts.

Dim aPatient
Dim aItemCount
Dim aDayCount
Dim aDxCode
Dim isNonNotes
Dim aEncounters
Dim aEncounter
Dim aContact
Dim aMessage

Set aPatient = Profile.SelectPatient 
aItemCount = 7
aDayCount = 200
aDxCode = "DIAB"
isNonNotes = True
set aEncounters = aPatient.Encounters.LastOf(aItemCount, aDayCount, aDxCode, isNonNotes)

aMessage = "Encounters Count = " & aEncounters.Count

for i = 0 to aEncounters.Count - 1
  set aEncounter = aEncounters.Item(i)
  aMessage = aMessage & vbNewLine & aEncounter.date
  if aEncounter.Contacts.Count <> 0 then
    for each aContact in aEncounter.Contacts
      aMessage = aMessage & vbNewLine & "    -Contact Subject: " & aContact.Subject
    next
  end if  
next 
Profile.MsgBox(aMessage)    
Note:

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

Version information

Added in v7.8.0