FHIR Chat · contains&in with empty collection · fhirpath

Stream: fhirpath

Topic: contains&in with empty collection


view this post on Zulip nicola (RIO/SS) (Sep 18 2018 at 03:25):

What result is expected if we do contains with empty collection?

view this post on Zulip Grahame Grieve (Sep 18 2018 at 11:14):

empty collection

view this post on Zulip John Grimes (Dec 19 2019 at 23:14):

From: https://hl7.org/fhirpath/2018Sep/index.html#in-membership

If the left-hand side of the operator is empty, the result is empty

What is the rationale for not returning false in this case? Then the implementation could rely on the fact that this operator always returns a Boolean (or throws an error), rather than having to also cover the case where it returns an empty collection.

view this post on Zulip Grahame Grieve (Dec 19 2019 at 23:18):

you could ask that about any operation.

view this post on Zulip Grahame Grieve (Dec 19 2019 at 23:18):

null inputs leads to null outputs

view this post on Zulip John Grimes (Dec 19 2019 at 23:20):

Ok, I will attempt to wrap my head around that


Last updated: Apr 12 2022 at 19:14 UTC