Unintuitive interpretation of some interval operator phrases
See original GitHub issueThere is an ambiguity in the specification related to the interpretation of timing relationships. Specifically, given this example:
define Interval1: Interval[@2012-01-01T09:00:00.0, @2012-01-01T10:30:00.0]
define Interval2: Interval[@2012-01-01T11:00:00.0, @2012-01-01T18:00:00.0]
define Within1: Interval1 ends 1 hour or less before start of Interval2
The specification implies in the definition of timing relationships (2.5.5.3) that this should return true
, but then describes in 5.5.3.2 that it should be interpreted as a duration between that would return false
.
The problem is that there are two boundaries involved in the comparison “X 1 hour or less before Y”:
- The boundary specified by the “before”, which is exclusive by the definition of the “before” operator.
- The boundary specified by the relative qualifier, “1 hour or less”, which is clearly inclusive.
In this particular case, those boundaries meet and so the interpretation is ambiguous. (In the case of “1 hour or more” the boundaries don’t meet, so there is no ambiguity and you get the intuitive behavior).
The translator should be updated to provide the intuitively correct behavior by having the inclusive boundary of the relative qualifier override the exclusive boundary of the comparison operator.
An STU comment has been submitted to the specification to clarify the ambiguity: http://www.hl7.org/dstucomments/showdetail_comment.cfm?commentid=1336
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (15 by maintainers)
Top GitHub Comments
Yes, that’s what I was thinking, and the in formulation is just a shorthand for the equivalent comparisons.
CDS WG and measure developers all agreed with the change and it was approved as STU comment 1337 on Wednesday’s call. The change has been applied to the specification and the translator.