ISProfilePatientGroup.PatientCount

Description

The number of the patient groups.

Syntax

object.PatientCount

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

Return Value

int

Example

Display the number of the patient groups and their names.

Sub main
  Dim aGroupName
  Dim aResult
  Dim aFilter
  Dim aPatientGroups
  Dim aPatient
  Dim aIsRemoved
  Dim aMessage

  aGroupName = "test"
  aResult = Profile.InputValue(aGroupName, "Enter Patient Group Name")

  if not aResult then exit sub

  Set aFilter = Profile.CreateProfilePatientGroupFilter
  aFilter.PatientGroupName = aGroupName
  aFilter.PatientGroupType = 1 'spgtStatic  
  set aPatientGroups = Profile.LoadProfilePatientGroupsByFilter(aFilter)

  if aPatientGroups.Count = 0 then
    Profile.MsgBox("There is no group with the specified name")
    exit sub
  end if

  for each aGroup in aPatientGroups 
    aMessage = aMessage & vbNewLine & GetGroupMembersInfo(aGroup) 
  next

  Profile.MsgBox(aMessage)
end sub 'main

'---------------

function GetGroupMembersInfo(aGroup)
  Dim aPatientId
  Dim aPatient
  Dim aInfo

  aInfo = "---------------" & vbNewLine & aGroup.Name &_
    vbNewLine & "---------------" & vbNewLine
  for i = 0 to aGroup.PatientCount - 1
    aPatientId = aGroup.PatientId(i) 
    set aPatient = Profile.PatientUtils.LoadPatientByID(aPatientId)
    aInfo = aInfo & vbNewLine & aPatient.SurnameFirstName 
  next      
  GetGroupMembersInfo = aInfo
end function 'GetGroupMembersInfo
Note:

In Profile Client v8 on User Interface Patient Groups can be found in Organisation > Work Centre > Clinical > Groups.

Version information

Added in v7.8.0