Epic Workflow System API - Implementation Template
Developer guide
The Epic application uses the following DataWeave modules to map between FHIR R4 and FHIR STU3 formats.
Module | Description |
---|---|
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 |
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
paramrequestUrl
is the url to the resource
paramfilterCount
is the number of records to return response is an array of Slots
fun mapSchedules (scheduleResource, filterCount, requestUrl, serviceTypeCode, Location, Practitioner)
Generate Schedules from Appointment find response
param
scheduleResponse
is the Appointment $find response's entry resource
paramrequestUrl
is the url to the resource
paramfilterCount
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)
Generates the FHIR response with the provided Appointment find STU3 response from EPIC.
param
slot
is the find object to map.
paramfilterCount
is the number of records to return
paramrequestUrl
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.
paramsysUrl
is the system url for the resource
paramsourcePrefix
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.