Client configuration. baseUrl is required.
ReadonlyhttpUnderlying HTTP client — exposed for advanced use cases.
ReadonlypaginationPagination helper.
FHIR server base URL.
Set the OAuth2 bearer token used for Authorization headers.
Custom headers sent with every request.
Submit a batch Bundle (FHIR batch interaction).
The body.type field must be 'batch'. Each entry is processed
independently; partial failures are reported per-entry in the response.
The batch response Bundle.
Fetch the server's CapabilityStatement.
Optionaloptions: RequestOptionsPer-request options.
The CapabilityStatement resource.
Search within a FHIR compartment.
A search result Bundle.
Create a new resource (FHIR create interaction).
The created resource (with server-assigned id).
Delete a resource by type and id (FHIR delete interaction).
The server's response (often an OperationOutcome).
Retrieve history. Dispatches to instance-, type-, or system-level history based on the parameters provided.
A history Bundle.
Return the next page of a Bundle search result.
The next page Bundle, or undefined if there is no next page.
Invoke a FHIR operation ($name) at the system, type, or instance level.
The operation output resource.
Patch a resource using JSON Patch (RFC 6902) (FHIR patch interaction).
Sends Content-Type: application/json-patch+json.
The patched resource.
Return the previous page of a Bundle search result.
The previous page Bundle, or undefined if there is no previous page.
Read a resource by type and id (FHIR read interaction).
The requested resource.
Execute a raw request against the FHIR server. Useful for endpoints not covered by higher-level methods.
Path or absolute URL to request.
The parsed FHIR response.
Resolve a FHIR reference to a resource.
http://...): fetches directly or creates a new client for a foreign base URL.Patient/123): fetches from this client's baseUrl.#id): resolved from context.contained[].context.entry[].fullUrl.The resolved FHIR resource.
Instance-level history for a specific resource.
A history Bundle.
Search within a specific resource type (FHIR type-level search).
A search result Bundle.
Search for resources. Dispatches to the appropriate search variant based on parameters:
compartment + resourceType → compartment searchresourceType only → type-level searchsearchParams only → system-wide searchA search result Bundle.
Fetch SMART OAuth 2.0 authorization metadata from the server.
Races three sources simultaneously and resolves with the first successful
response: .well-known/smart-configuration, metadata (CapabilityStatement),
and .well-known/openid-configuration. Rejects only if all three fail.
SMART auth metadata containing authorizeUrl, tokenUrl, etc.
System-level history across all resource types.
A history Bundle.
System-wide search across all resource types.
A search result Bundle.
Submit a transaction Bundle (FHIR transaction interaction).
The body.type field must be 'transaction'. All entries succeed or
fail together (atomic).
The transaction response Bundle.
Type-level history for all instances of a resource type.
A history Bundle.
Update a resource (FHIR update interaction).
Supports conditional update via searchParams (sets the If-Match
criteria). Provide either id or searchParams, not both.
The updated resource.
Read a specific version of a resource (FHIR vread interaction).
The specified version of the resource.
StatichttpReturn the raw Request and Response objects attached to a FHIR
response value by the HTTP layer.
A FHIR resource returned by any client method.
{ request, response } — either may be undefined for synthetic responses.
FHIR REST client. Provides typed methods for all FHIR interactions.
Example