simonj
10/29/2025, 6:18 PMUnknown search parameter: organization (self hosted server v4.4.1)
{
"resourceType": "Practitioner",
"criteria": "Practitioner?organization=%current_organization"
}
Related to this, the docs also state Chained searches are not allowed. So what is the recommended criteria query for all Practitioners belonging to an Organization? And if this is best achieved by compartments, are there any examples anywhere?
Or am I missing something simple here? Any help would be great!
Thanks
SimonIan Plunkett
10/30/2025, 4:50 PM{
"resourceType": "Practitioner",
"criteria": "Practitioner?
_compartment=Organization/%current_organization"
}simonj
10/30/2025, 9:15 PM{
"resourceType": "Practitioner",
"meta": {
"project": "f6f0a5ac-f02e-426d-bd1c-3c78cd5d24f8",
"versionId": "a708c7ee-fc68-406a-b9bc-99646aecbc0c",
"lastUpdated": "2025-10-03T15:07:20.885Z",
"author": {
"reference": "system"
},
"compartment": [
{
"reference": "Project/f6f0a5ac-f02e-426d-bd1c-3c78cd5d24f8"
}
]
},
"name": [
{
"given": [
"GeneralPrac"
],
"family": "GeneralPrac"
}
],
"telecom": [
{
"system": "email",
"use": "work",
"value": "general-prac@example.com"
}
],
"id": "d98fbbf2-a75f-4b4b-91cb-0840e18c9b57"
}
{
"resourceType": "PractitionerRole",
"practitioner": {
"reference": "Practitioner/d98fbbf2-a75f-4b4b-91cb-0840e18c9b57",
"display": "GeneralPrac GeneralPrac"
},
"organization": {
"reference": "Organization/1fe19c53-0d7e-4de2-9ba0-6a9e16fc263e",
"display": "Hospital A"
},
"id": "f3b30c2d-588e-4270-b1bf-5e299a1a0305",
"meta": {
"versionId": "27ed0e7a-9714-410b-8735-fb5b2e9941b6",
"lastUpdated": "2025-10-03T15:07:20.899Z",
"author": {
"reference": "ClientApplication/b32e12e7-95a7-4731-979c-8ce4f625d8f6",
"display": "cmhq-dev-project Default Client"
},
"project": "f6f0a5ac-f02e-426d-bd1c-3c78cd5d24f8",
"compartment": [
{
"reference": "Project/f6f0a5ac-f02e-426d-bd1c-3c78cd5d24f8"
}
]
}
}finnbergquist
11/03/2025, 11:38 PMfinnbergquist
11/03/2025, 11:41 PM{
"resourceType": "Practitioner",
"criteria": "Practitioner?
_compartment=Organization/%current_organization"
}
Will work if you call the [set-accounts](https://www.medplum.com/docs/api/fhir/operations/patient-set-accounts) operation on your Practitioner resources first, and pass %current_organization as a parameter on your AccessPolicy.
All of this is explained in detail in that blog postsimonj
11/04/2025, 9:03 PM$set-accounts to be used for billing and not access control which is why I may have missed it.
Is the $set-accounts worth a mention at the "Multi-Tenant Access Control" docs page above along with removing the Practitioner?organization=%current_organization example? If so I can create a PR if that's helpful?finnbergquist
11/04/2025, 11:05 PM