FHIR Chat · Searching Encounter by Practitioner ID (NPI) · implementers

Stream: implementers

Topic: Searching Encounter by Practitioner ID (NPI)


view this post on Zulip Tushar Nair (Oct 30 2020 at 22:36):

Hello,

I am trying to perform a search: I want to get the encounter(s) where the Encounter.participant.individual contains a reference to the 'PractitionerRole' resource. Within the PractitionerRole resource we have a reference to the Practitioner resource. I want to query by this Practitioner Identifier where system is NPI (http://hl7.org/fhir/sid/us-npi) and the value is NPI323. When I use the following query it works perfectly and returns the desired encounter resource:
https://localhost:12443/hapi-fhir-server/R4/Encounter?_filter=participant.practitioner.identifier eq NPI323. But when I am trying to bring in the identifier.value as well as identifier.system, the syntax is not accepted. Can you please suggest if there is a method to include the identifiersystem as well as identifier value in the above mentioned query? I want to enable the user to perform the search by provider NPI ID and I understand that using Identifier.type is not a good idea, better is to use identifier.value and Identifier.system

view this post on Zulip Michele Mottini (Oct 30 2020 at 22:44):

Did you try . . . eq http://hl7.org/fhir/sid/us-npi| NPI323 (that would be the syntax to use for a search parameter, not sure it works in _filter)

view this post on Zulip Michele Mottini (Oct 30 2020 at 22:45):

Having said that very few server support _filter, so be careful there

view this post on Zulip Tushar Nair (Oct 30 2020 at 22:53):

@Michele Mottini thank you. I tried that, it was throwing an error with system:
"diagnostics": "Invalid/unsupported resource type: \"sid\"". Is there any other way to use system and value to extract the encounter?

view this post on Zulip Michele Mottini (Oct 30 2020 at 23:35):

Did you URL encode the _filter parameter?

view this post on Zulip Michele Mottini (Oct 30 2020 at 23:37):

From the examples at http://hl7.org/fhir/search_filter.html that seems the right syntax

view this post on Zulip Tushar Nair (Oct 31 2020 at 00:09):

Michele Mottini said:

Did you URL encode the _filter parameter?

@Michele Mottini -sorry I didnt get that. I used the query as follows:
https://localhost:12443/hapi-fhir-server/R4/Encounter?_filter=participant.practitioner.identifier eq NPI323 and participant.practitioner.identifier eq http://hl7.org/fhir/sid/us-npi But its giving me the response as - "diagnostics": "Invalid/unsupported resource type: \"sid\""

view this post on Zulip Michele Mottini (Oct 31 2020 at 17:57):

Got that - try to URL-encode everything after the =

view this post on Zulip Michele Mottini (Oct 31 2020 at 17:58):

(replace spaces with %20, : with %3A and so on)

view this post on Zulip Tushar Nair (Nov 06 2020 at 02:20):

@Michele Mottini thank you so much :smile:


Last updated: Apr 12 2022 at 19:14 UTC