Skip to content

v1.6.0

Latest

Choose a tag to compare

@mechanik-daniel mechanik-daniel released this 29 Sep 20:47

@outburn/fhir-client 1.6.0

This release includes two improvements to error handling and paginated search behavior.

HTTP Error Redaction

HTTP transport failures from the main public API surface are now normalized to FhirClientError instead of exposing raw Axios errors.

This improves security and privacy by preventing request configuration, nested authentication objects, and other Axios internals from appearing in serialized error payloads. Consumers should use the supported FhirClientError fields:

  • status
  • headers
  • operationOutcome
  • request

Consumers that relied on Axios-specific error fields should update to this safe error contract.

Search Transforms for Paginated Results

Paginated searches now support per-resource projection and filtering with fetchAll: true:

client.search(
  'Patient',
  {},
  {
    fetchAll: true,
    transform: (resource, mode, index, entry) => {
      // Return a transformed resource, or undefined to filter it out.
      return resource;
    },
  },
);

The transformer runs sequentially for every encountered Bundle.entry[].resource, including _include and _revinclude resources. It receives (resource, mode, index, entry).

Returning undefined removes an item from the final result. If the transformer throws or rejects, the search fails immediately.

Compatibility notes:

  • transform is only valid with fetchAll: true.
  • maxResults counts raw fetched resources before transform filtering.
  • Non-callable transform values are rejected.
  • Existing bundle-returning searches are unchanged.

What's Changed

Full Changelog: v1.5.0...v1.6.0