FHIR Chat · FHIRPath Test XML Issues · fhirpath

Stream: fhirpath

Topic: FHIRPath Test XML Issues


view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:45):

I noticed a few issues while trying to use the FHIRPath test artifacts. I grabbed them from http://build.fhir.org/ig/HL7/FHIRPath/branches/master/N1/tests.html but I assume the issues are carry-overs from other versions.

view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:46):

<?xml version="1.0" encoding="utf-8" ?> on line two (I assume it should be at the very top)

view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:47):

lines 217,218: invalid attribute appears on the test element, but I think it should be on the expression

view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:48):

lines 760-764 and 790-794: unencoded < symbols

view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:48):

line 1052: duplicate "name" attributes...perhaps the latter should be "description"?

view this post on Zulip Lee Surprenant (Nov 08 2019 at 16:49):

i'll open a single GForge for all 4 (unless I hear otherwise). I'm also happy to open a pull request to fix it if that will be helpful.

view this post on Zulip Lee Surprenant (Nov 08 2019 at 17:04):

ok, i opened https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=25194 and https://github.com/HL7/FHIRPath/pull/9

view this post on Zulip Grahame Grieve (Nov 08 2019 at 19:45):

actually, the tests I'm using are here:

view this post on Zulip Grahame Grieve (Nov 08 2019 at 19:46):

https://github.com/FHIR/fhir-test-cases/blob/master/r5/fhirpath/tests-fhir-r4.xml

view this post on Zulip Grahame Grieve (Nov 08 2019 at 19:46):

use these against the standard set of resources in the FHIR spec

view this post on Zulip Lee Surprenant (Nov 11 2019 at 15:14):

I confirmed this version doesn't have any of the above issues. Will the normative FHIRPath spec (R2?) be updated to point at this version? Or maybe it already has been and I was just looking in the wrong spot?

view this post on Zulip John Timm (Nov 22 2019 at 14:26):

@Grahame Grieve
I noticed that some of the tests (maybe a dozen or so) are missing <output> elements. For example:

<test inputfile="patient-example.xml"><expression>@2012-04-15 = @2012-04-15T10:00:00</expression></test>
<test inputfile="patient-example.xml"><expression>{} != {}</expression></test>
<test name="testLessThan23" inputfile="patient-example.xml"><expression>@2018-03 &lt; @2018-03-01</expression></test>
<test name="testLessThan24" inputfile="patient-example.xml"><expression>@2018-03-01T10 &lt; @2018-03-01T10:30</expression></test>
<test name="testLessThan25" inputfile="patient-example.xml"><expression>@T10 &lt; @T10:30</expression></test>

Do you have an updated version that includes the expected output for these?

view this post on Zulip John Timm (Nov 23 2019 at 16:01):

I see now that {} is implied when no output element is present.

view this post on Zulip John Timm (Nov 23 2019 at 16:03):

I am curious about this one:

<test name="testEquality7" inputfile="patient-example.xml"><expression>(1 | 1) = (1 | 2 | {})</expression></test>

I think this is saying that we are performing a union of 1 | 1 which results in singleton collection containing 1 (an integer) and comparing that to a set containing two values (1 and 2). Because the operands are not of the same cardinality the result is {}.
The spec says:
Note that this implies that if the collections have a different number of items to compare, the result will be false.

view this post on Zulip John Timm (Nov 23 2019 at 16:06):

I see you have commented it out in your version here:
https://github.com/FHIR/fhir-test-cases/blob/1ec63a139850dc1b3834642e8837531a444ccbde/r5/fhirpath/tests-fhir-r4.xml#L607
:slight_smile:

view this post on Zulip Grahame Grieve (Nov 24 2019 at 15:32):

hm. the union of 1 | 2 | {} is {}, no?

view this post on Zulip John Timm (Nov 25 2019 at 16:20):

I think it would be { 1, 2 }. The union of a non-empty set and the empty set should be the non-empty set. The intersection of a non-empty set and the empty set should be the empty set.

view this post on Zulip Grahame Grieve (Nov 25 2019 at 16:28):

@Bryn Rhodes this is an unfortunate consequence of the conflation of unknown and empty set.

view this post on Zulip Bryn Rhodes (Dec 03 2019 at 20:59):

Yes, John is right, for operations like union and intersect that expect lists, { } is always the empty set.


Last updated: Apr 12 2022 at 19:14 UTC