FHIR Chat · Query patients with several name elements · implementers

Stream: implementers

Topic: Query patients with several name elements


view this post on Zulip Monika Moser (May 27 2019 at 09:57):

Hi, I have a question concerning the combination of names in queries.

When an patient example like this is taken (http://hl7.org/fhir/STU3/datatypes-examples.html#HumanName)

<name>
  <use value="official" />
  <family value="Chalmers" />
  <given value="Peter" />
  <given value="James" />
</name>
<name>
  <use value="usual" />
  <given value="Jim" />
</name>

would the search family=Chalmers&given=Jim return a patient result? Is there a rule that the queried given and family attributes must be of the same nameelement?

Further, when a patient with the names

<name>
  <use value="official" />
  <family value="Chalmers" />
  <given value="Karen" />
</name>
<name>
  <use value="maiden" />
  <family value="Hochheim" />
</name>

is given, is a query like
family=Chalmers&family=Hochheim&given=Karen possible?
Under the assumption that all of the search attributes should be of the same name, this query should not work (no patient is returned). Each name has only one field for the family name.
When all parts should be of the same name, does this then result in a query like:
(family=Chalmers AND given=Karen) OR (family=Hochheim AND given=Karen)

view this post on Zulip Lloyd McKenzie (May 27 2019 at 13:23):

Yes, family=Chalmers&given=Jim would return the patient. And the second query would also give a match. If you wanted to match only on a specified combination of first + last, you'd need to define a compound search parameter. We haven't done so in the core specification because when searching for a patient match, you typically want to match on any of the names. There's no ability do do complex ANDing and ORing with RESTful queries unless you use _filter or you define compound search parameters that take care of the AND bit (and more importantly, the context of the AND bit) for you.

view this post on Zulip Monika Moser (May 28 2019 at 07:41):

Thank you. That totally makes sense. The reason I was uncertain for a moment and wanted to cross check was a statement of the IHE PDQm-Profile.

view this post on Zulip Lloyd McKenzie (May 28 2019 at 12:58):

What statement?

view this post on Zulip Monika Moser (May 28 2019 at 13:07):

https://chat.fhir.org/#narrow/stream/179223-ihe/topic/PDQm.20combination.20of.20family.20and.20given.20names

view this post on Zulip Lloyd McKenzie (May 28 2019 at 13:10):

Yup, that should be fixed :)


Last updated: Apr 12 2022 at 19:14 UTC