FHIR Chat · FHIR.Quantity versus System.Quantity · fhirpath

Stream: fhirpath

Topic: FHIR.Quantity versus System.Quantity


view this post on Zulip John Timm (Nov 13 2019 at 15:13):

The FHIR spec mentions the implicit conversion between FHIR.Quantity and System.Quantity including how to handle time-valued UCUM units:

http://hl7.org/fhir/fhirpath.html#quantity

but doesn't say much about how to compare quantities if they are not UCUM-based. How should a FHIRPath evaluation engine handle comparisons between two FHIR.Quantity nodes that are not UCUM quantities (either they have a code from a system other than UCUM or they do not use system/code and only unit)?

view this post on Zulip Bryn Rhodes (Nov 13 2019 at 15:51):

FHIRPath requires that quantities be either UCUM units, or a calendar duration unit: http://build.fhir.org/ig/HL7/FHIRPath/branches/master/N1/#quantity

view this post on Zulip Bryn Rhodes (Nov 13 2019 at 15:53):

So if you wanted to deal with a Quantity value in FHIR that wasn't UCUM-coded, then you would have to either convert that to a UCUM unit (so it could be represented as a System.Quantity) or deal with it specifically as a FHIR.Quantity (i.e. doing the unit and value comparisons directly, rather than treating it as a quantity).

view this post on Zulip Lee Surprenant (Nov 13 2019 at 17:10):

Should https://build.fhir.org/fhirpath.html#types or https://build.fhir.org/fhirpath.html#quantity cover the expected behavior in this case? What do the various implementations do? Seems a bit under-specified...

view this post on Zulip Grahame Grieve (Nov 13 2019 at 20:32):

what could we specify?

view this post on Zulip Lee Surprenant (Nov 13 2019 at 22:09):

That two FHIR_Quantity are comparable if they have the same coded units (even if those units aren't UCUM)?

view this post on Zulip Grahame Grieve (Nov 13 2019 at 22:10):

yeah I guess we could do that. do you want to make a task?

view this post on Zulip Lee Surprenant (Nov 13 2019 at 22:10):

sure

view this post on Zulip Lee Surprenant (Nov 13 2019 at 22:36):

ok, i submitted https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=25216

view this post on Zulip Bryn Rhodes (Nov 14 2019 at 22:55):

I think for equality and equivalence, the definition follows from equality and equivalence for objects.

view this post on Zulip Bryn Rhodes (Nov 14 2019 at 22:56):

From the perspective of FHIRPath, a FHIR.Quantity is a complex object, so the standard = and ~ operators apply.


Last updated: Apr 12 2022 at 19:14 UTC