Raw FHIR Passthrough
The simplified SDK covers the most common use cases, but sometimes you need to send raw FHIR R4 requests — custom search parameters, FHIR operations, or resource types we haven’t simplified yet. The FHIR passthrough routes requests directly to the ClinikAPI FHIR gateway with your tenant context automatically applied.SDK Usage
REST API
Tenant Isolation
Even in passthrough mode, tenant isolation is enforced:- Creates: your tenant tag is automatically injected into
meta.tag - Searches: a
_tagfilter is automatically appended - Reads/Updates/Deletes: ownership is verified
FHIR CapabilityStatement
The/v1/metadata endpoint returns a FHIR R4 CapabilityStatement (no auth required):
When to Use Passthrough
| Use Case | Recommended Approach |
|---|---|
| Standard CRUD operations | Use the simplified SDK methods |
| Custom FHIR search parameters | Use clinik.fhir.request('GET', ...) |
FHIR operations ($everything, $validate) | Use clinik.fhir.request('POST', ...) |
| Resource types not in the SDK | Use clinik.fhir.request(...) |
| Complex FHIR queries | Use clinik.fhir.request('GET', ...) |
The passthrough returns raw FHIR R4 resources — not the simplified format used by the SDK methods.
You’ll need to work with FHIR resource structures directly.