ISProfilePatientGroup.Delete

Description

This function deletes the patient group.

Syntax

object.Delete

Part Attribute Type Description
object Required
The object always implements the ISProfilePatientGroup interface

Example

Display the patient groups before and after deleting.

sub main
  Dim aFilter
  Dim aPatientGroups, aPatientGroup
  Dim aTrans
  Dim aMessage

  Set aFilter = Profile.CreateProfilePatientGroupFilter
  aFilter.PatientGroupType = 3 'spgtAll   
  aFilter.PatientGroupName = "test1"
  aFilter.PatientGroupNameCompareOperation = 1 'sfcoEqual 
  
  set aTrans = Profile.StartMapTransaction
    
  set aPatientGroups = Profile.LoadProfilePatientGroupsByFilter(aFilter)
  aMessage = "The patient group before deleting: " & vbNewLine & GetPatientsGroupsAsList(aPatientGroups)

  for i = 0 to aPatientGroups.Count - 1
    set aPatientGroup = aPatientGroups.Item(i)
    aPatientGroup.Delete
  next

  aTrans.SnapShot

  set aPatientGroups = Profile.LoadProfilePatientGroupsByFilter(aFilter)

  aMessage = aMessage & vbNewLine & vbNewLine &_
     "The patient group after deleting: " & vbNewLine & GetPatientsGroupsAsList(aPatientGroups)

  Profile.MsgBox(aMessage)
end sub


function GetPatientsGroupsAsList(aPatientGroups)
  Dim aMessage
  Dim aPatientGroup
  
  aMessage = "Patient Groups Count: "  & aPatientGroups.Count  
  for i = 0 to aPatientGroups.Count - 1 
    set aPatientGroup = aPatientGroups.Item(i)
    aMessage = aMessage & vbNewLine & (i + 1) & ") " & aPatientGroup.Name
  next 

  GetPatientsGroupsAsList = aMessage
end function      
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