-1

How do i search Practitioners in a department/organization e.g prov,dep,gov on FHIR server. i want to display only practitioners from a particular organization.

Tried this "GET [base]/Practitioner?Organization=Organization/{_id}" and did not return any results.

DarkBee
  • 16,592
  • 6
  • 46
  • 58
Codee
  • 17
  • 2

1 Answers1

2

You can only search a resource based on information in that resource, and more specifically, using search parameters defined for the resource. Practitioner doesn't capture any information about 'organization' and doesn't have a search parameter called "Organization". (Side point - search parameter names are almost always lower-case.)

Practitioner represents a professional independent of who they work for or what role they're acting in. The PractitionerRole resource is what you need. It represents the combination of "who?" (practitioner), "on-behalf-of whom?" (organization), and "wearing which hat?" (code). Not all aspects will be present/relevant in all instances, but in your case you'd have both organization and practitioner.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • Oh okay, so if i wanted to build a relationship between Practitioner and Organization i should do it in the PractitionerRole and query that everytime i wanted to return the list of practitioners that work for a particular Organization? – Codee May 13 '22 at 07:02
  • 2
    You would need to use reverse chaining: GET [base]/Practitioner?_has:PractitionerRole:practitioner:organization=Organization/{_id}. Give me a practitioner, who has a practitioner role pointing to this practitioner with an organization of {_id} – Ted Elliott May 13 '22 at 13:10