ISAppointment.SetDeleted

Description

This function deletes the appointment.

Syntax

object.SetDeleted

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

Example

Delete the first appointment of the selected patient.

Dim aPatient
Dim aProvider
Dim aFilter 
Dim aAppointments
Dim aFirstAppointment
Dim aDeletedApp
Dim aDeletedAppId

Set aPatient = Profile.SelectPatient
set aProvider = Profile.LoadProvider("PROV")
set aFilter = Profile.CreateAppointmentFilter

aFilter.ProviderID = aProvider.Id
aFilter.PatientId = aPatient.Id
aFilter.DateFrom = #01/01/2018#
aFilter.DateTo = #01/01/2019#

set aAppointments = Profile.LoadAppointments(aFilter)
Profile.MsgBox("App Count = " & aAppointments.Count)
if aAppointments.Count > 0 then
  set aFirstAppointment = aAppointments.Item(0)
  aDeletedAppId = aFirstAppointment.Id
  Profile.MsgBox(aFirstAppointment.IsDeleted)   
  aFirstAppointment.SetDeleted
  aFirstAppointment.Save
end if

set aAppointments = Profile.LoadAppointments(aFilter)
Profile.MsgBox("App Count = " & aAppointments.Count)

set aDeletedApp = Profile.LoadAppointment(aDeletedAppId)

Profile.MsgBox(aDeletedApp.IsDeleted)  
Note:

In Profile Client v8 on User Interface Appointments can be found and deleted in Appointment Window > Bookingor Patient > Alter Patient > Bookings.

Version information

Added in v7.8.0