ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

SearchParameter — FHIR search discovery

Every FHIR search request (GET /Patient?birthdate=ge2020) is backed by a SearchParameter. The resource describes what a parameter is: its HTTP name, type, and FHIRPath expression on the target resource.

Purpose

The FHIR core spec defines roughly 1,500 standard SearchParameters (e.g. Patient.birthdate, Observation.code, Encounter.subject). Each has a short code (the URL name) and a FHIRPath expression pointing to the indexed element(s).

A server may extend the standard parameters by publishing custom SearchParameters (typically in an Implementation Guide), or shrink the list via its CapabilityStatement.

Key fields

FieldTypeCardinalityRole
urluri1..1Mandatory. Canonical URL.
namestring1..1Machine name.
statuscode1..1Publication status.
codecode1..1HTTP code used in URLs (birthdate in ?birthdate=...).
basecode[]1..*Resource types the parameter applies to.
typecode1..1Search type (see list).
expressionstring0..1FHIRPath of indexed node.
processingModecode0..1normal, phonetic, other. R5 (was xpathUsage).
targetcode[]0..*For reference parameters: allowed target types.
multipleOrboolean0..1Several values combinable with ,?
multipleAndboolean0..1Parameter repeatable in URL with implicit AND?
comparatorcode[]0..*Allowed comparators (eq, gt, lt...).
modifiercode[]0..*Allowed modifiers (:exact, :contains, :not...).
chainstring[]0..*Chaining allowed on this parameter.
componentBackboneElement[]0..*For composite multi-element parameters.

SearchParameter types

TypeSemanticsExample
numberNumberObservation?value-quantity=ge5
datedate / dateTime / PeriodPatient?birthdate=ge1980
stringString (default: prefix match)Patient?family=Dupont
tokensystem|code, identifierPatient?identifier=urn:oid:1.2|MRN123
referenceReference to another resourceObservation?patient=Patient/123
compositeCombination of several parametersObservation?code-value-quantity=8480-6$ge140
quantityValue + unitObservation?value-quantity=5.4|http://unitsofmeasure.org|mg
uriCanonical URL or URIValueSet?url=http://hl7.org/fhir/ValueSet/...
specialSpecial behaviourLocation?near=43.6|7.04|10|km

JSON example

The canonical Patient.birthdate SearchParameter:

json searchparameter-birthdate.json
{
  "resourceType": "SearchParameter",
  "id": "Patient-birthdate",
  "url": "http://hl7.org/fhir/SearchParameter/Patient-birthdate",
  "version": "5.0.0",
  "name": "birthdate",
  "status": "active",
  "experimental": false,
  "date": "2026-05-14",
  "publisher": "HL7 (FHIR Project)",
  "description": "The patient's date of birth",
  "code": "birthdate",
  "base": ["Patient"],
  "type": "date",
  "expression": "Patient.birthDate",
  "xpath": "f:Patient/f:birthDate",
  "xpathUsage": "normal",
  "comparator": ["eq", "ne", "gt", "ge", "lt", "le", "sa", "eb", "ap"]
}

Common pitfalls

  • Invalid FHIRPath expression — a server can only index if the expression resolves to a valid node against the StructureDefinition.
  • Confusing code vs namecode is the HTTP identifier used in URLs, name is the machine name.
  • Duplicate SearchParameter on the server — two SPs with same code on same base but different expressions: undefined behaviour.
  • Search on non-indexable expression — a FHIRPath with heavy conditionals (where, iif) may not be indexable: some servers refuse.
  • Unsupported modifiers — a client using :contains or :exact must check support declared in the CapabilityStatement.
  • CapabilityStatement — lists active SearchParameters per resource type.
  • StructureDefinition — target of FHIRPath expressions.
  • ImplementationGuide — package for custom SearchParameters.