Skip to main content

Alternative Workflow: Prefetch FHIR Data

In some cases, it may be more efficient for a client application which is requesting synchronous decision support from the InterSystems® Healthcare Action Engine to provide the HL7® FHIR® data necessary to evaluate a rule directly (instead of providing the Healthcare Action Engine access to the FHIR resource server, like in previous exercises).

This is possible because the response to a successful discovery call details the FHIR data required to evaluate each of the Healthcare Action Engine’s active rules. Using this information, a client application can prefetch the data required for a given rule from a FHIR resource server. Then, the client can provide this data as part of the service request which invokes that rule.

In the exercise on this page, the simulated client will execute a service call using data which was hypothetically prefetched from a FHIR resource server. Like the previous exercise, an OAuth 2.0 bearer token will provide authorization for the request to the service endpoint, in compliance with the CDS Hooks specification (https://cds-hooks.hl7.org/2.0/#trusting-cds-clientsOpens in a new tab). However, unlike the previous exercise, this call does not require that the client request an access token for the FHIR resource server.

Request 10. Acquire CDS Hooks Token for Prefetch Service Request

As with any CDS Hooks-compliant service request, a service request which includes prefetched data must include a bearer token which authorizes access to the service endpoint.

Acquire a token by executing the request 10. Acquire CDS Hooks Token for Prefetch Service Request from the Healthcare Action Engine Demo Walkthrough collection using the same procedure that you used to execute Request 7. Acquire CDS Hooks Token for Service. Note that unless you have made changes to your system, it is not necessary to modify any variables this time.

Also note that this request obtains a token authorizing access to the service endpoint for the demo rule EDSDemoAntiplateletForCAD, specifically.

When you have successfully executed this request, be sure to update the Current value of the collection variable hooksToken with the new value of access_token you receive in response.

Request 11. Prefetch Service Request

  1. Select the request 11. Prefetch Service Request from the collection. Note the following:

    • As with the previous CDS Hooks-compliant service request, the Authorization header for this request provides the bearer token to access this haeDemoRule2 endpoint.

    • The body of the service request does not include information to access the FHIR resource server. Instead, it includes the FHIR data necessary to evaluate the demo rule EDSDemoAntiplateletForCAD (as the prefetch object).

  2. Select Send.

If the request is successful, the body of the response contains a CDS Hooks card which describes the results of evaluating the prefetch sample patient data according to the demo rule EDSDemoAntiplateletForCAD. As depicted in the following screenshot, the card supplied in response to the example request warns the user of the client application that the patient associated with the given data has coronary artery disease and should therefore not be prescribed aspirin or clopidogrel:

Excerpt of card in response to request with prefetched data

FeedbackOpens in a new tab