FHIR DevDays Search Tutorial

This page provides details of a FHIR search tutorial I gave at DevDays on June 5th, 2025. The first section provides a link to the data used to populate the test FHIR server. This is the same data that all subsequent queries were run against.

The second section lists all 19 search queries that I ran. You can run them against a server that you populate with this data using Postman, Vanya or any other API tool. Or you can run them against any FHIR server, though the results will differ as the data will be different.

The Data

Here’s a link to the Postman collection.

It contains 50 Patient Bundles, with hundreds of resources per bundle. The source of the data is Synthea, though some modifications have been made. Details of how I built the collection are in this post.

Once you import the collection into Postman, adjust the Pre-Request script for the main folder to point to your FHIR server. You may also want to write or adjust the commented out script that retrieves a bearer token.

The “Create Data” folder can be run once to add all 50 patient bundles to your server or you can choose to run individual bundles.

The Queries

Query 1

Give me a specific Condition resource, by FHIR ID.

Condition/559cb30e-c874-41e1-b31a-ed850ae0a9a5

Condition?_id=559cb30e-c874-41e1-b31a-ed850ae0a9a5

Query 2

Give me the full history of changes to that Condition resource.

Condition/559cb30e-c874-41e1-b31a-ed850ae0a9a5/_history

Query 3

Give me a Patient with a specific social security number (Token search).

Patient?identifier=http://hl7.org/fhir/sid/us-ssn|999-35-4097

Query 4

Give me all CarePlans with a status of “active”. Include a total count if possible.

CarePlan?status=active&_total=accurate

Query 5

Give me CarePlans with different statuses (list of statuses).

CarePlan?status=active,completed

Query 6

Give me 5 Procedures sorted by performed date in reverse order.

Procedure?_count=5&_sort=-date

Query 7

Give me all Procedures that were performed in 2024.

Procedure?date=2024

Procedure?date=ge2024-01-01&date=lt2025-01-01

Query 8

Give me all Observations made during a specific Encounter (Reference search).

Observation?encounter=Encounter/f60783ba-45aa-44c1-97cf-38dec2da3ea1

Query 9

Give me all emergency encounters with a type of “Cardiac Arrest”.

SNOMED code for Cardiac Arrest: 410429000
SNOMED system: http://snomed.info/sct

Encounter
?class=http://terminology.hl7.org/CodeSystem/v3-ActCode|EMER
&type=http://snomed.info/sct|410429000

Query 10

Give me all Encounters and include the Patient from the Encounter.

Encounter?_include=Encounter:patient

Query 11

Give me all emergency Encounters, with the Patient, Practitioner and the service provider.

Encounter
?_include=Encounter:patient
&_include=Encounter:participant
&_include=Encounter:service-provider
&class=http://terminology.hl7.org/CodeSystem/v3-ActCode|EMER

Query 12

Give me all Encounters along with all Observations made during that Encounter (_revinclude).

Encounter?_revinclude=Observation:encounter

Query 13

Give me all Encounters with Patient and Observations from 2024 (both _include & _revinclude & a search parameter).

Encounter
?_include=Encounter:patient
&_revinclude=Observation:encounter
&date=ge2024-01-01
&date=lt2025-01-01

Query 14

Give me all Observations that are NOT vital signs (:not modifier)

System: http://terminology.hl7.org/CodeSystem/observation-category
Code: vital-signs

Observation?category:not=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs

Query 15

Give me all Patients whose name contains “Smith” (:contains modifier).

Patient?name:contains=smith

Query 16

Give me all Procedures where the performed date is missing. (: missing modifier).

Procedure?date:missing=true

Query 17

Give me all Procedures for Patients named “Jerrold” and include the Patient (chaining).

Procedure
?patient.name=Jerrold
&_include=Procedure:patient

Query 18

Give me all Patients who smoke

SNOMED code for smoker: 449868002
SNOMED system: http://snomed.info/sct

Patient?_has:Observation:patient:value-concept=http://snomed.info/sct|449868002

Query 19

Give me all Goals with a description that contains “blood pressure” (custom search parameter).

Goal?darrens-description:contains=blood pressure

Below is the SearchParameter resource that you need to add to your FHIR server to create the new search parameter. How you enable the parameter will vary depending on your FHIR server provider.

{
"resourceType": "SearchParameter",
"url": "http://darrendevitt.com/SearchParameter/darrens-description",
"version": "1.0",
"name": "DarrensDescriptionParam",
"status": "active",
"date": "2025-03-31T07:07:55.66+00:00",
"description": "Goal description parameter",
"code": "darrens-description",
"base": [
"Goal"
],
"type": "string",
"expression": "Goal.description.text"
}

---

Ways to Work With Me

Discover more from Darren Devitt

Subscribe now to keep reading and get access to the full archive.

Continue reading