Skip to main content

Implementation Features

Endpoints Ferrum implements

Examples:
POST-based search must use Content-Type: application/x-www-form-urlencoded. Ferrum merges query string parameters and body parameters into one ordered parameter list.

Parameter occurrence semantics (AND/OR)

Ferrum preserves parameter occurrences in request order (no lossy map parsing):
  • Repeating a parameter is AND: name=John&name=Smith
  • Comma-separated values are OR: name=John,Smith
Examples:

Search syntax (modifiers, prefixes, chaining)

Parameter name forms

Most resource parameters follow:
  • :{modifier} is case-insensitive (except reference type modifiers like :Patient)
  • .{chain} is single-level chaining (see below)
Want to see which search parameters exist for a resource type? Check the server’s CapabilityStatement: GET /fhir/metadata.

Value prefixes

Ferrum supports the standard FHIR prefixes when they appear at the start of the value. Applies to: date, number, quantity, and _lastUpdated. Notes:
  • Date precision is range-based (2024 matches any date in 2024; 2024-01 matches any date in Jan 2024).
  • For number/quantity, eq/ne respect implied precision (FHIR-style decimal ranges).

Modifiers

Ferrum recognizes and validates a subset of FHIR modifiers. A modifier must:
  1. Be valid for the parameter type, and
  2. Be allowed by the underlying SearchParameter metadata (when provided)
Common patterns: Examples:
Token modifiers :in, :not-in, :above, and :below are rejected (terminology-backed behavior is not implemented yet).

Chaining (single-level)

Ferrum supports single-level chaining on reference parameters:
  • Basic chaining: subject.name=peter
  • Type-restricted chaining: subject:Patient.name=peter
Examples:

Reverse chaining (_has)

Ferrum supports _has (reverse chaining) with the form:
Example:

What is searchable?

Resources become searchable through SearchParameter resources that define:
  • What to index: FHIRPath expressions extract values from resources
  • How to search: Parameter types determine search semantics
  • Where to store: Each type maps to a dedicated database table

Parameter types and tables

Token and quantity parameters also support pipe-delimited forms: system|code (token), and number||code / number|system|code (quantity).

Unknown or unsupported parameters

By default, Ferrum follows the common “lenient” behavior and ignores unknown/unsupported search parameters. If you want strict validation, use Prefer: handling=strict:
This returns an error listing the unknown/unsupported parameters for that resource context.

Advanced search features supported

_include / _revinclude

Ferrum supports _include and _revinclude including:
  • Wildcards (*, Resource:*)
  • :iterate (depth-limited to prevent infinite recursion)
  • Deduplication of included resources
Examples:

Membership search: _in and _list

Ferrum supports membership searches (e.g. “resources in Group/List”):

_filter (FHIR R5-style expression filter)

Ferrum supports _filter expressions for type-level search (and for system search when a single type is implied). Operators supported include: eq, ne, co, sw, ew, re, gt, lt, ge, le, sa, eb, ap, pr, in, ni, ss, sb. Example (use --data-urlencode so spaces and quotes are encoded correctly):
_filter does not support modifiers (_filter:...) and should not be combined with multi-type system searches. Prefer a type-level search when using _filter.

Pagination (cursor-based)

Ferrum uses keyset/cursor pagination for stable paging over a changing dataset.
  • Control page size with _count
  • Follow Bundle.link URLs (next, prev, first, last) returned by the server
  • Paging links use Ferrum’s internal parameters:
    • _cursor: base64url-encoded lastUpdated,id
    • _cursor_direction: next, prev, or last
Example:
Ferrum parses _offset but does not use it for paging. Pagination links will not include _offset.

Totals and response shaping

_total

Ferrum calculates totals when requested via _total:
  • _total=accurate: compute an exact Bundle.total
  • _total=estimate: allow faster, estimated totals (where possible)
  • _total=none: omit totals entirely
Examples:

_summary and _elements

Ferrum applies _summary / _elements filtering to Bundle.entry[].resource:
  • _summary=count short-circuits fetching resources and returns only the count bundle
  • _summary takes precedence over _elements
  • Includes are suppressed for _summary=text (common server behavior)
Examples:
_count=0 is treated as _summary=count (per FHIR search result parameter rules).

Limits and configuration knobs

Search limits are configurable under fhir.search:
  • max_count (default 1000): maximum allowed _count
  • max_total_results (default 10000): maximum allowed _maxresults
  • max_includes (default 10): maximum number of _include + _revinclude
  • max_include_depth (default 3): maximum :iterate depth
  • enable_text / enable_content: enable _text / _content full-text search parameters

Known gaps

Current limitations in Ferrum’s search engine:
  • Recursive chaining (e.g. subject.organization.name) is not supported (single-level only)
  • Composite search parameters are not supported