FHIR Chat · FHIRPath test suite order of unions? · fhirpath

Stream: fhirpath

Topic: FHIRPath test suite order of unions?


view this post on Zulip Tilo Christ (Jan 08 2022 at 23:37):

Next discussion around the test suite: Many of the tests seem to make assumptions about the order of items in unions. The spec says: http://hl7.org/fhirpath/N1/#union-collections "There is no expectation of order in the resulting collection.". Am I right in assuming that a test case like '(0 | 1 | 2).tail() = 1 | 2' therefore has no guarantee of passing, because (0 | 1 | 2) might be [2, 1, 0]? My implementation of union is actually reversing the order of the union and thus the test suite breaks on about a dozen tests or so...

view this post on Zulip Brian Postlethwaite (Jan 09 2022 at 05:54):

Probably correct, the other implementations return input order I believe (at least JS and dotnet anyway)

view this post on Zulip Brian Postlethwaite (Apr 08 2022 at 04:12):

And also the same for take(1) and skip(1) which are order dependant.


Last updated: Apr 12 2022 at 19:14 UTC