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).
| Path | Version 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.
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-IDfrom 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 sendX-Organization-IDand 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:
| Interaction | Request |
|---|---|
| Create | POST /fhir/{type} |
| Read | GET /fhir/{type}/{id} |
| Update | PUT /fhir/{type}/{id} |
| Delete | DELETE /fhir/{type}/{id} |
| Search | GET /fhir/{type}?... |
| History, version read | GET /fhir/{type}/{id}/_history, .../_history/{vid} |
| Transaction or batch | POST /fhir with a Bundle of type transaction or batch |
| Capability statement | GET /fhir/metadata (also under /R4, /R5) |
| Validate | POST /fhir/{type}/$validate, POST /fhir/$validate (bundle), GET /fhir/$validate-profiles |
| Supported versions | GET /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
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.
| Parameter | Behaviour |
|---|---|
_count | Page size. Default 20, capped at 1000 |
_offset | Skip this many results; next links are generated |
_sort | Supported (prefix - for descending) |
_id | Filters. A list of more than 1000 ids is rejected |
_lastUpdated, _content | Filter |
_include | Supported. Included resources are read through the same organization scope |
_revinclude | Supported 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, _contained | Not implemented. They are ignored, so you get fewer results than a full FHIR server would return, never more |
_summary, _total, _format, _pretty | Accepted 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.
-
Start the export. The
Preferheader must be exactlyrespond-async(the server compares the whole value, so extra tokens such asrespond-async, return=minimalare rejected); without it the server returns 400 (Prefer header must be 'respond-async' for bulk data export).Acceptmust beapplication/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 Acceptedwith aContent-Locationheader holding the status URL. -
Poll the status URL (
GET /fhir/bulkdata/status/{id}). It returns202withX-Progresswhile the job is pending or running, and200with a manifest when finished. A failed job returns 500 withExport failed: .... -
Download each file in the manifest's
outputlist ({type, url, count}) withGET /fhir/bulkdata/download/{exportId}/{Type}.ndjson. Download also needs the organization header. -
Optionally
DELETE /fhir/bulkdata/status/{id}. It returns 202 and removes the files of a completed export; another organization's export returns 403.
| Option | Behaviour |
|---|---|
| Endpoints | GET /fhir/$export (system) and GET /fhir/Patient/$export (patient level) |
_type | Comma-separated resource types |
_since | RFC 3339 timestamp, applied as _lastUpdated >= value. A bad value returns 400 Invalid _since parameter |
No _type | Every 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.
| Standard | Status |
|---|---|
| HL7 v2 parsing, ADT A01/A03/A08, ORU^R01, ORA^R41 | GA |
| HL7 v2 ORM, SIU, VXU, BAR, pharmacy | GA |
| MLLP listener and client | GA |
| HL7 v2 to FHIR transform | GA. 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 errors | GA |
| FHIR R4 structural validation | GA |
| FHIR R4 Touchstone certification | GA |
| 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 claims | GA |
| X12 835, 270/271, 276/277, 278, 834, 820 | GA |
| IHE PCD (device data) | GA |
| IHE XDS.b and MHD (CDA to MHD bridge) | GA |
| IHE ATNA audit | GA |
| IHE PIXm, PDQm | GA |
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,_containedor_revinclude:iterate. - Bulk export is
GETonly, with_typeand_sinceas the only filters. - The standalone
If-None-Existheader is not handled on resource endpoints; use bundle entries.If-Matchis handled onPUTonly. - No IPS (International Patient Summary) generation was found in the code.
Common errors
| Response | Cause | Fix |
|---|---|---|
400 Prefer header must be 'respond-async'... | Missing Prefer on $export | Add Prefer: respond-async |
400 Accept header must include 'application/fhir+ndjson' | Wrong Accept on $export | Use application/fhir+ndjson or */* |
401 Missing X-Organization-ID header | Calling the service without the gateway | Go through /api/v1/fhir, or send the header |
| 404 "... is not a resource type in FHIR R4; FHIR R5 defines it" | Wrong version endpoint | Use the endpoint named in the message |
| 406 | Unsupported or contradictory fhirVersion | Use 4.0 or 5.0, matching the path |
Something unclear? Send documentation feedback by email.