Stream: implementers
Topic: Multiple chain parameters
Hue Nguyen (Jul 15 2020 at 11:38):
I try to write a query to get all Encounter where have Patient.general-practitioner:Practitioner = {Id1}
and Patient.general-practitioner:PractitionerRole = {Id2}
, and i try with 2 of this query
[1] Encounter?patient.general-practitioner:Practitioner.id=001&patient.general-practitioner:PractitionerRole.id=002
[2] Encounter?patient.general-practitioner:Practitioner.id=002&patient.general-practitioner:PractitionerRole.id=002
Data base will like:
Encounter 1: include Patient has practitioner id = 001 and practitionerRole id = 002
Encounter 2: include Patient has practitioner id = 002 and practitionerRole id = 002
Expect:
[1] will return Encounter 1 and 2
[2] will return Encounter 1 and 2
Actual:
[1] will return only Encounter 1
[2] will return Encounter 1 and 2
My server: GCP FHIR
Do you have any idea what happen ? Although gcp docs said If the query has multiple chained parameters, each chain is evaluated separately
cc: @Paul Church
Paul Church (Jul 15 2020 at 16:20):
For a reference search you want to do Encounter?patient.general-practitioner=Practitioner/001&patient.general-practitioner=PractitionerRole/002
. Using .id
(should be ._id
I think) is a second level of chaining.
However this search is maybe not what you want since it is AND. It will only match an encounter E such that E.patient.general-practitioner=Practitioner/001 AND E.patient.general-practitioner=PractitionerRole/002. If you want an OR operation you need to do two searches.
Jens Villadsen (Jul 15 2020 at 18:20):
Unless you do it in a _filter query which enables OR's
Hue Nguyen (Jul 16 2020 at 02:42):
@Paul Church i got this, Thank you for reply
Hue Nguyen (Jul 16 2020 at 02:42):
@Jens Villadsen GCP doesn't support filter
. So, i think i need make query twice
Last updated: Apr 12 2022 at 19:14 UTC