Skip to main content

FHIR & Interoperability

Tietai stores clinical data in its own FHIR server (tietai-fhir-service). This page describes what that server does, how to call it, and how far the other standards around it (HL7 v2, DICOM, X12, IHE) are built.

FHIR versions​

The server serves FHIR R4 (4.0.1) and FHIR R5 (5.0.0) from one dataset. A client on either endpoint sees all of the organization's data. Resources written in the other version are converted when they are read (the setting components.fhir.cross_version_read, on by default; switched off, each version sees only its own).

One dataset, two FHIR versions

PathVersion served
/fhir/...The configured default: R4, unless FHIR_DEFAULT_VERSION says otherwise
/fhir/R4/...Always R4
/fhir/R5/...Always R5

On the unversioned /fhir path you can pick the version with the fhirVersion media type parameter on Accept or Content-Type. It takes 4.0 or 5.0 (not 4.0.1). Naming a version the server does not implement (R4B, STU3, R6) returns 406 with an OperationOutcome. Naming a different version than the path (for example fhirVersion=5.0 on /fhir/R4) is also a 406. Every response states its version in Content-Type, for example application/fhir+json; fhirVersion=5.0.

Reading a resource type that belongs only to the other version returns 404 with an OperationOutcome that names the endpoint that has it. R5 DeviceUsage and R4 DeviceUseStatement are treated as the same record, as are RequestOrchestration and RequestGroup.

Conversion never silently drops data. An element the target version cannot express is kept in an extension with the URL http://tiet.ai/fhir/StructureDefinition/unconverted-element.

note

The Connect HL7 gateway is a different product. Its capability matrix lists FHIR R5 as "N/A" and describes FHIR R4 only. This page describes the FHIR server.

Calling the API​

Base path and authentication​

Through the API gateway, the FHIR server is mounted at /api/v1/fhir/. The gateway maps /api/v1/fhir/<resource> to the server's /fhir/<resource> route. The development environment host is https://api-hip-dev.tiet.ai.

  • Send your access token as Authorization: Bearer <token>.
  • The gateway sets X-Organization-ID from your token, so you do not send it yourself. When you call the FHIR service directly (inside the cluster or on its VM), you must send X-Organization-ID and a gateway assertion. A mismatch between the header and the attested organization is rejected.
  • There is no organization id in the URL path.
BASE=https://api-hip-dev.tiet.ai/api/v1/fhir
TOKEN=<your access token>

# What versions does the server speak?
curl -H "Authorization: Bearer $TOKEN" "$BASE/\$versions"

Expected response:

{
"resourceType": "Parameters",
"parameter": [
{ "name": "version", "valueString": "4.0" },
{ "name": "version", "valueString": "5.0" },
{ "name": "default", "valueString": "4.0" }
]
}
# Capability statement, one per version
curl -H "Authorization: Bearer $TOKEN" "$BASE/R5/metadata"

# Create, read, search
curl -X POST "$BASE/R4/Patient" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/fhir+json" \
-d '{"resourceType":"Patient","name":[{"family":"Patient","given":["Test"]}],"gender":"female","birthDate":"1980-01-01"}'

curl -H "Authorization: Bearer $TOKEN" "$BASE/R4/Patient/<id>"
curl -H "Authorization: Bearer $TOKEN" "$BASE/R4/Patient?name:contains=Test&_count=10"

# Read the same patient as R5
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/fhir+json; fhirVersion=5.0" "$BASE/Patient/<id>"

Interactions​

For any resource type in the version's registry the server provides:

InteractionRequest
CreatePOST /fhir/{type}
ReadGET /fhir/{type}/{id}
UpdatePUT /fhir/{type}/{id}
DeleteDELETE /fhir/{type}/{id}
SearchGET /fhir/{type}?...
History, version readGET /fhir/{type}/{id}/_history, .../_history/{vid}
Transaction or batchPOST /fhir with a Bundle of type transaction or batch
Capability statementGET /fhir/metadata (also under /R4, /R5)
ValidatePOST /fhir/{type}/$validate, POST /fhir/$validate (bundle), GET /fhir/$validate-profiles
Supported versionsGET /fhir/$versions

A transaction bundle is all-or-nothing. A batch bundle runs each entry on its own and reports a response per entry. Conditional create is available inside bundles through the entry's request.ifNoneExist search query, and request.ifMatch carries a version id. The standalone If-None-Exist header is not handled by the resource endpoints. PUT does honour If-Match (W/"<version>" or *): a stale version returns 412.

A POST /$sql endpoint exists but is off unless FHIR_SQL_ENDPOINT_ENABLED=true (components.fhir.sql_endpoint_enabled), because it has no tenant isolation. Do not expect it on a shared environment.

Search parameters are defined per resource type. Modifiers :exact and :contains apply to string parameters, and date parameters accept the prefixes eq, ne, gt, lt, ge, le, sa, eb, ap.

ParameterBehaviour
_countPage size. Default 20, capped at 1000
_offsetSkip this many results; next links are generated
_sortSupported (prefix - for descending)
_idFilters. A list of more than 1000 ids is rejected
_lastUpdated, _contentFilter
_includeSupported. Included resources are read through the same organization scope
_revincludeSupported as _revinclude=Target:param (for example Observation:subject on a Patient search), only for reference parameters that declare the searched type as a target. One search adds at most 1000 resources (components.fhir.revinclude_max, env FHIR_REVINCLUDE_MAX) and the response says when it was truncated. :iterate and unknown or malformed values are ignored with a warning
_elements, _containedNot implemented. They are ignored, so you get fewer results than a full FHIR server would return, never more
_summary, _total, _format, _prettyAccepted as result controls

