ISProfilePatientGroup.PatientId

Description

ID of the patient in the selected group.

Syntax

object.PatientId(aIndex)

Part Attribute Type Description
object Required
The object always implements the ISProfilePatientGroup interface
aIndex In, Required
int
The index of the patient group
Restriction: This property is readonly.

Return Value

int

Example

Display the name of the patient in the selected group.

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