Stream: implementers
Topic: Search issues
David Hay (Oct 02 2017 at 02:36):
Can I clarify the expected behaviour if a chained query uses a parameter value that does not match any resource.
eg . GET AllergyIntolerance?patient.identifier=http://mysys|100 . If there is no patient with that identifier, then what should the response be? My understanding is that it would be an empty bundle (possibly including an informational OO ), but colleagues have looked at the wording here: https://www.hl7.org/fhir/search.html#errors and wonder if it should be an error...
David Teirney (Oct 02 2017 at 02:41):
If we can't resolve the received patient identifier to a patient within our overall system (e.g. by asking the patient identity service), our preference is to return an error rather than introduce possible clinical risk if the client doesn't check the operation outcome and just sees the empty collection.
David Teirney (Oct 02 2017 at 02:54):
Conversely, as systems are used more widely in a regional context there's a good chance even the patient identity service we use behind the scenes (typically an EMPI) might not have knowledge of a patient identifier that the server receives.
Lloyd McKenzie (Oct 02 2017 at 17:19):
If you do a search and nothing matches the criteria, you return an empty set. The example provided of [base]/Observation?subject=101
is a situation where you can clearly say the query is broken as they're asking for a match on a non-existing record. But if you're searching patient.identifier, you're just not finding any matching rows.
Lloyd McKenzie (Oct 02 2017 at 17:19):
There's no difference in behavior between patient.identifier=x and patient.gender=x
Lloyd McKenzie (Oct 02 2017 at 17:20):
Nor is there any expectation that there should only be one patient that matches patient.identifier=http://mysys|100 like there would be with subject=101
Lloyd McKenzie (Oct 02 2017 at 17:22):
The wording however is all "SHOULD". So if you really want to raise an error, you can. But I'd only do that if I recognized the system and the identifier value was also specified and I know that the expectation is that there should be exactly one match for that particular identifier system in the repository.
Lloyd McKenzie (Oct 02 2017 at 17:22):
It wouldn't be a bad idea for us to add some safety guidance around the creation of chained queries that addresses this issue.
David Hay (Oct 02 2017 at 18:52):
Thanks lloyd. Tracker raised: https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=13985
Last updated: Apr 12 2022 at 19:14 UTC