Appointment Scheduling Process API - Implementation Template
Developer guide
The criteria for invoking either or both of the system APIs is defined by each resource implemented:
- Slot —
GET
by ID – Requests must be passed to/Appointment/{sourceSystem}/{id}
, wheresourceSystem
is either "Epic" or "Cerner" to fetch appointment by Id.Search
– Requests with parameters such as location, service-type, appointment_type, and date ranges can be sent as parameters to the URL/Slot
or/Slot/_search
for fetching available slots in both EMRs.POST
method – Requires parameters to be passed as a URL-encoded payload to/Slot
or/Slot/_search
to filter responses on downstream system APIs.
- Appointment —
GET
By ID (Multiple EMR) – If a A URI parameter is passed to/Appointment/{sourceSystem}/{id}
, the system API corresponding tosourceSystem
will be invoked to get Appointment by ID.GET
By ID (Single EMR) – If a URI parameter is passed to/Appointment/{id}
, the request is routed to the primary system API as defined in theconfig-{env}.yaml
file.POST
method – Requests with "Appointment Create/Cancel" body to/Appointment/{sourceSystem}
are routed to system API based onsourceSystem
.
Following DataWeave modules to be used in Appointment Scheduling(Search,Get,Create,Cancel) and Slot(Get and Search)
Module | Description |
---|---|
cerner-error-mapping | Generate error message for Cerner Include the request URL and the value cerner |
epic-error-mapping | Generate error message for Epic Include the request URL and the value epic |
filter_slot_search_form | Generate Slot Search Post Body with updated parameters Parameters include: |
noSourceMatch | Generate error response when primary is not configured and request is routed to /Resource without sourceSystem |
cerner-error-mapping
Generate error message for Cerner
Include the request URL and the value cerner
epic-error-mapping
Generate error message for Epic
Include the request URL and the value epic
filter_slot_search_form
Generate Slot Search Post Body with updated parameters
Parameters include:
Functions
fun filterBySource
( value, filterBy, sourceList)
param
value
string to be filtered
paramfilterBy
string to be used for filtering
paramsourceList
is list of sources defined in config-{env}.yamlFilters string to return only matched values Calls helper functions checkSourceinValue and removeString Assumes input string is a comma separated string with multiple values
fun checkSourceinValue
( value, sourceList)
param
value
string to be checked for sources
paramsourceList
is list of sources defined in config-{env}.yamlFunction to check if input string contains one of the sources identified in config-{env}.yaml's defined sources
fun mapStartDates
( startArray)
Generates start dates for Slot Search using payload.start, which is a repeating element
noSourceMatch
Generate error response when primary is not configured
and request is routed to /Resource without sourceSystem