ISProfilePatientGroup.DeletePatientId

Description

This function removes the patient with the specified ID from the group.

Syntax

object.DeletePatientId(aId)

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

Return Value

bool

Returns true if the patient was removed from the group successfully.

Example

Remove the patient from the groups and display the result of this operation.

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

Set aPatient = Profile.SelectPatient
for each aGroup in aPatientGroups 
  aIsRemoved = aGroup.DeletePatientId(aPatient.ID)
  if aIsRemoved then
    aMessage = aMessage & "The patient " & aPatient.SurnameFirstName &_
      " was removed from the group " & aGroup.Name
  else
    aMessage = aMessage & "The patient " & aPatient.SurnameFirstName &_
      " was NOT removed from 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