Clarify Start and End operators when boundaries are null#104
Conversation
* Make .sh files executable * Run _updatePublisher.sh to update scripts
The specification already indicates that open null boundaries represent uncertainties of specific ranges (based on the point type and other boundary of the interval). Update the `Start` and `End` operators to align with this approach. This impacts how many of the interval operators are calculated, causing results to be more correct.
lmd59
left a comment
There was a problem hiding this comment.
Big fan of this update! I just left a comment (well 3 related comments) with a suggestion that I suspect is not at all necessary but an idea for consideration.
One question that I have that is related but may be out of scope:
The logical specification makes it clear that the uncertainty created from a null open bound is inclusive. Does this potentially create an odd situation when the other boundary is open?
For instance, (null, 5), I would interpret to mean an interval that ranges from uncertainty[-2147483648, 5] to 4. The low boundary of the interval has an uncertainty that could be higher than the high boundary!
Should we potentially also suggest an update to the definition of Interval (https://cql.hl7.org/04-logicalspecification.html#interval) to make this case clearer?
I think this depends on how you interpret |
lmd59
left a comment
There was a problem hiding this comment.
Thank you for the thoughtful responses! Based on those, it might also be helpful to add one more case to each set of cql reference examples that shows the expected outcomes for a fully open interval where one of the values is null. Suggested updates inline, also fixes a small typo!
Co-authored-by: lmd59 <lmd59@cornell.edu>
lmd59
left a comment
There was a problem hiding this comment.
Small typo. Otherwise looks good!
Co-authored-by: lmd59 <lmd59@cornell.edu>
brynrhodes
left a comment
There was a problem hiding this comment.
Looks really good, just a minor nitpick with some of the language that refers to null "values" (no such thing, null is not a value)
Co-authored-by: Bryn Rhodes <brynrhodes@users.noreply.github.com>
|
Thanks for the review, @brynrhodes. I've accepted all of your edits! Let me know if there is anything else you think we should adjust. Also, I forgot to note in the description, but I updated the IG Publisher scripts too. Technically, only the |
The CQL specification already indicates that open null boundaries represent uncertainties of specific ranges.
From the Author's Guide:
From the Logical Specification:
The current definitions of Start and End, however, lose this nuance, as they state:
This PR updates the
StartandEnddefinitions to align more closely to the existing Interval definitions that indicate open null boundaries are uncertainties.Relevant changes in the definition for
Start:Relevant changes in the definition for
End:By updating these definitions, all Interval operators that describe their calculations using
startandendarrive at more correct results. For example,Interval[null, 0] includes Interval(null, 0]results innullaccording to a strict reading of the existingInclude,Start, andEnddefinitions; but it correctly results intruewhen these newStartandEnddefinitions are applied.Relevant examples have also been added to the CQL Reference to demonstrate how the definitions are applied.
I've also clarified the language in the
Intervaldefinition within the logical specification to avoid possible misinterpretations of the termhigh boundary (inclusive). In short, I updated the definition to use the termslow boundandhigh boundconsistently and to cross-reference each other (e.g.,... represented as an uncertainty from the low bound (see above)...and... to the high bound (see below)...).An alternate (or additional) approach to fixing the interval operator definitions would be to update every operation (
Include,Before,After, etc.) to specifically indicate how it behaves with open and closed null boundaries. This is not necessary, however, if we update theStartandEnddefinitions since all of these operations are defined in terms ofStartandEnd.