You can use queries for synchronous requests, which include the REQUEST or RESPOND types of API actions. You’d do this when querying for data from your connection or responding with data to your connection’s query. Either way, the system that requests data waits for a response from the destination the query is sent to.
Like everything else in life, some requests work out and others don’t. We’re happy to let you know the fate of your request either way, and we have some details about each scenario below.
For queries, you receive one response with two parts: The HTTP status code from Redox and the results of your query from the destination system.
There are three scenarios for synchronous responses.
Best case scenario: Redox successfully processes and delivers your query to the intended destination, and the destination successfully accepts the request and returns results.
If so, you receive a 200 OK status from Redox. The response body contains the requested data from the destination system. The fields and values present are specific to the data model or FHIR® resource you sent.
Occasionally, Redox successfully processes and delivers your request, but an error occurs within the destination system, so it fails to accept the query.
If this happens, you still receive a 200 OK status from Redox, but the body of the response contains an array populated with error data:
Data | Notes |
---|---|
Meta.Errors[] array | This array is present for Redox Data Model API responses. It contains the details for any errors. At a minimum, a Text field from Redox provides the error message details. |
Issues[] array | This array is present for Redox FHIR® API responses. It contains the details for any errors. |
DestinationStatusCode | If present in one of the above arrays, this field comes from the destination system. It contains the failure status code as defined by the destination system. |
Details | If present in one of the above arrays, this field comes from the destination system. It contains information about the error as defined by the destination system. |
Worst case scenario: Sometimes, your query fails within Redox, which means we fail to process and deliver it to the intended destination.
If the error occurs within Redox, you may receive a 4XX or 5XX HTTP status. Review HTTP errors.
When you receive a synchronous query from your connection, we wait for you to send back a response with the results of their request. Then, we return it to your connection in the format indicated in their request.
When you successfully receive a query from your connection, you should send back a 200 OK status with a response type that matches the query request.
Here’s an example: The destination’s EHR system triggers an alert when a provider wants to order a new medication for a patient. But the provider wants to review the patient’s data before deciding on a specific medication. So, the EHR system sends a ClinicalDecisionsSupport request for more data. Your system successfully processes the request and aggregates results with the relevant data. You respond to Redox with a 200 OK status and the ClinicalDecisionsSupport.Response data model.
That’s the kind of response everyone hopes for.
However, failures can’t always be avoided. There are two scenarios for failed deliveries to your system.
If we don’t hear back from you after a couple of minutes, the original request times out. We let the source system (i.e., your connection who sent the query) know that their request wasn’t received. The source system can then retry sending if they want.
If an error occurs in your system that prevents you from successfully receiving the synchronous request from us, your system should send back the relevant 4XX or 5XX HTTP status code and a response with the relevant data populated:
Data | Notes |
---|---|
Meta.Errors[] array | This array can be added to Redox Data Model API responses. It should contain details about any errors in your system. At a minimum, a Text field should provide the error message details. |
Issues[] array | This array can be added to Redox FHIR® API responses. It should contain details about any errors in your system. |
DestinationStatusCode | Provide the failure status code as defined by your system. |
Details | Provide the error as defined by your system. |
We send the failed status code and the response with the errors back to your connection so they can review the log details.