Stream: fhirpath
Topic: Return value of aggregate?
Paul Lynch (Jun 02 2020 at 00:00):
It seems clear from the examples that the return value of aggregate is $total, but I don't see that explicitly stated here: http://hl7.org/fhirpath/#aggregateaggregator-expression-init-value-value
Paul Lynch (Jun 03 2020 at 12:36):
Bryn Rhodes (Jun 04 2020 at 00:36):
Yes, should definitely be clarified, thank you for submitting that
Brian Postlethwaite (Aug 26 2021 at 01:32):
Who's implemented this?
It's not in the .net fhirpath implementation (I will be adding it there), and I can't seem to get it to work in the fhirpath.js
So I'm wondering if it's a user problem...
Brian Postlethwaite (Aug 26 2021 at 01:42):
And while I'm implementing this, the spec doesn't specify what data type that is, decimal or integer?
Grahame Grieve (Aug 26 2021 at 02:38):
implemented what?
Brian Postlethwaite (Aug 26 2021 at 04:30):
Sorry, the value.aggregate($this + $total, 0)
implementation.
Brian Postlethwaite (Aug 26 2021 at 04:30):
Or does it just derive it from the type of the value
and hence if it was a string, that would just contatenate them all
Brian Postlethwaite (Aug 26 2021 at 04:31):
Effectively becoming an implementation for something like name.given.join(', ')
name.given.aggregate(iff($total.exists(), $total & ', ' & $this, $this))
Brian Postlethwaite (Aug 26 2021 at 05:26):
Nevermind, version issues here... got the fhirpath.js doing things right.
Ewout Kramer (Aug 27 2021 at 09:32):
Brian Postlethwaite said:
And while I'm implementing this, the spec doesn't specify what data type that is, decimal or integer?
It seems this function is indeed polymorphic, Brian - and could work on strings, ints, dates, etc. This is going to be nightmarish to implement in our .NET FP engine I think.
Last updated: Apr 12 2022 at 19:14 UTC