FHIR

FHIR search explained: parameters, prefixes, modifiers, _include and paging

How to query a FHIR server: search parameters by type (token, date, reference, string, quantity), prefixes such as ge and lt, modifiers such as :exact and :missing, chaining, _include and _revinclude, sorting, _count and paging, with example URLs for lab results.

by Published 1 min read

Short answer: FHIR search is a REST query: GET [base]/[ResourceType]?parameter=value. Each resource has defined search parameters with a type, and values can be refined with prefixes (ge, lt…) and modifiers (:exact, :missing…). Results come back as a searchset Bundle with paging links.

Parameter types and examples

  • token (codes): Observation?code=http://loinc.org|4548-4
  • date: Observation?date=ge2025-01-01&date=lt2026-01-01; prefixes eq, ne, gt, lt, ge, le, sa, eb, ap.
  • reference: Observation?subject=Patient/123 (or patient=123).
  • string: Patient?family=smith (starts-with by default; :exact and :contains modifiers).
  • quantity: Observation?value-quantity=gt7|http://unitsofmeasure.org|%.

Combine with & (and); repeat values separated by commas for or: code=http://loinc.org|2093-3,http://loinc.org|2571-8.

Including, sorting and paging

  • _include=Observation:subject adds the referenced Patient to the results; _revinclude=Provenance:target adds resources that point to them.
  • Chaining: Observation?subject:Patient.family=smith.
  • _sort=-date sorts newest first; _count=50 sets the page size; follow link[relation=next] for the next page rather than building offsets yourself.
  • _summary=count returns only the total.

In Anpheros

Anpheros Platform supports standard FHIR search on the patient's resources, within the scopes the patient granted. Developers: getting started, the FHIR sandbox and limits.

Sources

Frequently asked questions

How do I search FHIR Observations by LOINC code?

Observation?code=http://loinc.org|4548-4 (system|code).

How do I search by date range?

Repeat date with prefixes: date=ge2025-01-01&date=lt2026-01-01.

What does _include do?

Adds the resources referenced by the results, such as the Patient of each Observation, to the same Bundle.

How do I page through results?

Follow the next link in the returned Bundle; set page size with _count.

Anpheros Platform

Try it free in the sandbox

Your first FHIR call in 5 minutes. An HL7 FHIR R4 API with the patient's consent built in: try it in the sandbox, then connect your own app or clinic system.

Free · 30 synthetic patients · no card

This guide is for information and does not replace medical advice. For decisions about your health, talk to your doctor. In an emergency, call your local emergency number (112 in Europe).
Written by
The Anpheros team

Anpheros builds a medical record that the patient controls and can share with any clinic, on an HL7 FHIR R4 platform, based in the EU. These guides help you understand and organise your health; they do not replace your doctor.

About Anpheros →
Anpheros

The more you log, the clearer your record

Your health history in one place, under your control.

Symptom diaryPatterns show over time
Emergency cardQR in your phone's Wallet
All your resultsLabs and reports together
You decideWho sees what, and for how long
Create your free account

Free · Works in your browser · No card