When a resource doesn’t have the search parameter you need, you can create your own. You define a SearchParameter resource with a FHIRPath expression and add it to the server.
How that works depends on the server provider. On some, POSTing the SearchParameter is enough. On others, someone has to run a reindex before the parameter returns anything, and until that finishes, results can be incomplete.
Once the parameter works, it gets hard coded into queries across the app and is treated like any other parameter.
It shouldn’t fail, but it can. Here are two ways.
The first is on your side. The parameter was never installed correctly in production. It was loaded by hand in test, missed in the production release or the reindex was never run.
The second is on the vendor’s side. The reindex fails partway through, or the parameter stops working after a server update or for reasons nobody can explain. I’ve seen apps fail in production when a custom parameter stopped working, with the team scrambling to get it running again and waiting on vendor support.
Either way, the server no longer recognizes the parameter. What happens next depends on the Prefer header the app sends. With handling=strict, the server returns an error. With handling=lenient, or with no header on a server that defaults to lenient, it ignores the parameter and returns a warning in an OperationOutcome alongside the results.
The lenient case is the more dangerous one. The search still runs, just without your filter.
Here’s an example: an emergency department app lists patients waiting for review, using a custom parameter on a triage extension. After a server update, the parameter is no longer recognised.
If the app sends handling=strict, it gets an error it has no code to handle. The screen shows a 500 error, and staff work around it until the team gets things back up and running. If it sends nothing and the server is lenient, the app ignores the OperationOutcome and the list fills with Encounters from across the hospital.
Signs to look for:
- Custom SearchParameters added to production by hand
- Reindexing run as a manual step
- Search requests sent with no Prefer header
- Search code that ignores OperationOutcomes in the response
- Custom parameters that are not monitored as part of uptime reporting
---
I work with teams on a project, retainer or fractional basis. Learn more →