ISAppointmentServices.ById

Description

This property returns the appointment service by the selected ID.

Syntax

object.ById(aServiceID)

Part Attribute Type Description
object Required
The object always implements the ISAppointmentServices interface
aServiceID In, Required
int
ID of the service
Restriction: This property is readonly.

Return Value

ISAppointmentService

Returns the appointment service by the selected ID.

Example

Display the appointment service by the selected ID.

Dim aPatient
Dim aProvider
Dim aFilter 
Dim aAppointments
Dim aFirstAppointment
Dim aAppointmentServices
Dim aFirstAppServiceId
Dim aMyAppService

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)

if aAppointments.Count > 0 then

  set aFirstAppointment = aAppointments.Item(0)
  set aAppointmentServices = aFirstAppointment.Services
  
  if aAppointmentServices.Count = 0 then
    Profile.MsgBox("No Services!")
  else
    aFirstAppServiceId = aAppointmentServices.Item(0).Id
    set aMyAppService = aAppointmentServices.ById(aFirstAppServiceId)
    Profile.MsgBox("First App Service Id = " & aFirstAppServiceId &_
      " My App Service Id = " &  aMyAppService.Id)   
  end if

end if  
Note:

In Profile Client v8 on User Interface Appointment Service can be found in Appointment Window > Services.

Version information

Added in v8.1.0