How do you run a FHIR query that includes an extension value as a search parameter?
You can’t do this out-of-the-box, but you can do it.
If you’re storing important data in your extension, chances are someone will want to run a query against it at some point.
To allow this, you need to create one or more custom SearchParameters.
A SearchParameter resource defines how a search query works and contains a single fhirPath expression that identifies the extension and the element inside the extension that should be searched on.
Let’s take US Core’s ethnicity extension as an example.

It contains three nested extensions: “ombCategory”, “detailed” and “text” — any one of which you might want to perform a search on.
A nested extension like this — with multiple values — may require multiple SearchParameters.
A single extension value can also be composed of many different data types.
Depending on which value types you want to search on, more than one SearchParameter may be required here as well.
In this post I walk through creating custom SearchParameters.
---