Newer Version Available
AppointmentBookingInterop Interface
Namespace
Usage
Managing appointments from Health Cloud requires identifying the source system's time slot support; implementing the Health Cloud global AppointmentBookingInterop interface; transforming the input request to fit the source electronic health records (EHR) system; routing the request to the EHR system; and getting the appointment information back from an external appointment booking system.
The external appointment management system is commonly part of a larger electronic health records (EHR) system. The integration between Health Cloud and the EHR can be direct or via integration middleware such as Mulesoft.
The OrgPermissions.HealthCloud permission must be enabled in your Salesforce org to access the Health Cloud AppointmentBookingInterop interface and its methods.
You can use the default implementation AppointmentBookingInteropFhirAdapter provided by Health Cloud to make a call out to an external scheduling system of truth for appointment availability and booking. All communications with the external system use the FHIR 4 standard.
If implementing the default Health Cloud global interface isn’t right for your context, you can provide your own Apex class and integrate with your appointment management system in your own way. An ISV or a Salesforce partner with a Health Cloud license can distribute customized Apex code to your organization using packages.
To include more data in the response or change the structure of the response, create a custom version of the findSlots method. Your custom method can prepare the data in the response or map data to the list of time slots expected. Your custom method must use the same signature as the original method. After you create your custom findSlots method, incorporate it into a custom implementation of the AppointmentBookingInterop interface.
To have Intelligent Appointment Manager use your custom implementation of the AppointmentBookingInterop interface, update the active version of your Intelligent Appointment Management Configuration. From Setup, in the Intelligent Appointment Management Configuration, for Apex Class, enter your custom Apex class. If left blank, Intelligent Appointment Manager uses the default Apex class.
Use Salesforce platform Named Credentials to configure the class name and authentication for Apex callouts. Then, map the Name Credential name in the AppointmentBookingConfig setup object. The Apex delegator class uses the setup object to invoke the corresponding implementation between the default implementation or your own provided Apex implementation. See Named Credentials as Callout Endpoints in the Apex Developer Guide.
AppointmentBookingInterop Methods
The following are methods for AppointmentBookingInterop.
bookAppointment(var1)
Signature
public healthcloudext.BookAppointmentResponse bookAppointment(healthcloudext.BookAppointmentRequest var1)
Parameters
- var1
- Type: healthcloudext.BookAppointmentRequest
Return Value
cancelAppointment(var1)
Signature
public healthcloudext.CancelAppointmentResponse cancelAppointment(healthcloudext.CancelAppointmentRequest var1)
Parameters
- var1
- Type: healthcloudext.CancelAppointmentRequest
Return Value
findSlots(var1)
The findSlots method accepts FindSlotsRequest as a parameter. The FindSlotsRequest class extends the AppointmentBase class and inherits its properties, including details about the care provider such as code sets, identifiers, and the source system used for scheduling.
Signature
public Map<String,List<healthcloudext.Slot>> findSlots(healthcloudext.FindSlotsRequest var1)
Parameters
- var1
- Type: healthcloudext.FindSlotsRequest
Return Value
Type: Map<String,List<healthcloudext.Slot>>
getSlotStatus(var1)
Signature
public healthcloudext.Slot getSlotStatus(healthcloudext.GetSlotStatusRequest var1)
Parameters
- var1
- Type: healthcloudext.GetSlotStatusRequest
Return Value
Type: healthcloudext.Slot
AppointmentBookingInterop Example Implementation
1global class AppointmentBookingInteropFhirAdapter implement healthcloudext.AppointmentBookingInterop{
2 static final String DEFAULT_ERROR_MESSAGE = 'Error during callout to the external system';
3 static final String DEFAULT_ERROR_CODE = '500';
4
5 /*
6 @Method Name: findSlots
7 @Param: request Type: healthcloudext.FindSlotsRequest
8 @Desc: FindSlot implementation
9 */
10 global Map<String,List<Slot>> findSlots(FindSlotsRequest request)
11
12 /*
13 @Method Name: bookAppointment
14 @Param: request Type: healthcloudext.BookAppointmentRequest
15 @Desc: Book Appointment implementation
16 */
17 global BookAppointmentResponse bookAppointment(BookAppointmentRequest request)
18
19 /*
20 @Method Name: getSlotStatus
21 @Param: request Type: healthcloudext.GetSlotStatusRequest
22 @Desc: getSlotStatus implementation
23 */
24 global Slot getSlotStatus(GetSlotStatusRequest request)
25
26 /*
27 @Method Name: cancelAppointment
28 @Param: request Type: healthcloudext.CancelAppointmentRequest
29 @Desc: Cancel Appointment implementation
30 */
31 global CancelAppointmentResponse cancelAppointment(CancelAppointmentRequest request)
32}