Unlike legacy FHIR® implementations of InterSystems products, which always used interoperability productions for data processing, a default FHIR server now processes incoming requests without a production, passing the requests directly to the server’s Service. However with a small modification, you can route the request through a business service in a production, and then configure the rest of the production to control what happens to the request. For example, if you still want the request to reach the FHIR server’s Service, you can use a pre-built business operation that forwards the request to the Service. However, if your goal is to forward the request to another system, you can route the request to a different business operation that communicates with the external system.
Regardless of what the interoperability production does with the incoming FHIR request, the process of routing the request to the business service begins with creating the endpoint for a FHIR server. This is true even if the FHIR request never reaches the FHIR server’s Service, as is the case when the production’s business operation forwards the request to an external system.
Using a FHIR Production
Setting up a FHIR implementation to route FHIR requests through an interoperability production is a two-step process:
Create an interoperability production and add a special business service.
After installing a FHIR server endpoint, configure the FHIR server’s ServiceConfigName option so it specifies the name of the business service that has been added to the interoperability production.
These steps can be taken in any order as long as, when the setup is complete, the name of the business service in the server’s configuration matches the name in the interoperability production.
Creating the Interoperability Production
When the Foundation namespace for the FHIR server endpoint was created, the installation process created an interoperability production that can be used as a FHIR production, but you can also create a new production for this purpose. What is important is that you add the required business service that the endpoint uses to route requests through the production.
Interoperability productions that receive FHIR requests from the REST handler must include a HS.FHIRServer.Interop.Service business service. You can give the business service a custom name, but make sure that name matches the one specified for the endpoint’s ServiceConfigName option. For basic information on creating a production and adding a business service, see First Look: Connecting Systems Using Interoperability Productions.
Configuring the FHIR Server Endpoint
After installing a FHIR server endpoint, the endpoint can be configured to use an interoperability production at anytime, including before the production has been created. Simply run the installation and configuration utility, and use the ServiceConfigName option to specify the full name of the production’s business service. Specifying the name of the business service does not automatically create the production or business service.
To configure an existing endpoint so FHIR requests are routed through a production:
From the InterSystems Terminal, change to the FHIR server’s namespace. For example:
set $namespace = "FHIRNamespace"Copy code to clipboard
Where FHIRNamepace is the name of the endpoint’s namespace.
Run the installation and configuration utility:
do ##class(HS.FHIRServer.ConsoleSetup).Setup()Copy code to clipboard
Choose option 3) Configure a FHIRServer Endpoint.
Choose the endpoint of the FHIR server that you are configuring.
When you get to the ServiceConfigName prompt, specify the name of the business service of the production through which FHIR requests will be routed. For example, if the business service does not have a custom name, specify HS.FHIRServer.Interop.Service.
Accept the remaining prompts.
The ServiceConfigName option can also be specified when creating a new endpoint.
Without using an interoperability production, a FHIR request goes directly from the REST handler to the FHIR server’s Service. However if you configure the endpoint to forward that request to a business service in an interoperability production, you need to add a built-in business operation that routes the request from the production to the Service if you want it processed by the FHIR server.
The HS.FHIRServer.Interop.Operation business operation takes the FHIR request from the business service or a business process within the FHIR production and forwards it to the FHIR server’s Service for processing. Once you have added this business operation to the production, set the Target Config Name setting of the business service or business process to specify the name of the business operation.
Responses from the Service are sent back to the HS.FHIRServer.Interop.Operation business operation on its way back to the business service, which returns it to the REST handler.
Forwarding FHIR Requests
Once the FHIR server’s endpoint is configured to forward a request to an interoperability production, the production controls what happens to that request. For example, you may not need the InterSystems product to act as a FHIR repository, but rather as a proxy server that forwards requests to external systems. In these cases, you would not use HS.FHIRServer.Interop.Operation as the production’s business operation, but rather forward the message to a pre-built or custom business operation that acted as a FHIR client by sending the FHIR data to an external FHIR endpoint.
Rather than develop a custom business operation, you can use a pre-built legacy business operation that takes FHIR data and sends it out to an external FHIR server. However, this business operation, HS.FHIR.REST.Operation, uses the legacy message classes, so your implementation would have to convert the new message classes to the legacy message classes before using HS.FHIR.REST.Operation. For more information about these legacy message classes, see FHIR Message Handling in InterSystems IRIS for Health or FHIR Message Handling in Health Connect.
The message class used to pass FHIR requests within the production is HS.FHIRServer.Interop.Request.
The message class used to pass a response from the FHIR server back through the production to the FHIR client is HS.FHIRServer.Interop.Response.
For information about accessing the FHIR payload of a request or response, see Accessing FHIR Payloads in Production-Based Implementations.