On this page:

17.1FHIR Gateway Configuration

 

The FHIR Gateway uses a JSON document to describe the specific functionality required. Configuration for the gateway consists of the following basic units:

  • Targets are internal FHIR servers that will ultimately process the requests received by the gateway

  • Routes are rules that govern which target or targets a request should be forwarded to

This configuration uses the GatewayConfiguration model. An example is shown below.

{
  "targets" : [ {
    "id" : "target1",
    "baseUrl" : "http://fhir1.example.com/api",
    "resourceIdPrefix" : "TGT1-"
  }, {
    "id" : "target2",
    "baseUrl" : "http://fhir2.example.com/api",
    "resourceIdPrefix" : "TGT2-"
  } ],
  "searchRoutes" : [ {
    "id" : "route1",
    "resourceTypes" : [ "Observation", "Patient", "Encounter" ],
    "targets" : [ {
      "targetId" : "target1"
    }, {
      "targetId" : "target2"
    } ],
    "parallel" : true
  } ]
}

17.1.1Defining Targets

 

The targets array in the gateway configuration uses the GatewayTarget model. It supports the following elements:

Element Required Description
id Yes An ID for this target. The ID must consist of only letters, numbers, and the characters ._-. The ID will appear in logs but is not visible to FHIR clients.
baseUrl Yes The base URL for the target FHIR server.
httpBasicCredentials No Supplies a username and password to be passed to the target server, in the form `username:password`. If credentials should be supplied dynamically (e.g. for OAuth2 support), credentials can instead be supplied using an interceptor.
connectTimeoutMillis
socketTimeoutMillis
No Sets the connect and socket timeout values to use when communicating between Smile CDR and the target server.
resourceIdPrefix No If this is supplied, resources from this target will have the given prefix applied to their IDs. This is useful for cases where two target servers are present, and there is a possibility of conflicting IDs (e.g. if both servers can potentially supply a resource with ID Patient/123).

If prefixes are used, all targets should have a prefix defined, and the prefixes should be short and conformant to the FHIR resource ID rules.

17.1.2Defining Search Routes

 

The searchRoutes array in the gateway configuration uses the GatewaySearchRoute model. It supports the following elements:

Element Required Description
id Yes An ID for this route. The ID must consist of only letters, numbers, and the characters ._-. The ID will appear in logs but is not visible to FHIR clients.
resourceTypes Yes Contains a list of resource types (e.g. Patient) that this route applies so.
parallel No If parallel is set to true, the searches to each target server will be performed by the gateway in parallel. If parallel is set to false, the searches to each target server will be performed by the gateway in serial, in the order specified by the targets array.

In both cases, the call by the calling client will not return until all target calls have completed. If not specified, the gateway will perform backing calls sequentially.
targets Yes Supplies the list of targets that searches should be directed to.

17.1.3Defining Read Routes

 

The readRoutes array in the gateway configuration uses the GatewayReadRoute model. It supports the following elements:

Element Required Description
id Yes An ID for this route. The ID must consist of only letters, numbers, and the characters ._-. The ID will appear in logs but is not visible to FHIR clients.
resourceTypes Yes Contains a list of resource types (e.g. Patient) that this route applies so.
targets Yes Supplies the list of targets that reads should be directed to. A FHIR read will only be attempted against a single target, and the response (whether successful or unsuccessful) will be returned to the calling client. The target used will be the first target in the list which is able to handle the given request (a target will be skipped if it declares a resource ID prefix that is not present in the request).