lazybaer
03/05/2026, 7:46 PMSearchParameter to allow us to search for practitioner's by their state of licensure. it looks like this
{
"resourceType": "SearchParameter",
"url": "https://--------.com/fhir/SearchParameter/practitioner-license-state",
"name": "license-state",
"status": "active",
"description": "Search practitioners by state where their license is valid (USPS state codes)",
"code": "license-state",
"base": [
"Practitioner"
],
"type": "token",
"expression": "Practitioner.qualification.extension.where(url='http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/practitioner-qualification').extension.where(url='whereValid').value.ofType(CodeableConcept).coding.code",
"id": "9ec9cef7-5142-486a-aaeb-6934de1a1604",
"meta": {
"versionId": "a6d3f326-031e-4136-83b0-94b654201fea",
"lastUpdated": "2026-03-05T01:39:55.758Z",
"author": {
"reference": "ClientApplication/--------------------",
"display": "----Staging Default Client"
},
"project": "--------------------",
"compartment": [
{
"reference": "Project/-------------------"
}
]
}
} (redacted some id's)
when trying to seach on that though via:
https://api.medplum.com/fhir/R4/Practitioner?license-state=CA&_count=10
I get an error with "Unknown search parameter: license-state" in the response. Any idea what I might be doing wrong? thanks in advanceAditya Suri
03/06/2026, 2:46 AMlazybaer
03/06/2026, 2:30 PMAditya Suri
03/06/2026, 6:35 PMlazybaer
03/06/2026, 6:40 PMAditya Suri
03/06/2026, 7:02 PMSearchParameters aren't supported on the client side today. You can create the resource, but the server won't index against it.
Your data model is solid though. That Da Vinci PDex whereValid extension is perfect.
The workaround for making it searchable might be to use a Bot + Subscription to sync the license states into Practitioner.meta.tag.
Something like:
Create a Subscription on Practitioner (create + update)
Bot reads qualification[].extension[whereValid].valueCodeableConcept.coding[].code
Bot writes those state codes as meta.tag entries with system https://www.usps.com/
Then you can search:
GET /fhir/R4/Practitioner?_tag=https://www.usps.com/|CA&_count=10
That uses the built-in _tag search parameter.
On our end I do think a search parameter like this is definetly something worth having so I'll go ahead and make a GH issue. We've never done search params on an extension, but its a relatively traversed path so could be valuable.lazybaer
03/06/2026, 7:08 PMlazybaer
03/06/2026, 7:09 PMlazybaer
03/06/2026, 7:10 PMAditya Suri
03/06/2026, 7:21 PMlazybaer
03/06/2026, 7:22 PMDoug DeBold
03/06/2026, 7:42 PMAditya Suri
03/06/2026, 8:55 PMAditya Suri
03/06/2026, 8:58 PMlazybaer
03/06/2026, 8:58 PMDoug DeBold
03/06/2026, 10:40 PMsearch-parameters-medplum.json but I'm using the docker image in production and so cannot easily modify these files. Any ideas?Doug DeBold
03/06/2026, 11:09 PMsearch-parameters-medplum.json in my entrypoint script but that feels really hackyAditya Suri
03/06/2026, 11:22 PMnathan-watkins-unityai
03/07/2026, 3:15 AMDoug DeBold
03/07/2026, 4:08 PMJT
03/11/2026, 4:21 PMpackages/server/src/fhir/repo.ts call indexSearchParameter() to hot-reload it into the live schema
or add a loadCustomSearchParameters() function that queries the DB for user-created SearchParameters and indexes them, called from initAppServices() in packages/server/src/app.ts and at the end of rebuildR4SearchParameters() in packages/server/src/seeds/searchparameters.ts
i'm also trying to use this custom search param on a Basic fhir resource but its not recognizing it (I'm using a selfhosted instance as well)Doug DeBold
03/12/2026, 1:49 PMSEARCH_PARAMETER_BUNDLE_FILES value in index.cjs and index.mjs to include my file
4. Build and publish the new image myself
Based on my understanding of the code, all of the search params MUST but loaded into the in-memory cache for the search columns to be set on record updates.Aditya Suri
03/12/2026, 6:30 PMDoug DeBold
03/12/2026, 8:13 PMDoug DeBold
03/12/2026, 8:13 PMJT
03/13/2026, 3:59 AMJT
03/13/2026, 4:06 AMAditya Suri
03/16/2026, 6:00 PMDoug DeBold
03/17/2026, 2:46 PMpsql and added the columns and indexes following the naming patterns of the other search parameter columnsreshma
03/17/2026, 3:34 PMDoug DeBold
03/17/2026, 3:50 PMdueDate which is basically task.restriction.period.start ?? task.restriction.period.end By coalescing these 2 values it makes it impossible to make certain queries. For example, if I want to show all tasks with a due date (task.period.restriction.end ) in the future, if those tasks also have the period.start then you cannot filter for those future due tasks.
To solve this I added 2 search parameters:
1. customDueDate which only looks at task.period.restriction.end
2. notBefore which only looks at task.period.restriction.start
I added the "custom" due date b/c the current search param is called due date and I didn't want to deal with overwriting it