FHIR Chat · different implementations: fhirpath: [] = 'string' · conformance

Stream: conformance

Topic: different implementations: fhirpath: [] = 'string'


view this post on Zulip Patrick Werner (Jul 24 2021 at 13:04):

I learned yesterday, that fhirpath equals (=) is implemented differently in different "engines".

[] = 'string' evaluates:

view this post on Zulip Patrick Werner (Jul 24 2021 at 13:13):

According to the fhirpath spec the correct evaluation should be: []

Returns true if the left collection is equal to the right collection:

As noted above, if either operand is an empty collection, the result is an empty collection.Returns true if the left collection is equal to the right collection:

As noted above, if either operand is an empty collection, the result is an empty collection.

view this post on Zulip Patrick Werner (Jul 24 2021 at 13:14):

so .net and fhirpath-demo appearing to misinterpret fhirpath.

view this post on Zulip Patrick Werner (Jul 24 2021 at 13:14):

@Ewout Kramer @Ward Weistra @nicola (RIO/SS)

view this post on Zulip Alexander Zautke (Jul 24 2021 at 16:07):

The issue is slightly hard to debug from the outside for the .NET part. If you're running FHIRPath on Simplifier, it will currently still be executed using an older version of the Firely SDK (See https://docs.fire.ly for version details). The latest version of the SDK implements the correct behaviour.

view this post on Zulip Patrick Werner (Jul 24 2021 at 16:43):

thanks for the debugging.

view this post on Zulip Patrick Werner (Jul 24 2021 at 16:47):

So it is only a Simplifier issue like the one with resolve(), caused by an older version of the fhirpath engine inside Simplifier.

view this post on Zulip Ward Weistra (Jul 26 2021 at 12:10):

@Patrick Werner Do you mean this query {} = 'string', with {} for an empty collection? I don't see [] being accepted by any of them (didn't test Java). And differences in .NET implementation won't explain differences in outcome between the two JS implementations :wink:

(Trying to see if I can evaluate it in Firely Terminal with a more recent SDK.)

view this post on Zulip Patrick Werner (Jul 26 2021 at 12:14):

hey @Ward Weistra i already debbuged this in depth together with @Alexander Zautke

view this post on Zulip Patrick Werner (Jul 26 2021 at 12:15):

It is a simplifier onyl issue, due to the older .net sdk used

view this post on Zulip Patrick Werner (Jul 26 2021 at 12:15):

https://chat.fhir.org/#narrow/stream/179177-conformance/topic/when.20are.20invariants.20triggered/near/247082282

view this post on Zulip Ward Weistra (Jul 26 2021 at 12:16):

Cool, was able to it in Firely Terminal though: image.png
cc @Alexander Zautke

view this post on Zulip Ward Weistra (Jul 26 2021 at 12:16):

I think that means it evaluates to an empty collection :wink:

view this post on Zulip nicola (RIO/SS) (Jul 30 2021 at 21:56):

This Martian logic XML poisons everything :( We implemented this by spec. I personally like more json centric interpretation [] = 'string' => "Exception: could not compare array with string" :)


Last updated: Apr 12 2022 at 19:14 UTC