Appointment Scheduling Process API - Implementation Template

(0 reviews)

Developer guide

Appointment Scheduling Dev Guide

The Appointment Scheduling Process API application uses the following DataWeave modules to be used in Appointment Scheduling(Search,Get,Create,Cancel) and Slot(Get and Search)

ModuleDescription
cerner-error-mappingGenerate error message for Cerner Include the request URL and the value cerner
epic-error-mappingGenerate error message for Epic Include the request URL and the value epic
filter_slot_search_formGenerate Slot Search Post Body with updated parameters The parameter names from HealthCloud are not compatible with Cerner This code updates the parameter names and sends only those parameters that are either prefixed with sourceor do not contain any mention of a source to each individual source Map from input request
WorkflowFHIRToolsWorkflowFHIRTools DataWeave library contains functions used for converting from FHIR STU3 to R4 format used in Appointment $find and Appointment $book resources of EPIC

cerner-error-mapping

Generate error message for Cerner
Include the request URL and the value cerner

Source: .src/main/resources/dw/ApptScheduling/cerner-error-mapping.dwl

(back to top)

epic-error-mapping

Generate error message for Epic
Include the request URL and the value epic

Source: .src/main/resources/dw/ApptScheduling/epic-error-mapping.dwl

(back to top)

filter_slot_search_form

Generate Slot Search Post Body with updated parameters
The parameter names from HealthCloud are not compatible with Cerner
This code updates the parameter names and sends only those parameters that are either prefixed with
source| or do not contain any mention of a source to each individual source
Map from input request

Source: .src/main/resources/dw/ApptScheduling/filter_slot_search_form.dwl

Functions

fun filterBySource (value, filterBy, sourceList)

Filters string to return only matched values Calls helper functions checkSourceinValue and removeString Assumes input string is a comma separated string with multiple values

param value string to be filtered
param filterBy string to be used for filtering
param sourceList is list of sources defined in config-{env}.yaml

fun checkSourceinValue (value, sourceList)

Function to check if input string contains one of the sources identified in config-{env}.yaml's defined sources

param value string to be checked for sources
param sourceList is list of sources defined in config-{env}.yaml

fun mapStartDates (startArray)

Generates start dates for Slot Search using payload.start, which is a repeating element

(back to top)

WorkflowFHIRTools

WorkflowFHIRTools DataWeave library contains functions used for converting from FHIR STU3 to R4 format
used in Appointment $find and Appointment $book resources of EPIC

Source: .src/main/resources/dw/Workflow/WorkflowFHIRTools.dwl

Functions

fun mapSlots (slotResoure, filterCount, requestUrl)

Generate slots from Appointment find response

param slotResponse is the Appointment $find response's entry resource
param requestUrl is the url to the resource
param filterCount is the number of records to return response is an array of Slots

fun mapSchedules (scheduleResource, filterCount, requestUrl, serviceTypeCode, Location, Practitioner, hostName)

Generate Schedules from Appointment find response

param scheduleResponse is the Appointment $find response's entry resource
param requestUrl is the url to the resource
param filterCount is the number of records to return Replace fullUrl for actor with just the type of actor Replace serviceTypeCode with serviceTypeCode from input, due to Health Cloud limitations Uncomment and use the actual serviceTypeCode for regular use case Remove parameters serviceTypeCode, Practitioner and Location from the function definition to use values from Epic response is an array of Schedules

fun getSlotResponse (slotPayload, filterCount, requestUrl, include, serviceTypeCode, Location, Practitioner, hostName)

Generates the FHIR response with the provided Appointment find STU3 response from EPIC.

param slot is the find object to map.
param filterCount is the number of records to return
param requestUrl is the url to the resource
return A FHIR R4 formatted Slot object. Map AppointmentId as Slot ID("id") in response. Health Cloud will use the Slot Id to book appointments Remove parameters serviceTypeCode, Practitioner and Location from the function definition to use values from Epic

fun getAppointmentResponse (appointments)

Generate Appointment Search response from Appointment $find response Add identifier to the response from Appointment $find to identify source

param slot is the find object to map.
param sysUrl is the system url for the resource
param sourcePrefix is a property from config file identifying source
return A FHIR R4 formatted Slot object.

fun bookAppointmentRequest (patientId, appointmentId, appointmentNote)

Generates the FHIR STU3 Appointment Book request with the provided PatientID,AppointmentID and AppointmentNote to book an appointment.

return A FHIR STU3 formatted Appointment Book object.

fun setAppointmentParams (appointment)

Set variable appointment with the required parameters for Appointment $book. Variable type: Object, used in bookAppointmentRequest.

param appointment is the input request for booking an appointment
return Returns an Appointment $book object for booking an appointment

fun appointmentBookResponse (appointmentBookResp)

Generates the FHIR R4 Appointment Book response using FHIR STU3 response from Epic

param appointmentBookResp is the response from Epic
return A FHIR R4 formatted Appointment Book Response object.

(back to top)


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onOct 24, 2024
Asset overview

Asset versions for 1.1.x

Asset versions
VersionActions
1.1.1
1.1.0