ISPatient.EncountersByCase

Description

This function returns all encounters by the selected case ID of the patient.

Syntax

object.EncountersByCase(CaseID)

Part Attribute Type Description
object Required
The object always implements the ISPatient interface
CaseID In, Required
int
ID of the patient's case

Return Value

ISPatientEncounters

Returns all encounters by the selected case ID of the patient.

Example

Display the number and the date of encounters by the selected case ID of the patient.

Dim aPatient  
Dim aEncountersByCase
Dim aEncounterByCase
Dim aFilter
Dim aCases
Dim aFirstCase
Dim aCaseID
Dim aMessage

Set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateCasesFilter
aFilter.PatientId = aPatient.ID
set aCases = Profile.LoadCases(aFilter) 

if aCases.Count = 0 then
  Profile.MsgBox("No cases!")
else   
  set aFirstCase = aCases.Item(0)
  aCaseID = aFirstCase.ID 
  set aEncountersByCase = aPatient.EncountersByCase(aCaseID)
  aMessage = "Encounters by this case = " & aEncountersByCase.All.Count
    
  for i = 0 to aEncountersByCase.All.Count - 1
    set aEncounterByCase = aEncountersByCase.All.Item(i)
    aMessage = aMessage & vbNewLine
    aMessage = aMessage & aEncounterByCase.Date 
  next
  
  Profile.MsgBox(aMessage)
    
end if  
Note:

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

Version information

Added in v7.8.0