An unrecognised search parameter returns an error instead of being ignored, so a typo cannot widen a search.

Bulk export​

The server implements asynchronous bulk export. Kick-off is GET only.

Bulk export sequence

  1. Start the export. The Prefer header must be exactly respond-async (the server compares the whole value, so extra tokens such as respond-async, return=minimal are rejected); without it the server returns 400 (Prefer header must be 'respond-async' for bulk data export). Accept must be application/fhir+ndjson, */* or absent.

    curl -i "$BASE/\$export?_type=Patient,Condition&_since=2026-01-01T00:00:00Z" \
    -H "Authorization: Bearer $TOKEN" \
    -H "Prefer: respond-async" -H "Accept: application/fhir+ndjson"

    The response is 202 Accepted with a Content-Location header holding the status URL.

  2. Poll the status URL (GET /fhir/bulkdata/status/{id}). It returns 202 with X-Progress while the job is pending or running, and 200 with a manifest when finished. A failed job returns 500 with Export failed: ....

  3. Download each file in the manifest's output list ({type, url, count}) with GET /fhir/bulkdata/download/{exportId}/{Type}.ndjson. Download also needs the organization header.

  4. Optionally DELETE /fhir/bulkdata/status/{id}. It returns 202 and removes the files of a completed export; another organization's export returns 403.

OptionBehaviour
EndpointsGET /fhir/$export (system) and GET /fhir/Patient/$export (patient level)
_typeComma-separated resource types
_sinceRFC 3339 timestamp, applied as _lastUpdated >= value. A bad value returns 400 Invalid _since parameter
No _typeEvery resource type that has data for your organization. Patient-level export is limited to the Patient compartment types
Not found in code_typeFilter, _outputFormat, Group export

Types with no matching resources produce no file. The files are written to the server's export directory (components.fhir.bulk_export.output_dir, default /tmp/fhir-bulkdata; export can be switched off with BULK_EXPORT_ENABLED=false).

In the product​

In the web app, Tiet · Govern → FHIR Server has four entries: Explorer, Editor, Patients and Server. See Manage patients for the patient views.

  • Explorer browses resources by type and shows a resource as Rendered, JSON, References or History. Resources also have a Search view, a Validate view and a References view under the same area.
  • Editor creates and updates resources from templates, a form (for supported types) or JSON.
  • Server has three tabs: Server (the capability statement, structured or raw JSON), Bulk Data (Import and Export; export has Resource Type, Changed Since, Start Bulk Export and Check Status) and Bundles.

The Bulk Data export starts a system-level $export for one resource type from the dropdown. Import takes pasted or uploaded JSON or NDJSON and creates each resource one by one with a create request.

Other standards around FHIR​

These interoperability capabilities span Tiet · Connect and workflow nodes. The table retains the standards availability updates summarized in Capability status. X12 GA covers parsing and workflow nodes; agree a file or API transport with the source system, because there is no dedicated X12 Connect connector. The FHIR server's own limits are described below.

StandardStatus
HL7 v2 parsing, ADT A01/A03/A08, ORU^R01, ORA^R41GA
HL7 v2 ORM, SIU, VXU, BAR, pharmacyGA
MLLP listener and clientGA
HL7 v2 to FHIR transformGA. The hl7-to-fhir node maps ADT (Patient, Encounter), ORM/OMG (Patient, ServiceRequest) and ORU (Observation, DiagnosticReport). Other types use a best-effort PID/OBX fallback
FHIR R4 JavaScript transforms, CapabilityStatement, OperationOutcome on errorsGA
FHIR R4 structural validationGA
FHIR R4 Touchstone certificationGA
DICOMweb (QIDO-RS, WADO-RS, STOW-RS)GA. The DICOM service proxies QIDO-RS and WADO-RS only
DICOM C-STORE, C-FIND, C-MOVE, C-ECHO (DIMSE)GA
X12 837 claimsGA
X12 835, 270/271, 276/277, 278, 834, 820GA
IHE PCD (device data)GA
IHE XDS.b and MHD (CDA to MHD bridge)GA
IHE ATNA auditGA
IHE PIXm, PDQmGA

In the FHIR server itself, IHE support is limited to validation of MHD ITI-65 document bundles (only when the bundle declares the MHD profile) and a PDQm result limit. There are no MHD find or retrieve operations and no PIXm or PDQm endpoints.

Limits​

  • No _elements, _contained or _revinclude:iterate.
  • Bulk export is GET only, with _type and _since as the only filters.
  • The standalone If-None-Exist header is not handled on resource endpoints; use bundle entries. If-Match is handled on PUT only.
  • No IPS (International Patient Summary) generation was found in the code.

Common errors​

ResponseCauseFix
400 Prefer header must be 'respond-async'...Missing Prefer on $exportAdd Prefer: respond-async
400 Accept header must include 'application/fhir+ndjson'Wrong Accept on $exportUse application/fhir+ndjson or */*
401 Missing X-Organization-ID headerCalling the service without the gatewayGo through /api/v1/fhir, or send the header
404 "... is not a resource type in FHIR R4; FHIR R5 defines it"Wrong version endpointUse the endpoint named in the message
406Unsupported or contradictory fhirVersionUse 4.0 or 5.0, matching the path

Something unclear? Send documentation feedback by email.