Stream: hapi
Topic: Search all resources of a Patient with search criteria
Brecht Van Vooren (Feb 10 2022 at 13:30):
Hi, I'm looking for a way to search all resources that are linked to a Patient with a specified identifier, but with a way to filter on a list of resource types and profiles.
At the moment we use the Patient search with the _revinclude parameter for the allowed resource types.
The question is how can we filter out specific profiles? For example I want to have all Condition resources of profile A and not the other profiles.
Is there also a way to remove the Patient resource itself from the Bundle so we only see the reverse included resources?
We will look into possible parameters of $everything and investigate the compartment search using GET [base]/Patient/[id]/[type]?parameter(s). But in the meantime does anyone have experience in a similar query?
Craig McClendon (Feb 10 2022 at 20:36):
Someone may correct me, but I don't think there is a way to do what you want all in a single query.
You can certainly search all Conditions for a single patient that match a profile:
/Condition?subject=Patient/123&_profile=http://myprofile
And you can limit Patient$everything to only certain resource types with the _type paramater.
But I don't see a way to add additional search criteria onto Patient$everything to filter on profile there.
Brecht Van Vooren (Feb 11 2022 at 08:26):
Thanks for your response Craig. I need to specify my question more.
I don't want to have only the Condition resources of a certain profile, but also AllergyIntolerance of a specified profile like you can see in my example.
I want to avoid to execute 2 (or more) separate searches: one for Condition with profile X and one for AllergyIntolerance with profile Y, I want it to be a single query where I can specify a list of resource types and fhir profiles.
Any idea that is possible?
Craig McClendon (Feb 11 2022 at 20:13):
I've never used it in this way, but I think you can submit multiple searches in a single batch Bundle. I don't think there is a way to do it with Patient$everything. see https://hl7.org/fhir/http.html#transaction
Last updated: Apr 12 2022 at 19:14 UTC