Skip to content
Reference

Adapter: FHIR REST API

Connect to FHIR R4 or R5 compliant servers.

On this page

Purpose

Read, search, create and update resources on any FHIR R4 (or R5) server. Use it for a FHIR server that has no vendor adapter of its own, and as the destination of HL7v2-to-FHIR workflows.

Auth

  • none, basic, bearer, oauth2 (client credentials), backend-services (SMART Backend Services with an RS384 client assertion) or gcp-workload-identity.
  • Tokens are cached and fetched again once after a 401.
  • It takes the shared connection options: a client certificate for mutual TLS, a private CA, a minimum TLS version and a proxy. They apply to its token requests too.

Settings

Auth is chosen with authType: none, basic, bearer, gcp-workload-identity, oauth2, backend-services. Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.

SettingTypeRequiredDefaultSecretDescription
baseUrlurlYesNoFHIR server base URL.
authTypeenum: none, basic, bearer, gcp-workload-identity, oauth2, backend-servicesYesNoAuthentication method. gcp-workload-identity: a token from the GKE metadata server (GCP Healthcare API). oauth2: client credentials. backend-services: SMART Backend Services (RS384 client assertion).
credentialsobjectNo
credentials.usernamestringNoNoUsed when authType is basic.
credentials.passwordstringNoYesUsed when authType is basic.
credentials.tokenstringNoYesUsed when authType is bearer.
credentials.clientIdstringNoNoUsed when authType is oauth2 or backend-services.
credentials.clientSecretstringNoYesUsed when authType is oauth2.
credentials.tokenUrlurlNoNoUsed when authType is oauth2 or backend-services.
credentials.privateKeyPEMstringNoYesUsed when authType is backend-services.
credentials.keyIdstringNoNoUsed when authType is backend-services.
credentials.scopesstringNoNoOAuth scopes (default: system/*.read system/*.write). Used when authType is oauth2 or backend-services.
headersmapNoYesAdditional HTTP headers.
timeoutnumberNoNoRequest timeout in milliseconds.
fhirVersionenum: R4, R5, autoNoautoNoFHIR version. "auto" detects from CapabilityStatement on first connection.
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).
proxyUrlurlNoNoHTTP(S) proxy, e.g. http://proxy.example.test:3128 (opens in a new tab). The proxy host must pass the SSRF rules (SSRF_ALLOWLIST for a private one).
proxyUsernamestringNoNoProxy user (Basic auth).
proxyPasswordstringNoYesProxy password.
noProxyarray of stringNoNoHosts sent direct, not through the proxy: a name (and its subdomains), .suffix, host:port or *.

Actions

A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.

ActionWhat it doesStep parametersKeys a message may supply
readRead a FHIR resource by ID.resourceType, idresourceType, id
searchSearch FHIR resources.resourceType, searchParams?, maxPages?searchParams
createCreate a new FHIR resource (conditional create with ifNoneExist).resource, ifNoneExist?None
updateUpdate an existing FHIR resource, or upsert one by search (conditional update).resource, conditionalUpdate?None

Minimal example

The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.

json
{
  "name": "FHIR REST API (example)",
  "adapterType": "fhir-rest",
  "config": {
    "baseUrl": "https://fhir-rest.example.test/base",
    "authType": "none"
  }
}

Limits

  • search follows next links for up to maxPages pages (1 to 50, default 1).
  • A create step's ifNoneExist is sent as If-None-Exist, so a resent message finds the resource it created the first time.
  • A resource id or type that comes from a message is checked before it reaches a URL, so it cannot leave the configured base.
  • The engine refuses a URL that resolves to a private address unless the host is in SSRF_ALLOWLIST (see Environment variables).

Reference