Practitioner Search By Name and Role
# support
c
What is the best way to search for a practitioner with a certain role and name?
r
Hi Charlie, sorry for the delay! To search by name, you can just use the
name
search parameter. Would you mind reminding me again how you are modeling Practitioner Roles?
c
Each practitioner has a PractitionerRole FHIR resource for their market (managing org). The code on the PractitionerRole resource is what I want to filter by.
Right now what I am doing is using a query like this:
Copy code
gql
query GetAllNurses {
  nurses: PractitionerRoleList(role: "nurse", _count: 500) {
    id
    code {
      coding {
        display
        code
      }
    }
    practitioner {
      resource {
        ... on Practitioner {
          id
          identifier {
            value
          }
          name {
            given
            family
          }
        }
      }
    }
  }
}
Then filtering by name in the UI
r
Hi @Charlie from Imagine , sorry for the delay! I was holding back because we just launched a new feature called chained search (s/o @medplummatt !)
This allows you to filter one resource, based on the properties of a linked resource
In this case, using the REST API, you can search:
/Practioner?name=:name&_has=PractionerRole:practitioner:role=nurse
The way to read this is: "Get me all Practitioners with name
:name
and which have a PractionerRole (linked to via the
practioner
search param) with the
role
= nurse"
126 Views