ISProfilePatientGroup.AddPatientId

Description

This function adds the patient with the specified ID to the group.

Syntax

object.AddPatientId(aId)

Part Attribute Type Description
object Required
The object always implements the ISProfilePatientGroup interface
aId In, Required
int
ID of the added patient

Return Value

bool

Returns True if the patient was added to the group successfully.

Example

Add the selected patient to the group and display the result of this operation.

Dim aGroupName
Dim aResult
Dim aFilter
Dim aGroup
Dim aGroups
Dim aIsAdded
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

Set aPatient = Profile.SelectPatient
for each aGroup in aPatientGroups 
  aIsAdded = aGroup.AddPatientId(aPatient.ID)
  if aIsAdded then
    aMessage = aMessage & "The patient " & aPatient.SurnameFirstName &_
      " was added to the group " & aGroup.Name
  else
    aMessage = aMessage & "The patient " & aPatient.SurnameFirstName &_
      " was NOT added to the group " & aGroup.Name
  end if 
next

Profile.MsgBox(aMessage)
Note:

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

Version information

Added in v7.9.1