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
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)
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 (
2024matches any date in 2024;2024-01matches any date in Jan 2024). - For
number/quantity,eq/nerespect implied precision (FHIR-style decimal ranges).
Modifiers
Ferrum recognizes and validates a subset of FHIR modifiers. A modifier must:- Be valid for the parameter type, and
- Be allowed by the underlying
SearchParametermetadata (when provided)
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
Reverse chaining (_has)
Ferrum supports _has (reverse chaining) with the form:
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, usePrefer: handling=strict:
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
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.linkURLs (next,prev,first,last) returned by the server - Paging links use Ferrum’s internal parameters:
_cursor: base64url-encodedlastUpdated,id_cursor_direction:next,prev, orlast
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 exactBundle.total_total=estimate: allow faster, estimated totals (where possible)_total=none: omit totals entirely
_summary and _elements
Ferrum applies _summary / _elements filtering to Bundle.entry[].resource:
_summary=countshort-circuits fetching resources and returns only the count bundle_summarytakes precedence over_elements- Includes are suppressed for
_summary=text(common server behavior)
Limits and configuration knobs
Search limits are configurable underfhir.search:
max_count(default1000): maximum allowed_countmax_total_results(default10000): maximum allowed_maxresultsmax_includes(default10): maximum number of_include+_revincludemax_include_depth(default3): maximum:iteratedepthenable_text/enable_content: enable_text/_contentfull-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