diff --git a/.mocharc.json b/.mocharc.json index 3e72788f..01cb5176 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,5 +1,5 @@ { "ignore": ["test/spec-tests/*.js"], "extension": ["ts"], - "require": "ts-node/register" + "require": ["ts-node/register", "./test/should-extensions.ts"] } diff --git a/examples/browser/cql4browsers.js b/examples/browser/cql4browsers.js index 1227fe15..3a398464 100644 --- a/examples/browser/cql4browsers.js +++ b/examples/browser/cql4browsers.js @@ -134,7 +134,7 @@ class Record { name: '{https://github.com/cqframework/cql-execution/simple}Record', type: elmTypes_1.ELM_NAMED_TYPE_SPECIFIER }, - { name: '{urn:hl7-org:elm-types:r1}Any', type: elmTypes_1.ELM_NAMED_TYPE_SPECIFIER } + { name: elmTypes_1.ELM_ANY_TYPE, type: elmTypes_1.ELM_NAMED_TYPE_SPECIFIER } ]; } _recursiveGet(field) { @@ -1800,15 +1800,43 @@ const math_1 = require("../util/math"); const cmp = __importStar(require("../util/comparison")); const elmTypes_1 = require("../util/elmTypes"); class Interval { - constructor(low, high, lowClosed, highClosed, defaultPointType // defaultPointType is used in the case that both endpoints are null - ) { + constructor(low, high, lowClosed, highClosed, pointType = elmTypes_1.ELM_ANY_TYPE) { this.low = low; this.high = high; this.lowClosed = lowClosed; this.highClosed = highClosed; - this.defaultPointType = defaultPointType; + this.pointType = pointType; this.lowClosed = lowClosed != null ? lowClosed : true; this.highClosed = highClosed != null ? highClosed : true; + if (this.pointType == null || this.pointType === elmTypes_1.ELM_ANY_TYPE) { + let point = low ?? high; + if (point?.isUncertainty) { + point = point.low ?? point.high; + } + if (point != null) { + if (typeof point === 'number') { + this.pointType = Number.isInteger(point) ? elmTypes_1.ELM_INTEGER_TYPE : elmTypes_1.ELM_DECIMAL_TYPE; + } + else if (typeof point === 'bigint') { + this.pointType = elmTypes_1.ELM_LONG_TYPE; + } + else if (point.isTime && point.isTime()) { + this.pointType = elmTypes_1.ELM_TIME_TYPE; + } + else if (point.isDate) { + this.pointType = elmTypes_1.ELM_DATE_TYPE; + } + else if (point.isDateTime) { + this.pointType = elmTypes_1.ELM_DATETIME_TYPE; + } + else if (point.isQuantity) { + this.pointType = elmTypes_1.ELM_QUANTITY_TYPE; + } + } + if (this.pointType == null) { + this.pointType = elmTypes_1.ELM_ANY_TYPE; + } + } } get isInterval() { return true; @@ -1819,34 +1847,6 @@ class Interval { get isUnknownInterval() { return this.low == null && !this.lowClosed && this.high == null && !this.highClosed; } - get pointType() { - let pointType = null; - const point = this.low != null ? this.low : this.high; - if (point != null) { - if (typeof point === 'number') { - pointType = Number.isInteger(point) ? elmTypes_1.ELM_INTEGER_TYPE : elmTypes_1.ELM_DECIMAL_TYPE; - } - else if (typeof point === 'bigint') { - pointType = elmTypes_1.ELM_LONG_TYPE; - } - else if (point.isTime && point.isTime()) { - pointType = elmTypes_1.ELM_TIME_TYPE; - } - else if (point.isDate) { - pointType = elmTypes_1.ELM_DATE_TYPE; - } - else if (point.isDateTime) { - pointType = elmTypes_1.ELM_DATETIME_TYPE; - } - else if (point.isQuantity) { - pointType = elmTypes_1.ELM_QUANTITY_TYPE; - } - } - if (pointType == null && this.defaultPointType != null) { - pointType = this.defaultPointType; - } - return pointType; - } copy() { let newLow = this.low; let newHigh = this.high; @@ -1856,233 +1856,199 @@ class Interval { if (this.high != null && typeof this.high.copy === 'function') { newHigh = this.high.copy(); } - return new Interval(newLow, newHigh, this.lowClosed, this.highClosed); + return new Interval(newLow, newHigh, this.lowClosed, this.highClosed, this.pointType); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#contains contains(item, precision) { - // These first two checks ensure correct handling of edge case where an item equals the closed boundary - if (this.lowClosed && this.low != null && cmp.equals(this.low, item)) { - return true; - } - if (this.highClosed && this.high != null && cmp.equals(this.high, item)) { - return true; - } if (item != null && item.isInterval) { throw new Error('Argument to contains must be a point'); } - let lowFn; - if (this.lowClosed && this.low == null) { - lowFn = () => true; - } - else if (this.lowClosed) { - lowFn = cmp.lessThanOrEquals; - } - else { - lowFn = cmp.lessThan; - } - let highFn; - if (this.highClosed && this.high == null) { - highFn = () => true; - } - else if (this.highClosed) { - highFn = cmp.greaterThanOrEquals; - } - else { - highFn = cmp.greaterThan; - } - return logic_1.ThreeValuedLogic.and(lowFn(this.low, item, precision), highFn(this.high, item, precision)); + // "The contains operator for intervals returns true if the given point is equal to the starting + // or ending point of the interval, or greater than the starting point and less than the ending + // point... If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(item, this.start(), precision), cmp.lessThanOrEquals(item, this.end(), precision)); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#properly-includes properlyIncludes(other, precision) { + // TODO: "For the interval-point overload, this operator returns true if the interval contains + // (i.e. includes) the point, and the interval is not a unit interval containing only the + // point." if (other == null || !other.isInterval) { throw new Error('Argument to properlyIncludes must be an interval'); } - return logic_1.ThreeValuedLogic.and(this.includes(other, precision), logic_1.ThreeValuedLogic.not(other.includes(this, precision))); + // "... the starting point of the first interval is less than or equal to the starting point of + // the second interval, and the ending point of the first interval is greater than or equal to + // the ending point of the second interval, and they are not the same interval... If precision + // is specified and the point type is a Date, DateTime, or Time type, comparisons used in the + // operation are performed at the specified precision." + return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(this.start(), other.start(), precision), cmp.greaterThanOrEquals(this.end(), other.end(), precision), logic_1.ThreeValuedLogic.not(other.includes(this, precision))); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#includes includes(other, precision) { - if (other == null || !other.isInterval) { + // "For the interval-interval overload, if either argument is null, the result is null." + if (other == null) { + return null; + } + // "For the point-interval overload, this operator is a synonym for the contains operator." + else if (!other.isInterval) { return this.contains(other, precision); } - const a = this.toClosed(); - const b = other.toClosed(); - return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(a.low, b.low, precision), cmp.greaterThanOrEquals(a.high, b.high, precision)); + // "... the starting point of the first interval is less than or equal to the starting point of + // the second interval, and the ending point of the first interval is greater than or equal to + // the ending point of the second interval... If precision is specified and the point type is a + // Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." + return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(this.start(), other.start(), precision), cmp.greaterThanOrEquals(this.end(), other.end(), precision)); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#included-in includedIn(other, precision) { - // For the point overload, this operator is a synonym for the in operator - if (other == null || !other.isInterval) { - return this.contains(other, precision); + // "For the interval-interval overload, if either argument is null, the result is null." + if (other == null) { + return null; } - else { - return other.includes(this); + else if (other == null || !other.isInterval) { + throw new Error('Argument to includedIn must be an interval'); } + // "... the starting point of the first interval is greater than or equal to the starting point + // of the second interval, and the ending point of the first interval is less than or equal to + // the ending point of the second interval... If precision is specified and the point type is a + // Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(this.start(), other.start(), precision), cmp.lessThanOrEquals(this.end(), other.end(), precision)); } - overlaps(item, precision) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlaps(other, precision) { + // "If either argument is null, the result is null." + if (other == null) { return null; } - else if (this.isBoundlessInterval || item?.isBoundlessInterval) { - return true; - } - const closed = this.toClosed(); - const [low, high] = (() => { - if (item != null && item.isInterval) { - const itemClosed = item.toClosed(); - return [itemClosed.low, itemClosed.high]; - } - else { - return [item, item]; - } - })(); - return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(closed.low, high, precision), cmp.greaterThanOrEquals(closed.high, low, precision)); + // "... the ending point of the first interval is greater than or equal to the starting point + // of the second interval, and the starting point of the first interval is less than or equal + // to the ending point of the second interval... If precision is specified and the point type + // is a Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(this.end(), other.start(), precision), cmp.lessThanOrEquals(this.start(), other.end(), precision)); } - overlapsAfter(item, precision) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlapsAfter(other, precision) { + // "If either argument is null, the result is null." + if (other == null) { return null; } - const high = item != null && item.isInterval ? item.toClosed().high : item; - if (this.isBoundlessInterval) { - return cmp.lessThan(high, (0, math_1.maxValueForInstance)(high), precision); - } - else if (item?.isBoundlessInterval) { - return false; - } - const closed = this.toClosed(); - return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(closed.low, high, precision), cmp.greaterThan(closed.high, high, precision)); + // "... the overlaps after operator returns true if the first interval overlaps the second + // and ends after it." + return logic_1.ThreeValuedLogic.and(cmp.lessThanOrEquals(this.start(), other.end(), precision), cmp.greaterThan(this.end(), other.end(), precision)); } - overlapsBefore(item, precision) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlapsBefore(other, precision) { + // "If either argument is null, the result is null." + if (other == null) { return null; } - const low = item != null && item.isInterval ? item.toClosed().low : item; - if (this.isBoundlessInterval) { - return cmp.greaterThan(low, (0, math_1.minValueForInstance)(low), precision); - } - else if (item?.isBoundlessInterval) { - return false; - } - const closed = this.toClosed(); - return logic_1.ThreeValuedLogic.and(cmp.lessThan(closed.low, low, precision), cmp.greaterThanOrEquals(closed.high, low, precision)); + // "The operator overlaps before returns true if the first interval overlaps the second and + // starts before it..." + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(this.end(), other.start(), precision), cmp.lessThan(this.start(), other.start(), precision)); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#union union(other) { - if (other == null || !other.isInterval) { + // "If either argument is null, the result is null." + if (other == null) { + return null; + } + else if (!other.isInterval) { throw new Error('Argument to union must be an interval'); } - // Note that interval union is only defined if the arguments overlap or meet. - if (this.overlaps(other) || this.meets(other)) { - const [a, b] = [this.toClosed(), other.toClosed()]; - let l, lc; - if (cmp.lessThanOrEquals(a.low, b.low)) { - [l, lc] = [this.low, this.lowClosed]; - } - else if (cmp.greaterThanOrEquals(a.low, b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } - else if (areNumeric(a.low, b.low)) { - [l, lc] = [lowestNumericUncertainty(a.low, b.low), true]; - // TODO: Do we need to support quantities here? - } - else if (areDateTimes(a.low, b.low) && a.low.isMorePrecise(b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } - else { - [l, lc] = [this.low, this.lowClosed]; - } - let h, hc; - if (cmp.greaterThanOrEquals(a.high, b.high)) { - [h, hc] = [this.high, this.highClosed]; - } - else if (cmp.lessThanOrEquals(a.high, b.high)) { - [h, hc] = [other.high, other.highClosed]; - } - else if (areNumeric(a.high, b.high)) { - [h, hc] = [highestNumericUncertainty(a.high, b.high), true]; - // TODO: Do we need to support quantities here? - } - else if (areDateTimes(a.high, b.high) && a.high.isMorePrecise(b.high)) { - [h, hc] = [other.high, other.highClosed]; - } - else { - [h, hc] = [this.high, this.highClosed]; - } - return new Interval(l, h, lc, hc); + // "If the arguments do not overlap or meet, this operator returns null." + if (!this.overlaps(other) && !this.meets(other)) { + return null; + } + // "... the operator returns the interval that starts at the earliest starting point in either + // argument, and ends at the latest ending point in either argument." + let earliestStart; + const thisIsEarlier = cmp.lessThan(this.start(), other.start()); + if (thisIsEarlier == null) { + earliestStart = lowestUncertainty(this.start(), other.start()); } else { - return null; + earliestStart = thisIsEarlier ? this.start() : other.start(); + } + let latestEnd; + const thisIsLater = cmp.greaterThan(this.end(), other.end()); + if (thisIsLater == null) { + latestEnd = highestUncertainty(this.end(), other.end()); + } + else { + latestEnd = thisIsLater ? this.end() : other.end(); } + return normalizeInterval(new Interval(earliestStart, latestEnd, true, true, this.pointType ?? other.pointType)); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#intersect intersect(other) { - if (other == null || !other.isInterval) { - throw new Error('Argument to union must be an interval'); + // "If either argument is null, the result is null." + if (other == null) { + return null; } - // Note that interval union is only defined if the arguments overlap. - if (this.overlaps(other)) { - const [a, b] = [this.toClosed(), other.toClosed()]; - let l, lc; - if (cmp.greaterThanOrEquals(a.low, b.low)) { - [l, lc] = [this.low, this.lowClosed]; - } - else if (cmp.lessThanOrEquals(a.low, b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } - else if (areNumeric(a.low, b.low)) { - [l, lc] = [highestNumericUncertainty(a.low, b.low), true]; - // TODO: Do we need to support quantities here? - } - else if (areDateTimes(a.low, b.low) && b.low.isMorePrecise(a.low)) { - [l, lc] = [other.low, other.lowClosed]; - } - else { - [l, lc] = [this.low, this.lowClosed]; - } - let h, hc; - if (cmp.lessThanOrEquals(a.high, b.high)) { - [h, hc] = [this.high, this.highClosed]; - } - else if (cmp.greaterThanOrEquals(a.high, b.high)) { - [h, hc] = [other.high, other.highClosed]; - } - else if (areNumeric(a.high, b.high)) { - [h, hc] = [lowestNumericUncertainty(a.high, b.high), true]; - // TODO: Do we need to support quantities here? - } - else if (areDateTimes(a.high, b.high) && b.high.isMorePrecise(a.high)) { - [h, hc] = [other.high, other.highClosed]; - } - else { - [h, hc] = [this.high, this.highClosed]; - } - return new Interval(l, h, lc, hc); + else if (!other.isInterval) { + throw new Error('Argument to intersect must be an interval'); } - else { + // "If the arguments do not overlap, this operator returns null." + if (!this.overlaps(other)) { return null; } + // "... the operator returns the interval that defines the overlapping portion of both arguments." + // Note: This spec definition isn't very precise, so we'll approach it similar to union: + // The interval that starts at the latest starting point in either argument, and ends at the + // earliest ending point in either argument. + let latestStart; + const thisIsLater = cmp.greaterThan(this.start(), other.start()); + if (thisIsLater == null) { + latestStart = highestUncertainty(this.start(), other.start()); + } + else { + latestStart = thisIsLater ? this.start() : other.start(); + } + let earliestEnd; + const thisIsEarlier = cmp.lessThan(this.end(), other.end()); + if (thisIsEarlier == null) { + earliestEnd = lowestUncertainty(this.end(), other.end()); + } + else { + earliestEnd = thisIsEarlier ? this.end() : other.end(); + } + return normalizeInterval(new Interval(latestStart, earliestEnd, true, true, this.pointType ?? other.pointType)); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#except except(other) { + // "If either argument is null, the result is null." if (other === null) { return null; } - if (other == null || !other.isInterval) { + else if (!other.isInterval) { throw new Error('Argument to except must be an interval'); } - const ol = this.overlaps(other); - if (ol === true) { - const olb = this.overlapsBefore(other); - const ola = this.overlapsAfter(other); - if (olb === true && ola === false) { - return new Interval(this.low, other.low, this.lowClosed, !other.lowClosed); - } - else if (ola === true && olb === false) { - return new Interval(other.high, this.high, !other.highClosed, this.highClosed); - } - else { - return null; - } + // "... this operator returns the portion of the first interval that does not overlap with the second." + // Unresolved zulip: https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609516976 + let precision; + if (this.pointType === elmTypes_1.ELM_DATE_TYPE || + this.pointType === elmTypes_1.ELM_DATETIME_TYPE || + this.pointType === elmTypes_1.ELM_TIME_TYPE) { + const boundaries = [this.low, this.high, other.low, other.high]; + const leastPreciseBoundary = boundaries.reduce((least, boundary) => boundary?.isLessPrecise(least) ? boundary : least); + precision = leastPreciseBoundary?.getPrecision(); + } + if (this.overlaps(other, precision) === false) { + return this.copy(); } - else if (ol === false) { - return this; + const overlapsBefore = this.overlapsBefore(other, precision); + const overlapsAfter = this.overlapsAfter(other, precision); + if (overlapsBefore && !overlapsAfter) { + return normalizeInterval(new Interval(this.start(), other.start(), true, false, this.pointType)); } - else { - // ol is null - return null; + else if (overlapsAfter && !overlapsBefore) { + return normalizeInterval(new Interval(other.end(), this.end(), false, true, this.pointType)); } + return null; } sameAs(other, precision) { // This large if and else if block handles the scenarios where there is an open ended null @@ -2155,6 +2121,9 @@ class Interval { } } sameOrBefore(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return this.equals(other); + } if (this.end() == null || other == null || other.start() == null) { return null; } @@ -2163,6 +2132,9 @@ class Interval { } } sameOrAfter(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return this.equals(other); + } if (this.start() == null || other == null || other.end() == null) { return null; } @@ -2172,6 +2144,12 @@ class Interval { } equals(other) { if (other != null && other.isInterval) { + if (this.isBoundlessInterval) { + return other.isBoundlessInterval ? true : other.isUnknownInterval ? null : false; + } + else if (other.isBoundlessInterval) { + return this.isUnknownInterval ? null : false; + } const [a, b] = [this.toClosed(), other.toClosed()]; return logic_1.ThreeValuedLogic.and(cmp.equals(a.low, b.low), cmp.equals(a.high, b.high)); } @@ -2180,6 +2158,9 @@ class Interval { } } after(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } const closed = this.toClosed(); // Meets spec, but not 100% correct (e.g., (null, 5] after [6, 10] --> null) // Simple way to fix it: and w/ not overlaps @@ -2191,6 +2172,9 @@ class Interval { } } before(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } const closed = this.toClosed(); // Meets spec, but not 100% correct (e.g., (null, 5] after [6, 10] --> null) // Simple way to fix it: and w/ not overlaps @@ -2202,9 +2186,15 @@ class Interval { } } meets(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } return logic_1.ThreeValuedLogic.or(this.meetsBefore(other, precision), this.meetsAfter(other, precision)); } meetsAfter(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } try { if (precision != null && this.low != null && this.low.isDateTime) { return this.toClosed().low.sameAs(other.toClosed().high != null ? other.toClosed().high.add(1, precision) : null, precision); @@ -2218,6 +2208,9 @@ class Interval { } } meetsBefore(other, precision) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } try { if (precision != null && this.high != null && this.high.isDateTime) { return this.toClosed().high.sameAs(other.toClosed().low != null ? other.toClosed().low.add(-1, precision) : null, precision); @@ -2232,47 +2225,69 @@ class Interval { } start() { if (this.low == null) { - if (this.lowClosed) { - return (0, math_1.minValueForInstance)(this.high); + const quantityInstance = this.high && this.pointType == elmTypes_1.ELM_QUANTITY_TYPE ? this.high : undefined; + const minValue = (0, math_1.minValueForType)(this.pointType, quantityInstance); + if (this.lowClosed || minValue == null) { + return minValue; } else { - return this.low; + const end = ((end) => (end.isUncertainty ? end.high : end))(this.high == null ? (0, math_1.maxValueForType)(this.pointType) : this.end()); + return new uncertainty_1.Uncertainty(minValue, end); } } - return this.toClosed().low; + return this.lowClosed ? this.low : (0, math_1.successor)(this.low, this.pointType); } end() { if (this.high == null) { - if (this.highClosed) { - return (0, math_1.maxValueForInstance)(this.low); + const quantityInstance = this.low && this.pointType == elmTypes_1.ELM_QUANTITY_TYPE ? this.low : undefined; + const maxValue = (0, math_1.maxValueForType)(this.pointType, quantityInstance); + if (this.highClosed || maxValue == null) { + return maxValue; } else { - return this.high; + const start = ((start) => (start.isUncertainty ? start.low : start))(this.low == null ? (0, math_1.minValueForType)(this.pointType) : this.start()); + return new uncertainty_1.Uncertainty(start, maxValue); } } - return this.toClosed().high; + return this.highClosed ? this.high : (0, math_1.predecessor)(this.high, this.pointType); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#starts starts(other, precision) { - let startEqual; - if (precision != null && this.low != null && this.low.isDateTime) { - startEqual = this.low.sameAs(other.low, precision); + // "If either argument is null, the result is null." + if (other == null) { + return null; + } + // "... the starting point of the first is equal to the starting point of the second interval + // and the ending point of the first interval is less than or equal to the ending point of the + // second interval." + if (precision && + [elmTypes_1.ELM_DATETIME_TYPE, elmTypes_1.ELM_DATE_TYPE, elmTypes_1.ELM_TIME_TYPE].includes(this.pointType ?? other.pointType)) { + // "If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." + return logic_1.ThreeValuedLogic.and(this.start().sameAs(other.start(), precision), cmp.lessThanOrEquals(this.end(), other.end(), precision)); } else { - startEqual = cmp.equals(this.low, other.low); + return logic_1.ThreeValuedLogic.and(cmp.equals(this.start(), other.start()), cmp.lessThanOrEquals(this.end(), other.end())); } - const endLessThanOrEqual = cmp.lessThanOrEquals(this.high, other.high, precision); - return startEqual && endLessThanOrEqual; } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#ends ends(other, precision) { - let endEqual; - const startGreaterThanOrEqual = cmp.greaterThanOrEquals(this.low, other.low, precision); - if (precision != null && (this.low != null ? this.low.isDateTime : undefined)) { - endEqual = this.high.sameAs(other.high, precision); + // "If either argument is null, the result is null." + if (other == null) { + return null; + } + // "... the starting point of the first interval is greater than or equal to the starting point + // of the second, and the ending point of the first interval is equal to the ending point of + // the second." + if (precision && + [elmTypes_1.ELM_DATETIME_TYPE, elmTypes_1.ELM_DATE_TYPE, elmTypes_1.ELM_TIME_TYPE].includes(this.pointType ?? other.pointType)) { + // "If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(this.start(), other.start(), precision), this.end().sameAs(other.end(), precision)); } else { - endEqual = cmp.equals(this.high, other.high); + return logic_1.ThreeValuedLogic.and(cmp.greaterThanOrEquals(this.start(), other.start()), cmp.equals(this.end(), other.end())); } - return startGreaterThanOrEqual && endEqual; } width() { if ((this.low != null && (this.low.isDateTime || this.low.isDate)) || @@ -2402,47 +2417,113 @@ class Interval { } } exports.Interval = Interval; -function areDateTimes(x, y) { - return [x, y].every(z => z != null && z.isDateTime); -} -function areNumeric(x, y) { - return [x, y].every(z => { - return (typeof z === 'number' || - typeof z === 'bigint' || - (z != null && z.isUncertainty && (typeof z.low === 'number' || typeof z.low === 'bigint'))); - }); +// Return an interval that uses the standard null boundary conventions if appropriate: +// - low closed boundary with min value for the type is changed to null closed boundary +// - high closed boundary with max value for the type is changed to null closed boundary +// - low open boundary that is uncertainty from min value of type to max value or interval high +// value is changed to null open boundary +// - high open boundary that is uncertainty from min value of type or interval low value to max +// value of type is changed to null open boundary +// +// TODO: Is this necessary? Do we care how it is represented if the representations have the same +// meaning? This does affect test expectations and representation of returned results for callers. +function normalizeInterval(interval) { + const ivl = interval.copy(); + if (ivl.low != null && ivl.lowClosed !== false) { + if (ivl.low.isUncertainty) { + const minValue = (0, math_1.minValueForInstance)(ivl.low.low); + const maxValue = (0, math_1.maxValueForInstance)(ivl.low.low); + if (cmp.equals(ivl.low.low, minValue) && + (cmp.equals(ivl.low.high, maxValue) || cmp.equals(ivl.low.high, ivl.high))) { + ivl.low = null; + ivl.lowClosed = false; + } + } + else if (cmp.equals(ivl.low, (0, math_1.minValueForInstance)(ivl.low))) { + ivl.low = null; + } + } + if (ivl.high != null && ivl.highClosed !== false) { + if (ivl.high.isUncertainty) { + const minValue = (0, math_1.minValueForInstance)(ivl.high.low); + const maxValue = (0, math_1.maxValueForInstance)(ivl.high.low); + if (cmp.equals(ivl.high.high, maxValue) && + (cmp.equals(ivl.high.low, minValue) || cmp.equals(ivl.high.low, ivl.low))) { + ivl.high = null; + ivl.highClosed = false; + } + } + else if (cmp.equals(ivl.high, (0, math_1.maxValueForInstance)(ivl.high))) { + ivl.high = null; + } + } + return ivl; } -function lowestNumericUncertainty(x, y) { - if (x == null || !x.isUncertainty) { +function lowestUncertainty(x, y) { + if (!x?.isUncertainty) { x = new uncertainty_1.Uncertainty(x); } - if (y == null || !y.isUncertainty) { + if (!y?.isUncertainty) { y = new uncertainty_1.Uncertainty(y); } - const low = x.low < y.low ? x.low : y.low; - const high = x.high < y.high ? x.high : y.high; - if (low !== high) { - return new uncertainty_1.Uncertainty(low, high); + // Note: If the following comparisons result in null, we're dealing with date imprecision. + // The spec doesn't currently say what to do; but it will be updated to indicate that the + // coursest precision should be used (which is consistent with collapse) + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609310186 + let low; + const xLowIsLower = cmp.lessThan(x.low, y.low); + if (xLowIsLower == null && x.low?.isLessPrecise) { + low = x.low.isLessPrecise(y.low) ? x.low : y.low; } else { + low = xLowIsLower ? x.low : y.low; + } + let high; + const xHighIsLower = cmp.lessThan(x.high, y.high); + if (xHighIsLower == null && x.high?.isLessPrecise) { + high = x.high.isLessPrecise(y.high) ? x.high : y.high; + } + else { + high = xHighIsLower ? x.high : y.high; + } + // use equivalent to consider nulls equal + if (cmp.equivalent(low, high)) { return low; } + return new uncertainty_1.Uncertainty(low, high); } -function highestNumericUncertainty(x, y) { - if (x == null || !x.isUncertainty) { +function highestUncertainty(x, y) { + if (!x?.isUncertainty) { x = new uncertainty_1.Uncertainty(x); } - if (y == null || !y.isUncertainty) { + if (!y?.isUncertainty) { y = new uncertainty_1.Uncertainty(y); } - const low = x.low > y.low ? x.low : y.low; - const high = x.high > y.high ? x.high : y.high; - if (low !== high) { - return new uncertainty_1.Uncertainty(low, high); + // Note: If the following comparisons result in null, we're dealing with date imprecision. + // The spec doesn't currently say what to do; but it will be updated to indicate that the + // coursest precision should be used (which is consistent with collapse) + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609310186 + let low; + const xLowIsHigher = cmp.greaterThan(x.low, y.low); + if (xLowIsHigher == null && x.low?.isLessPrecise) { + low = x.low.isLessPrecise(y.low) ? x.low : y.low; } else { + low = xLowIsHigher ? x.low : y.low; + } + let high; + const xHighIsHigher = cmp.greaterThan(x.high, y.high); + if (xHighIsHigher == null && x.high?.isLessPrecise) { + high = x.high.isLessPrecise(y.high) ? x.high : y.high; + } + else { + high = xHighIsHigher ? x.high : y.high; + } + // use equivalent to consider nulls equal + if (cmp.equivalent(low, high)) { return low; } + return new uncertainty_1.Uncertainty(low, high); } },{"../util/comparison":53,"../util/elmTypes":55,"../util/math":57,"./logic":11,"./quantity":12,"./uncertainty":14}],11:[function(require,module,exports){ @@ -2507,7 +2588,7 @@ exports.ThreeValuedLogic = ThreeValuedLogic; },{}],12:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Quantity = void 0; +exports.MAX_QUANTITY_VALUE = exports.MIN_QUANTITY_VALUE = exports.Quantity = void 0; exports.parseQuantity = parseQuantity; exports.doAddition = doAddition; exports.doSubtraction = doSubtraction; @@ -2647,6 +2728,10 @@ class Quantity { } } exports.Quantity = Quantity; +// Require MIN/MAX here because math.js requires this file, and when we make this file require +// math.js before it exports DateTime and Date, it errors due to the circular dependency... +exports.MIN_QUANTITY_VALUE = new Quantity(math_1.MIN_FLOAT_VALUE, '1'); +exports.MAX_QUANTITY_VALUE = new Quantity(math_1.MAX_FLOAT_VALUE, '1'); function parseQuantity(str) { const components = /([+|-]?\d+\.?\d*)\s*('(.+)')?/.exec(str); if (components != null && components[1] != null) { @@ -4713,6 +4798,9 @@ class Expression { if (json.resultTypeName != null) { this.resultTypeName = json.resultTypeName; } + if (json.resultTypeSpecifier != null) { + this.resultTypeSpecifier = json.resultTypeSpecifier; + } } async execute(ctx) { try { @@ -5004,7 +5092,6 @@ const math_1 = require("../util/math"); const units_1 = require("../util/units"); const dtivl = __importStar(require("../datatypes/interval")); const builder_1 = require("./builder"); -const elmTypes_1 = require("../util/elmTypes"); class Interval extends expression_1.Expression { constructor(json) { super(json); @@ -5014,6 +5101,7 @@ class Interval extends expression_1.Expression { this.highClosedExpression = (0, builder_1.build)(json.highClosedExpression); this.low = (0, builder_1.build)(json.low); this.high = (0, builder_1.build)(json.high); + this.pointType = this.resultTypeSpecifier?.pointType?.name; } // Define a simple getter to allow type-checking of this class without instanceof // and in a way that survives minification (as opposed to checking constructor.name) @@ -5029,18 +5117,7 @@ class Interval extends expression_1.Expression { const highClosed = this.highClosed != null ? this.highClosed : this.highClosedExpression && (await this.highClosedExpression.execute(ctx)); - let defaultPointType; - if (lowValue == null && highValue == null) { - // try to get the default point type from a cast - if (this.low.asTypeSpecifier && this.low.asTypeSpecifier.type === elmTypes_1.ELM_NAMED_TYPE_SPECIFIER) { - defaultPointType = this.low.asTypeSpecifier.name; - } - else if (this.high.asTypeSpecifier && - this.high.asTypeSpecifier.type === elmTypes_1.ELM_NAMED_TYPE_SPECIFIER) { - defaultPointType = this.high.asTypeSpecifier.name; - } - } - return new dtivl.Interval(lowValue, highValue, lowClosed, highClosed, defaultPointType); + return new dtivl.Interval(lowValue, highValue, lowClosed, highClosed, this.pointType); } } exports.Interval = Interval; @@ -5474,12 +5551,12 @@ class Expand extends expression_1.Expression { low = this.truncateToPrecision(low, per.unit); high = this.truncateToPrecision(high, per.unit); let current_high = current_low.add(per.value, per.unit).predecessor(); - let intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); + let intervalToAdd = new dtivl.Interval(current_low, current_high, true, true, interval.pointType); while (intervalToAdd.high.sameOrBefore(high)) { results.push(intervalToAdd); current_low = current_low.add(per.value, per.unit); current_high = current_low.add(per.value, per.unit).predecessor(); - intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); + intervalToAdd = new dtivl.Interval(current_low, current_high, true, true, interval.pointType); } return results; } @@ -5747,7 +5824,7 @@ function truncateDecimal(decimal, decimalPlaces) { return parseFloat(decimal.toString().match(re)[0]); } -},{"../datatypes/interval":10,"../datatypes/quantity":12,"../util/elmTypes":55,"../util/math":57,"../util/units":58,"./builder":17,"./expression":23}],28:[function(require,module,exports){ +},{"../datatypes/interval":10,"../datatypes/quantity":12,"../util/math":57,"../util/units":58,"./builder":17,"./expression":23}],28:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Library = void 0; @@ -9138,7 +9215,7 @@ exports.greaterThan = greaterThan; exports.greaterThanOrEquals = greaterThanOrEquals; exports.equivalent = equivalent; exports.equals = equals; -const datatypes_1 = require("../datatypes/datatypes"); +const uncertainty_1 = require("../datatypes/uncertainty"); function areNumbers(a, b) { return typeof a === 'number' && typeof b === 'number'; } @@ -9154,7 +9231,7 @@ function areDateTimesOrQuantities(a, b) { (a && a.isQuantity && b && b.isQuantity)); } function isUncertainty(x) { - return x instanceof datatypes_1.Uncertainty; + return x instanceof uncertainty_1.Uncertainty; } function lessThan(a, b, precision) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { @@ -9167,7 +9244,7 @@ function lessThan(a, b, precision) { return a.lessThan(b); } else if (isUncertainty(b)) { - return datatypes_1.Uncertainty.from(a).lessThan(b); + return uncertainty_1.Uncertainty.from(a).lessThan(b); } else { return null; @@ -9184,7 +9261,7 @@ function lessThanOrEquals(a, b, precision) { return a.lessThanOrEquals(b); } else if (isUncertainty(b)) { - return datatypes_1.Uncertainty.from(a).lessThanOrEquals(b); + return uncertainty_1.Uncertainty.from(a).lessThanOrEquals(b); } else { return null; @@ -9201,7 +9278,7 @@ function greaterThan(a, b, precision) { return a.greaterThan(b); } else if (isUncertainty(b)) { - return datatypes_1.Uncertainty.from(a).greaterThan(b); + return uncertainty_1.Uncertainty.from(a).greaterThan(b); } else { return null; @@ -9218,7 +9295,7 @@ function greaterThanOrEquals(a, b, precision) { return a.greaterThanOrEquals(b); } else if (isUncertainty(b)) { - return datatypes_1.Uncertainty.from(a).greaterThanOrEquals(b); + return uncertainty_1.Uncertainty.from(a).greaterThanOrEquals(b); } else { return null; @@ -9331,11 +9408,11 @@ function equals(a, b) { return a.equals(b); } // If one is an Uncertainty, convert the other to an Uncertainty - if (a instanceof datatypes_1.Uncertainty) { - b = datatypes_1.Uncertainty.from(b); + if (a instanceof uncertainty_1.Uncertainty) { + b = uncertainty_1.Uncertainty.from(b); } - else if (b instanceof datatypes_1.Uncertainty) { - a = datatypes_1.Uncertainty.from(a); + else if (b instanceof uncertainty_1.Uncertainty) { + a = uncertainty_1.Uncertainty.from(a); } // Use overloaded 'equals' function if it is available if (typeof a.equals === 'function') { @@ -9377,7 +9454,7 @@ function equals(a, b) { return false; } -},{"../datatypes/datatypes":7}],54:[function(require,module,exports){ +},{"../datatypes/uncertainty":14}],54:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnnotatedError = void 0; @@ -9400,8 +9477,9 @@ exports.AnnotatedError = AnnotatedError; },{}],55:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ELM_CHOICE_TYPE_SPECIFIER = exports.ELM_INTERVAL_TYPE_SPECIFIER = exports.ELM_TUPLE_TYPE_SPECIFIER = exports.ELM_LIST_TYPE_SPECIFIER = exports.ELM_NAMED_TYPE_SPECIFIER = exports.ELM_TIME_TYPE = exports.ELM_STRING_TYPE = exports.ELM_QUANTITY_TYPE = exports.ELM_LONG_TYPE = exports.ELM_INTEGER_TYPE = exports.ELM_DECIMAL_TYPE = exports.ELM_DATETIME_TYPE = exports.ELM_DATE_TYPE = exports.ELM_CONCEPT_TYPE = exports.ELM_BOOLEAN_TYPE = void 0; +exports.ELM_CHOICE_TYPE_SPECIFIER = exports.ELM_INTERVAL_TYPE_SPECIFIER = exports.ELM_TUPLE_TYPE_SPECIFIER = exports.ELM_LIST_TYPE_SPECIFIER = exports.ELM_NAMED_TYPE_SPECIFIER = exports.ELM_TIME_TYPE = exports.ELM_STRING_TYPE = exports.ELM_QUANTITY_TYPE = exports.ELM_LONG_TYPE = exports.ELM_INTEGER_TYPE = exports.ELM_DECIMAL_TYPE = exports.ELM_DATETIME_TYPE = exports.ELM_DATE_TYPE = exports.ELM_CONCEPT_TYPE = exports.ELM_BOOLEAN_TYPE = exports.ELM_ANY_TYPE = void 0; // Simple Types +exports.ELM_ANY_TYPE = '{urn:hl7-org:elm-types:r1}Any'; exports.ELM_BOOLEAN_TYPE = '{urn:hl7-org:elm-types:r1}Boolean'; exports.ELM_CONCEPT_TYPE = '{urn:hl7-org:elm-types:r1}Concept'; exports.ELM_DATE_TYPE = '{urn:hl7-org:elm-types:r1}Date'; @@ -9604,6 +9682,7 @@ exports.decimalAdjust = decimalAdjust; exports.decimalOrNull = decimalOrNull; exports.decimalLongOrNull = decimalLongOrNull; const exception_1 = require("../datatypes/exception"); +const quantity_1 = require("../datatypes/quantity"); const datetime_1 = require("../datatypes/datetime"); const uncertainty_1 = require("../datatypes/uncertainty"); const elmTypes_1 = require("./elmTypes"); @@ -9902,9 +9981,14 @@ function maxValueForInstance(val) { return exports.MAX_DATE_VALUE?.copy(); } else if (val && val.isQuantity) { - const val2 = val.clone(); - val2.value = maxValueForInstance(val2.value); - return val2; + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const maxQuantity = quantity_1.MAX_QUANTITY_VALUE.clone(); + if (val.unit) { + maxQuantity.unit = val.unit; + } + return maxQuantity; } else { return null; @@ -9925,13 +10009,17 @@ function maxValueForType(type, quantityInstance) { case elmTypes_1.ELM_TIME_TYPE: return exports.MAX_TIME_VALUE?.copy(); case elmTypes_1.ELM_QUANTITY_TYPE: { + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const maxQuantity = quantity_1.MAX_QUANTITY_VALUE.clone(); if (quantityInstance == null) { - // can't infer a quantity unit type from nothing] - return null; + return maxQuantity; + } + if (quantityInstance.unit) { + maxQuantity.unit = quantityInstance.unit; } - const maxQty = quantityInstance.clone(); - maxQty.value = exports.MAX_FLOAT_VALUE; - return maxQty; + return maxQuantity; } } return null; @@ -9958,9 +10046,14 @@ function minValueForInstance(val) { return exports.MIN_DATE_VALUE?.copy(); } else if (val && val.isQuantity) { - const val2 = val.clone(); - val2.value = minValueForInstance(val2.value); - return val2; + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const minQuantity = quantity_1.MIN_QUANTITY_VALUE.clone(); + if (val.unit) { + minQuantity.unit = val.unit; + } + return minQuantity; } else { return null; @@ -9981,13 +10074,17 @@ function minValueForType(type, quantityInstance) { case elmTypes_1.ELM_TIME_TYPE: return exports.MIN_TIME_VALUE?.copy(); case elmTypes_1.ELM_QUANTITY_TYPE: { + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const minQuantity = quantity_1.MIN_QUANTITY_VALUE.clone(); if (quantityInstance == null) { - // can't infer a quantity unit type from nothing] - return null; + return minQuantity; + } + if (quantityInstance.unit) { + minQuantity.unit = quantityInstance.unit; } - const minQty = quantityInstance.clone(); - minQty.value = exports.MIN_FLOAT_VALUE; - return minQty; + return minQuantity; } } return null; @@ -10022,7 +10119,7 @@ function decimalLongOrNull(value) { : null; } -},{"../datatypes/datetime":8,"../datatypes/exception":9,"../datatypes/uncertainty":14,"./elmTypes":55}],58:[function(require,module,exports){ +},{"../datatypes/datetime":8,"../datatypes/exception":9,"../datatypes/quantity":12,"../datatypes/uncertainty":14,"./elmTypes":55}],58:[function(require,module,exports){ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; diff --git a/src/cql-patient.ts b/src/cql-patient.ts index 5b081ebf..0aa5e06a 100644 --- a/src/cql-patient.ts +++ b/src/cql-patient.ts @@ -1,6 +1,6 @@ import * as DT from './datatypes/datatypes'; import { DataProvider, NamedTypeSpecifier, PatientObject, RecordObject } from './types'; -import { ELM_NAMED_TYPE_SPECIFIER } from './util/elmTypes'; +import { ELM_ANY_TYPE, ELM_NAMED_TYPE_SPECIFIER } from './util/elmTypes'; export class Record implements RecordObject { json: any; @@ -27,7 +27,7 @@ export class Record implements RecordObject { name: '{https://github.com/cqframework/cql-execution/simple}Record', type: ELM_NAMED_TYPE_SPECIFIER }, - { name: '{urn:hl7-org:elm-types:r1}Any', type: ELM_NAMED_TYPE_SPECIFIER } + { name: ELM_ANY_TYPE, type: ELM_NAMED_TYPE_SPECIFIER } ]; } diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index 0c6536a1..b3f5dc6b 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -4,10 +4,10 @@ import { ThreeValuedLogic } from './logic'; import { successor, predecessor, - maxValueForInstance, - minValueForInstance, maxValueForType, - minValueForType + minValueForType, + minValueForInstance, + maxValueForInstance } from '../util/math'; import * as cmp from '../util/comparison'; import { @@ -17,7 +17,8 @@ import { ELM_TIME_TYPE, ELM_DATE_TYPE, ELM_DATETIME_TYPE, - ELM_QUANTITY_TYPE + ELM_QUANTITY_TYPE, + ELM_ANY_TYPE } from '../util/elmTypes'; export class Interval { @@ -26,10 +27,34 @@ export class Interval { public high: any, public lowClosed?: boolean | null, public highClosed?: boolean | null, - public defaultPointType?: any // defaultPointType is used in the case that both endpoints are null + public pointType: any = ELM_ANY_TYPE ) { this.lowClosed = lowClosed != null ? lowClosed : true; this.highClosed = highClosed != null ? highClosed : true; + if (this.pointType == null || this.pointType === ELM_ANY_TYPE) { + let point = low ?? high; + if (point?.isUncertainty) { + point = (point as Uncertainty).low ?? (point as Uncertainty).high; + } + if (point != null) { + if (typeof point === 'number') { + this.pointType = Number.isInteger(point) ? ELM_INTEGER_TYPE : ELM_DECIMAL_TYPE; + } else if (typeof point === 'bigint') { + this.pointType = ELM_LONG_TYPE; + } else if (point.isTime && point.isTime()) { + this.pointType = ELM_TIME_TYPE; + } else if (point.isDate) { + this.pointType = ELM_DATE_TYPE; + } else if (point.isDateTime) { + this.pointType = ELM_DATETIME_TYPE; + } else if (point.isQuantity) { + this.pointType = ELM_QUANTITY_TYPE; + } + } + if (this.pointType == null) { + this.pointType = ELM_ANY_TYPE; + } + } } get isInterval() { @@ -44,30 +69,6 @@ export class Interval { return this.low == null && !this.lowClosed && this.high == null && !this.highClosed; } - get pointType() { - let pointType = null; - const point = this.low != null ? this.low : this.high; - if (point != null) { - if (typeof point === 'number') { - pointType = Number.isInteger(point) ? ELM_INTEGER_TYPE : ELM_DECIMAL_TYPE; - } else if (typeof point === 'bigint') { - pointType = ELM_LONG_TYPE; - } else if (point.isTime && point.isTime()) { - pointType = ELM_TIME_TYPE; - } else if (point.isDate) { - pointType = ELM_DATE_TYPE; - } else if (point.isDateTime) { - pointType = ELM_DATETIME_TYPE; - } else if (point.isQuantity) { - pointType = ELM_QUANTITY_TYPE; - } - } - if (pointType == null && this.defaultPointType != null) { - pointType = this.defaultPointType; - } - return pointType; - } - copy() { let newLow = this.low; let newHigh = this.high; @@ -78,231 +79,244 @@ export class Interval { newHigh = this.high.copy(); } - return new Interval(newLow, newHigh, this.lowClosed, this.highClosed); + return new Interval(newLow, newHigh, this.lowClosed, this.highClosed, this.pointType); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#contains contains(item: any, precision?: any) { - // These first two checks ensure correct handling of edge case where an item equals the closed boundary - if (this.lowClosed && this.low != null && cmp.equals(this.low, item)) { - return true; - } - if (this.highClosed && this.high != null && cmp.equals(this.high, item)) { - return true; - } if (item != null && item.isInterval) { throw new Error('Argument to contains must be a point'); } - let lowFn; - if (this.lowClosed && this.low == null) { - lowFn = () => true; - } else if (this.lowClosed) { - lowFn = cmp.lessThanOrEquals; - } else { - lowFn = cmp.lessThan; - } - let highFn; - if (this.highClosed && this.high == null) { - highFn = () => true; - } else if (this.highClosed) { - highFn = cmp.greaterThanOrEquals; - } else { - highFn = cmp.greaterThan; - } + // "The contains operator for intervals returns true if the given point is equal to the starting + // or ending point of the interval, or greater than the starting point and less than the ending + // point... If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." return ThreeValuedLogic.and( - lowFn(this.low, item, precision), - highFn(this.high, item, precision) + cmp.greaterThanOrEquals(item, this.start(), precision), + cmp.lessThanOrEquals(item, this.end(), precision) ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#properly-includes properlyIncludes(other: any, precision?: any) { + // TODO: "For the interval-point overload, this operator returns true if the interval contains + // (i.e. includes) the point, and the interval is not a unit interval containing only the + // point." if (other == null || !other.isInterval) { throw new Error('Argument to properlyIncludes must be an interval'); } + // "... the starting point of the first interval is less than or equal to the starting point of + // the second interval, and the ending point of the first interval is greater than or equal to + // the ending point of the second interval, and they are not the same interval... If precision + // is specified and the point type is a Date, DateTime, or Time type, comparisons used in the + // operation are performed at the specified precision." return ThreeValuedLogic.and( - this.includes(other, precision), + cmp.lessThanOrEquals(this.start(), other.start(), precision), + cmp.greaterThanOrEquals(this.end(), other.end(), precision), ThreeValuedLogic.not(other.includes(this, precision)) ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#includes includes(other: any, precision?: any) { - if (other == null || !other.isInterval) { + // "For the interval-interval overload, if either argument is null, the result is null." + if (other == null) { + return null; + } + // "For the point-interval overload, this operator is a synonym for the contains operator." + else if (!other.isInterval) { return this.contains(other, precision); } - const a = this.toClosed(); - const b = other.toClosed(); + // "... the starting point of the first interval is less than or equal to the starting point of + // the second interval, and the ending point of the first interval is greater than or equal to + // the ending point of the second interval... If precision is specified and the point type is a + // Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." return ThreeValuedLogic.and( - cmp.lessThanOrEquals(a.low, b.low, precision), - cmp.greaterThanOrEquals(a.high, b.high, precision) + cmp.lessThanOrEquals(this.start(), other.start(), precision), + cmp.greaterThanOrEquals(this.end(), other.end(), precision) ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#included-in includedIn(other: any, precision?: any) { - // For the point overload, this operator is a synonym for the in operator - if (other == null || !other.isInterval) { - return this.contains(other, precision); - } else { - return other.includes(this); - } + // "For the interval-interval overload, if either argument is null, the result is null." + if (other == null) { + return null; + } else if (other == null || !other.isInterval) { + throw new Error('Argument to includedIn must be an interval'); + } + // "... the starting point of the first interval is greater than or equal to the starting point + // of the second interval, and the ending point of the first interval is less than or equal to + // the ending point of the second interval... If precision is specified and the point type is a + // Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." + return ThreeValuedLogic.and( + cmp.greaterThanOrEquals(this.start(), other.start(), precision), + cmp.lessThanOrEquals(this.end(), other.end(), precision) + ); } - overlaps(item: any, precision?: any) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlaps(other: any, precision?: any) { + // "If either argument is null, the result is null." + if (other == null) { return null; - } else if (this.isBoundlessInterval || item?.isBoundlessInterval) { - return true; } - const closed = this.toClosed(); - const [low, high] = (() => { - if (item != null && item.isInterval) { - const itemClosed = item.toClosed(); - return [itemClosed.low, itemClosed.high]; - } else { - return [item, item]; - } - })(); + // "... the ending point of the first interval is greater than or equal to the starting point + // of the second interval, and the starting point of the first interval is less than or equal + // to the ending point of the second interval... If precision is specified and the point type + // is a Date, DateTime, or Time type, comparisons used in the operation are performed at the + // specified precision." return ThreeValuedLogic.and( - cmp.lessThanOrEquals(closed.low, high, precision), - cmp.greaterThanOrEquals(closed.high, low, precision) + cmp.greaterThanOrEquals(this.end(), other.start(), precision), + cmp.lessThanOrEquals(this.start(), other.end(), precision) ); } - overlapsAfter(item: any, precision?: any) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlapsAfter(other: any, precision?: any) { + // "If either argument is null, the result is null." + if (other == null) { return null; } - const high = item != null && item.isInterval ? item.toClosed().high : item; - if (this.isBoundlessInterval) { - return cmp.lessThan(high, maxValueForInstance(high), precision); - } else if (item?.isBoundlessInterval) { - return false; - } - const closed = this.toClosed(); + // "... the overlaps after operator returns true if the first interval overlaps the second + // and ends after it." return ThreeValuedLogic.and( - cmp.lessThanOrEquals(closed.low, high, precision), - cmp.greaterThan(closed.high, high, precision) + cmp.lessThanOrEquals(this.start(), other.end(), precision), + cmp.greaterThan(this.end(), other.end(), precision) ); } - overlapsBefore(item: any, precision?: any) { - if (this.isUnknownInterval || item == null || item.isUnknownInterval) { + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#overlaps + overlapsBefore(other: any, precision?: any) { + // "If either argument is null, the result is null." + if (other == null) { return null; } - const low = item != null && item.isInterval ? item.toClosed().low : item; - if (this.isBoundlessInterval) { - return cmp.greaterThan(low, minValueForInstance(low), precision); - } else if (item?.isBoundlessInterval) { - return false; - } - const closed = this.toClosed(); + // "The operator overlaps before returns true if the first interval overlaps the second and + // starts before it..." return ThreeValuedLogic.and( - cmp.lessThan(closed.low, low, precision), - cmp.greaterThanOrEquals(closed.high, low, precision) + cmp.greaterThanOrEquals(this.end(), other.start(), precision), + cmp.lessThan(this.start(), other.start(), precision) ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#union union(other: any) { - if (other == null || !other.isInterval) { + // "If either argument is null, the result is null." + if (other == null) { + return null; + } else if (!other.isInterval) { throw new Error('Argument to union must be an interval'); } - // Note that interval union is only defined if the arguments overlap or meet. - if (this.overlaps(other) || this.meets(other)) { - const [a, b] = [this.toClosed(), other.toClosed()]; - let l, lc; - if (cmp.lessThanOrEquals(a.low, b.low)) { - [l, lc] = [this.low, this.lowClosed]; - } else if (cmp.greaterThanOrEquals(a.low, b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } else if (areNumeric(a.low, b.low)) { - [l, lc] = [lowestNumericUncertainty(a.low, b.low), true]; - // TODO: Do we need to support quantities here? - } else if (areDateTimes(a.low, b.low) && a.low.isMorePrecise(b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } else { - [l, lc] = [this.low, this.lowClosed]; - } - let h, hc; - if (cmp.greaterThanOrEquals(a.high, b.high)) { - [h, hc] = [this.high, this.highClosed]; - } else if (cmp.lessThanOrEquals(a.high, b.high)) { - [h, hc] = [other.high, other.highClosed]; - } else if (areNumeric(a.high, b.high)) { - [h, hc] = [highestNumericUncertainty(a.high, b.high), true]; - // TODO: Do we need to support quantities here? - } else if (areDateTimes(a.high, b.high) && a.high.isMorePrecise(b.high)) { - [h, hc] = [other.high, other.highClosed]; - } else { - [h, hc] = [this.high, this.highClosed]; - } - return new Interval(l, h, lc, hc); - } else { + + // "If the arguments do not overlap or meet, this operator returns null." + if (!this.overlaps(other) && !this.meets(other)) { return null; } + + // "... the operator returns the interval that starts at the earliest starting point in either + // argument, and ends at the latest ending point in either argument." + let earliestStart; + + const thisIsEarlier = cmp.lessThan(this.start(), other.start()); + if (thisIsEarlier == null) { + earliestStart = lowestUncertainty(this.start(), other.start()); + } else { + earliestStart = thisIsEarlier ? this.start() : other.start(); + } + let latestEnd; + + const thisIsLater = cmp.greaterThan(this.end(), other.end()); + if (thisIsLater == null) { + latestEnd = highestUncertainty(this.end(), other.end()); + } else { + latestEnd = thisIsLater ? this.end() : other.end(); + } + + return normalizeInterval( + new Interval(earliestStart, latestEnd, true, true, this.pointType ?? other.pointType) + ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#intersect intersect(other: any) { - if (other == null || !other.isInterval) { - throw new Error('Argument to union must be an interval'); + // "If either argument is null, the result is null." + if (other == null) { + return null; + } else if (!other.isInterval) { + throw new Error('Argument to intersect must be an interval'); } - // Note that interval union is only defined if the arguments overlap. - if (this.overlaps(other)) { - const [a, b] = [this.toClosed(), other.toClosed()]; - let l, lc; - if (cmp.greaterThanOrEquals(a.low, b.low)) { - [l, lc] = [this.low, this.lowClosed]; - } else if (cmp.lessThanOrEquals(a.low, b.low)) { - [l, lc] = [other.low, other.lowClosed]; - } else if (areNumeric(a.low, b.low)) { - [l, lc] = [highestNumericUncertainty(a.low, b.low), true]; - // TODO: Do we need to support quantities here? - } else if (areDateTimes(a.low, b.low) && b.low.isMorePrecise(a.low)) { - [l, lc] = [other.low, other.lowClosed]; - } else { - [l, lc] = [this.low, this.lowClosed]; - } - let h, hc; - if (cmp.lessThanOrEquals(a.high, b.high)) { - [h, hc] = [this.high, this.highClosed]; - } else if (cmp.greaterThanOrEquals(a.high, b.high)) { - [h, hc] = [other.high, other.highClosed]; - } else if (areNumeric(a.high, b.high)) { - [h, hc] = [lowestNumericUncertainty(a.high, b.high), true]; - // TODO: Do we need to support quantities here? - } else if (areDateTimes(a.high, b.high) && b.high.isMorePrecise(a.high)) { - [h, hc] = [other.high, other.highClosed]; - } else { - [h, hc] = [this.high, this.highClosed]; - } - return new Interval(l, h, lc, hc); - } else { + + // "If the arguments do not overlap, this operator returns null." + if (!this.overlaps(other)) { return null; } + + // "... the operator returns the interval that defines the overlapping portion of both arguments." + // Note: This spec definition isn't very precise, so we'll approach it similar to union: + // The interval that starts at the latest starting point in either argument, and ends at the + // earliest ending point in either argument. + let latestStart; + const thisIsLater = cmp.greaterThan(this.start(), other.start()); + if (thisIsLater == null) { + latestStart = highestUncertainty(this.start(), other.start()); + } else { + latestStart = thisIsLater ? this.start() : other.start(); + } + let earliestEnd; + const thisIsEarlier = cmp.lessThan(this.end(), other.end()); + if (thisIsEarlier == null) { + earliestEnd = lowestUncertainty(this.end(), other.end()); + } else { + earliestEnd = thisIsEarlier ? this.end() : other.end(); + } + + return normalizeInterval( + new Interval(latestStart, earliestEnd, true, true, this.pointType ?? other.pointType) + ); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#except except(other: any) { + // "If either argument is null, the result is null." if (other === null) { return null; - } - if (other == null || !other.isInterval) { + } else if (!other.isInterval) { throw new Error('Argument to except must be an interval'); } - const ol = this.overlaps(other); - if (ol === true) { - const olb = this.overlapsBefore(other); - const ola = this.overlapsAfter(other); - if (olb === true && ola === false) { - return new Interval(this.low, other.low, this.lowClosed, !other.lowClosed); - } else if (ola === true && olb === false) { - return new Interval(other.high, this.high, !other.highClosed, this.highClosed); - } else { - return null; - } - } else if (ol === false) { - return this; - } else { - // ol is null - return null; + // "... this operator returns the portion of the first interval that does not overlap with the second." + // Unresolved zulip: https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609516976 + let precision; + if ( + this.pointType === ELM_DATE_TYPE || + this.pointType === ELM_DATETIME_TYPE || + this.pointType === ELM_TIME_TYPE + ) { + const boundaries = [this.low, this.high, other.low, other.high]; + const leastPreciseBoundary = boundaries.reduce((least, boundary) => + boundary?.isLessPrecise(least) ? boundary : least + ); + precision = leastPreciseBoundary?.getPrecision(); + } + + if (this.overlaps(other, precision) === false) { + return this.copy(); } + + const overlapsBefore = this.overlapsBefore(other, precision); + const overlapsAfter = this.overlapsAfter(other, precision); + if (overlapsBefore && !overlapsAfter) { + return normalizeInterval( + new Interval(this.start(), other.start(), true, false, this.pointType) + ); + } else if (overlapsAfter && !overlapsBefore) { + return normalizeInterval(new Interval(other.end(), this.end(), false, true, this.pointType)); + } + + return null; } sameAs(other: any, precision?: any) { @@ -385,6 +399,9 @@ export class Interval { } sameOrBefore(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return this.equals(other); + } if (this.end() == null || other == null || other.start() == null) { return null; } else { @@ -393,6 +410,9 @@ export class Interval { } sameOrAfter(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return this.equals(other); + } if (this.start() == null || other == null || other.end() == null) { return null; } else { @@ -402,6 +422,11 @@ export class Interval { equals(other: any) { if (other != null && other.isInterval) { + if (this.isBoundlessInterval) { + return other.isBoundlessInterval ? true : other.isUnknownInterval ? null : false; + } else if (other.isBoundlessInterval) { + return this.isUnknownInterval ? null : false; + } const [a, b] = [this.toClosed(), other.toClosed()]; return ThreeValuedLogic.and(cmp.equals(a.low, b.low), cmp.equals(a.high, b.high)); } else { @@ -410,6 +435,9 @@ export class Interval { } after(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } const closed = this.toClosed(); // Meets spec, but not 100% correct (e.g., (null, 5] after [6, 10] --> null) // Simple way to fix it: and w/ not overlaps @@ -421,6 +449,9 @@ export class Interval { } before(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } const closed = this.toClosed(); // Meets spec, but not 100% correct (e.g., (null, 5] after [6, 10] --> null) // Simple way to fix it: and w/ not overlaps @@ -432,6 +463,9 @@ export class Interval { } meets(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } return ThreeValuedLogic.or( this.meetsBefore(other, precision), this.meetsAfter(other, precision) @@ -439,6 +473,9 @@ export class Interval { } meetsAfter(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } try { if (precision != null && this.low != null && this.low.isDateTime) { return this.toClosed().low.sameAs( @@ -454,6 +491,9 @@ export class Interval { } meetsBefore(other: any, precision?: any) { + if (this.isBoundlessInterval || other?.isBoundlessInterval) { + return false; + } try { if (precision != null && this.high != null && this.high.isDateTime) { return this.toClosed().high.sameAs( @@ -470,46 +510,92 @@ export class Interval { start() { if (this.low == null) { - if (this.lowClosed) { - return minValueForInstance(this.high); + const quantityInstance = + this.high && this.pointType == ELM_QUANTITY_TYPE ? this.high : undefined; + const minValue = minValueForType(this.pointType, quantityInstance); + if (this.lowClosed || minValue == null) { + return minValue; } else { - return this.low; + const end = ((end: any) => (end.isUncertainty ? end.high : end))( + this.high == null ? maxValueForType(this.pointType) : this.end() + ); + return new Uncertainty(minValue, end); } } - return this.toClosed().low; + return this.lowClosed ? this.low : successor(this.low, this.pointType); } end() { if (this.high == null) { - if (this.highClosed) { - return maxValueForInstance(this.low); + const quantityInstance = + this.low && this.pointType == ELM_QUANTITY_TYPE ? this.low : undefined; + const maxValue = maxValueForType(this.pointType, quantityInstance); + if (this.highClosed || maxValue == null) { + return maxValue; } else { - return this.high; + const start = ((start: any) => (start.isUncertainty ? start.low : start))( + this.low == null ? minValueForType(this.pointType) : this.start() + ); + return new Uncertainty(start, maxValue); } } - return this.toClosed().high; + return this.highClosed ? this.high : predecessor(this.high, this.pointType); } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#starts starts(other: any, precision?: any) { - let startEqual; - if (precision != null && this.low != null && this.low.isDateTime) { - startEqual = this.low.sameAs(other.low, precision); + // "If either argument is null, the result is null." + if (other == null) { + return null; + } + + // "... the starting point of the first is equal to the starting point of the second interval + // and the ending point of the first interval is less than or equal to the ending point of the + // second interval." + if ( + precision && + [ELM_DATETIME_TYPE, ELM_DATE_TYPE, ELM_TIME_TYPE].includes(this.pointType ?? other.pointType) + ) { + // "If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." + return ThreeValuedLogic.and( + this.start().sameAs(other.start(), precision), + cmp.lessThanOrEquals(this.end(), other.end(), precision) + ); } else { - startEqual = cmp.equals(this.low, other.low); + return ThreeValuedLogic.and( + cmp.equals(this.start(), other.start()), + cmp.lessThanOrEquals(this.end(), other.end()) + ); } - const endLessThanOrEqual = cmp.lessThanOrEquals(this.high, other.high, precision); - return startEqual && endLessThanOrEqual; } + // https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#ends ends(other: any, precision?: any) { - let endEqual; - const startGreaterThanOrEqual = cmp.greaterThanOrEquals(this.low, other.low, precision); - if (precision != null && (this.low != null ? this.low.isDateTime : undefined)) { - endEqual = this.high.sameAs(other.high, precision); + // "If either argument is null, the result is null." + if (other == null) { + return null; + } + + // "... the starting point of the first interval is greater than or equal to the starting point + // of the second, and the ending point of the first interval is equal to the ending point of + // the second." + if ( + precision && + [ELM_DATETIME_TYPE, ELM_DATE_TYPE, ELM_TIME_TYPE].includes(this.pointType ?? other.pointType) + ) { + // "If precision is specified and the point type is a Date, DateTime, or Time type, + // comparisons used in the operation are performed at the specified precision." + return ThreeValuedLogic.and( + cmp.greaterThanOrEquals(this.start(), other.start(), precision), + this.end().sameAs(other.end(), precision) + ); } else { - endEqual = cmp.equals(this.high, other.high); + return ThreeValuedLogic.and( + cmp.greaterThanOrEquals(this.start(), other.start()), + cmp.equals(this.end(), other.end()) + ); } - return startGreaterThanOrEqual && endEqual; } width() { @@ -642,48 +728,115 @@ export class Interval { } } -function areDateTimes(x: any, y: any) { - return [x, y].every(z => z != null && z.isDateTime); -} +// Return an interval that uses the standard null boundary conventions if appropriate: +// - low closed boundary with min value for the type is changed to null closed boundary +// - high closed boundary with max value for the type is changed to null closed boundary +// - low open boundary that is uncertainty from min value of type to max value or interval high +// value is changed to null open boundary +// - high open boundary that is uncertainty from min value of type or interval low value to max +// value of type is changed to null open boundary +// +// TODO: Is this necessary? Do we care how it is represented if the representations have the same +// meaning? This does affect test expectations and representation of returned results for callers. +function normalizeInterval(interval: Interval) { + const ivl = interval.copy(); + if (ivl.low != null && ivl.lowClosed !== false) { + if (ivl.low.isUncertainty) { + const minValue = minValueForInstance(ivl.low.low); + const maxValue = maxValueForInstance(ivl.low.low); + if ( + cmp.equals(ivl.low.low, minValue) && + (cmp.equals(ivl.low.high, maxValue) || cmp.equals(ivl.low.high, ivl.high)) + ) { + ivl.low = null; + ivl.lowClosed = false; + } + } else if (cmp.equals(ivl.low, minValueForInstance(ivl.low))) { + ivl.low = null; + } + } + if (ivl.high != null && ivl.highClosed !== false) { + if (ivl.high.isUncertainty) { + const minValue = minValueForInstance(ivl.high.low); + const maxValue = maxValueForInstance(ivl.high.low); + if ( + cmp.equals(ivl.high.high, maxValue) && + (cmp.equals(ivl.high.low, minValue) || cmp.equals(ivl.high.low, ivl.low)) + ) { + ivl.high = null; + ivl.highClosed = false; + } + } else if (cmp.equals(ivl.high, maxValueForInstance(ivl.high))) { + ivl.high = null; + } + } -function areNumeric(x: any, y: any) { - return [x, y].every(z => { - return ( - typeof z === 'number' || - typeof z === 'bigint' || - (z != null && z.isUncertainty && (typeof z.low === 'number' || typeof z.low === 'bigint')) - ); - }); + return ivl; } -function lowestNumericUncertainty(x: any, y: any) { - if (x == null || !x.isUncertainty) { +function lowestUncertainty(x: any, y: any) { + if (!x?.isUncertainty) { x = new Uncertainty(x); } - if (y == null || !y.isUncertainty) { + if (!y?.isUncertainty) { y = new Uncertainty(y); } - const low = x.low < y.low ? x.low : y.low; - const high = x.high < y.high ? x.high : y.high; - if (low !== high) { - return new Uncertainty(low, high); + + // Note: If the following comparisons result in null, we're dealing with date imprecision. + // The spec doesn't currently say what to do; but it will be updated to indicate that the + // coursest precision should be used (which is consistent with collapse) + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609310186 + let low; + const xLowIsLower = cmp.lessThan(x.low, y.low); + if (xLowIsLower == null && x.low?.isLessPrecise) { + low = x.low.isLessPrecise(y.low) ? x.low : y.low; + } else { + low = xLowIsLower ? x.low : y.low; + } + let high; + const xHighIsLower = cmp.lessThan(x.high, y.high); + if (xHighIsLower == null && x.high?.isLessPrecise) { + high = x.high.isLessPrecise(y.high) ? x.high : y.high; } else { + high = xHighIsLower ? x.high : y.high; + } + // use equivalent to consider nulls equal + if (cmp.equivalent(low, high)) { return low; } + return new Uncertainty(low, high); } -function highestNumericUncertainty(x: any, y: any) { - if (x == null || !x.isUncertainty) { +function highestUncertainty(x: any, y: any) { + if (!x?.isUncertainty) { x = new Uncertainty(x); } - if (y == null || !y.isUncertainty) { + if (!y?.isUncertainty) { y = new Uncertainty(y); } - const low = x.low > y.low ? x.low : y.low; - const high = x.high > y.high ? x.high : y.high; - if (low !== high) { - return new Uncertainty(low, high); + + // Note: If the following comparisons result in null, we're dealing with date imprecision. + // The spec doesn't currently say what to do; but it will be updated to indicate that the + // coursest precision should be used (which is consistent with collapse) + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Unions.20on.20Date.20Intervals.20w.2F.20Different.20Precision/near/609310186 + let low; + const xLowIsHigher = cmp.greaterThan(x.low, y.low); + if (xLowIsHigher == null && x.low?.isLessPrecise) { + low = x.low.isLessPrecise(y.low) ? x.low : y.low; + } else { + low = xLowIsHigher ? x.low : y.low; + } + let high; + const xHighIsHigher = cmp.greaterThan(x.high, y.high); + if (xHighIsHigher == null && x.high?.isLessPrecise) { + high = x.high.isLessPrecise(y.high) ? x.high : y.high; } else { + high = xHighIsHigher ? x.high : y.high; + } + + // use equivalent to consider nulls equal + if (cmp.equivalent(low, high)) { return low; } + return new Uncertainty(low, high); } diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index c115b2a1..3a83600c 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -1,5 +1,11 @@ import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; -import { decimalAdjust, isValidDecimal, overflowsOrUnderflows } from '../util/math'; +import { + decimalAdjust, + isValidDecimal, + MIN_FLOAT_VALUE, + MAX_FLOAT_VALUE, + overflowsOrUnderflows +} from '../util/math'; import { checkUnit, convertUnit, @@ -157,6 +163,11 @@ export class Quantity { } } +// Require MIN/MAX here because math.js requires this file, and when we make this file require +// math.js before it exports DateTime and Date, it errors due to the circular dependency... +export const MIN_QUANTITY_VALUE = new Quantity(MIN_FLOAT_VALUE, '1'); +export const MAX_QUANTITY_VALUE = new Quantity(MAX_FLOAT_VALUE, '1'); + export function parseQuantity(str: string) { const components = /([+|-]?\d+\.?\d*)\s*('(.+)')?/.exec(str); if (components != null && components[1] != null) { diff --git a/src/elm/expression.ts b/src/elm/expression.ts index cf14b99d..21d6e398 100644 --- a/src/elm/expression.ts +++ b/src/elm/expression.ts @@ -3,6 +3,7 @@ import { typeIsArray } from '../util/util'; import { AnnotatedError } from '../util/customErrors'; import { build } from './builder'; import { Library } from './library'; +import { AnyTypeSpecifier } from '../types'; export class Expression { localId?: string; @@ -10,6 +11,7 @@ export class Expression { arg?: Expression; args?: Expression[]; resultTypeName?: string; + resultTypeSpecifier?: AnyTypeSpecifier; constructor(json: any) { if (json.operand != null) { @@ -32,6 +34,10 @@ export class Expression { if (json.resultTypeName != null) { this.resultTypeName = json.resultTypeName; } + + if (json.resultTypeSpecifier != null) { + this.resultTypeSpecifier = json.resultTypeSpecifier; + } } async execute(ctx: Context) { diff --git a/src/elm/interval.ts b/src/elm/interval.ts index 71349304..139fb133 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -5,7 +5,7 @@ import { convertUnit, compareUnits, convertToCQLDateUnit } from '../util/units'; import * as dtivl from '../datatypes/interval'; import { Context } from '../runtime/context'; import { build } from './builder'; -import { ELM_NAMED_TYPE_SPECIFIER } from '../util/elmTypes'; +import { IntervalTypeSpecifier, NamedTypeSpecifier } from '../types/type-specifiers.interfaces'; export class Interval extends Expression { lowClosed: boolean; @@ -14,6 +14,7 @@ export class Interval extends Expression { highClosedExpression: any; low: any; high: any; + pointType?: string; constructor(json: any) { super(json); @@ -23,6 +24,9 @@ export class Interval extends Expression { this.highClosedExpression = build(json.highClosedExpression); this.low = build(json.low); this.high = build(json.high); + this.pointType = ( + (this.resultTypeSpecifier as IntervalTypeSpecifier)?.pointType as NamedTypeSpecifier + )?.name; } // Define a simple getter to allow type-checking of this class without instanceof @@ -42,19 +46,7 @@ export class Interval extends Expression { this.highClosed != null ? this.highClosed : this.highClosedExpression && (await this.highClosedExpression.execute(ctx)); - let defaultPointType; - if (lowValue == null && highValue == null) { - // try to get the default point type from a cast - if (this.low.asTypeSpecifier && this.low.asTypeSpecifier.type === ELM_NAMED_TYPE_SPECIFIER) { - defaultPointType = this.low.asTypeSpecifier.name; - } else if ( - this.high.asTypeSpecifier && - this.high.asTypeSpecifier.type === ELM_NAMED_TYPE_SPECIFIER - ) { - defaultPointType = this.high.asTypeSpecifier.name; - } - } - return new dtivl.Interval(lowValue, highValue, lowClosed, highClosed, defaultPointType); + return new dtivl.Interval(lowValue, highValue, lowClosed, highClosed, this.pointType); } } @@ -518,12 +510,18 @@ export class Expand extends Expression { high = this.truncateToPrecision(high, per.unit); let current_high = current_low.add(per.value, per.unit).predecessor(); - let intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); + let intervalToAdd = new dtivl.Interval( + current_low, + current_high, + true, + true, + interval.pointType + ); while (intervalToAdd.high.sameOrBefore(high)) { results.push(intervalToAdd); current_low = current_low.add(per.value, per.unit); current_high = current_low.add(per.value, per.unit).predecessor(); - intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); + intervalToAdd = new dtivl.Interval(current_low, current_high, true, true, interval.pointType); } return results; diff --git a/src/util/comparison.ts b/src/util/comparison.ts index ea2454bf..6456c673 100644 --- a/src/util/comparison.ts +++ b/src/util/comparison.ts @@ -1,4 +1,4 @@ -import { Uncertainty } from '../datatypes/datatypes'; +import { Uncertainty } from '../datatypes/uncertainty'; function areNumbers(a: any, b: any) { return typeof a === 'number' && typeof b === 'number'; diff --git a/src/util/elmTypes.ts b/src/util/elmTypes.ts index d5bc3407..e6179886 100644 --- a/src/util/elmTypes.ts +++ b/src/util/elmTypes.ts @@ -1,4 +1,5 @@ // Simple Types +export const ELM_ANY_TYPE = '{urn:hl7-org:elm-types:r1}Any'; export const ELM_BOOLEAN_TYPE = '{urn:hl7-org:elm-types:r1}Boolean'; export const ELM_CONCEPT_TYPE = '{urn:hl7-org:elm-types:r1}Concept'; export const ELM_DATE_TYPE = '{urn:hl7-org:elm-types:r1}Date'; diff --git a/src/util/math.ts b/src/util/math.ts index edc7a3c0..5e815a47 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -1,5 +1,5 @@ import { Exception } from '../datatypes/exception'; -import { Quantity } from '../datatypes/quantity'; +import { Quantity, MIN_QUANTITY_VALUE, MAX_QUANTITY_VALUE } from '../datatypes/quantity'; import { MIN_DATETIME_VALUE as dtMinDateTimeValue, MAX_DATETIME_VALUE as dtMaxDateTimeValue, @@ -279,9 +279,14 @@ export function maxValueForInstance(val: any) { } else if (val && val.isDate) { return MAX_DATE_VALUE?.copy(); } else if (val && val.isQuantity) { - const val2 = val.clone(); - val2.value = maxValueForInstance(val2.value); - return val2; + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const maxQuantity = MAX_QUANTITY_VALUE.clone(); + if (val.unit) { + maxQuantity.unit = val.unit; + } + return maxQuantity; } else { return null; } @@ -302,13 +307,17 @@ export function maxValueForType(type: string, quantityInstance?: Quantity) { case ELM_TIME_TYPE: return MAX_TIME_VALUE?.copy(); case ELM_QUANTITY_TYPE: { + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const maxQuantity = MAX_QUANTITY_VALUE.clone(); if (quantityInstance == null) { - // can't infer a quantity unit type from nothing] - return null; + return maxQuantity; + } + if (quantityInstance.unit) { + maxQuantity.unit = quantityInstance.unit; } - const maxQty = quantityInstance.clone(); - maxQty.value = MAX_FLOAT_VALUE; - return maxQty; + return maxQuantity; } } return null; @@ -330,9 +339,14 @@ export function minValueForInstance(val: any) { } else if (val && val.isDate) { return MIN_DATE_VALUE?.copy(); } else if (val && val.isQuantity) { - const val2 = val.clone(); - val2.value = minValueForInstance(val2.value); - return val2; + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const minQuantity = MIN_QUANTITY_VALUE.clone(); + if (val.unit) { + minQuantity.unit = val.unit; + } + return minQuantity; } else { return null; } @@ -353,13 +367,17 @@ export function minValueForType(type: string, quantityInstance?: Quantity) { case ELM_TIME_TYPE: return MIN_TIME_VALUE?.copy(); case ELM_QUANTITY_TYPE: { + // Although the spec says max Quantity has unit '1', it doesn't make sense to change the unit, + // especially if this is being used in the context of an interval or uncertainty since the + // left and right sides need to be comparable in those cases. + const minQuantity = MIN_QUANTITY_VALUE.clone(); if (quantityInstance == null) { - // can't infer a quantity unit type from nothing] - return null; + return minQuantity; + } + if (quantityInstance.unit) { + minQuantity.unit = quantityInstance.unit; } - const minQty = quantityInstance.clone(); - minQty.value = MIN_FLOAT_VALUE; - return minQty; + return minQuantity; } } return null; diff --git a/test-server/src/convert/convert.ts b/test-server/src/convert/convert.ts index feff0c3b..76d5201d 100644 --- a/test-server/src/convert/convert.ts +++ b/test-server/src/convert/convert.ts @@ -25,6 +25,7 @@ import { import { guessSpecifierType, typeToCqlTypeSpecifier, typeToCqlTypeString } from './cqlTypes'; import { emptyListParameter, nullValueParameter, emptyTupleParameter } from './specialParameters'; import logger from '../logger'; +import { ELM_ANY_TYPE } from '../../../lib/util/elmTypes'; const CQL_TO_UCUM_PRECISION = { year: 'a', @@ -38,7 +39,7 @@ const CQL_TO_UCUM_PRECISION = { export function toParameters(result: any | null, type?: string | AnyTypeSpecifier): Parameters { // If the type is null or is Any, try to guess a more specific type to get better conversion results - if (type == null || type === '{urn:hl7-org:elm-types:r1}Any') { + if (type == null || type === ELM_ANY_TYPE) { const guessedType = guessSpecifierType(result); if (guessedType) { type = guessedType; diff --git a/test-server/src/convert/cqlTypes.ts b/test-server/src/convert/cqlTypes.ts index be803651..ef5bd57d 100644 --- a/test-server/src/convert/cqlTypes.ts +++ b/test-server/src/convert/cqlTypes.ts @@ -8,9 +8,10 @@ import { AnyTypeSpecifier, Interval } from '../../..'; +import { ELM_ANY_TYPE } from '../../../lib/util/elmTypes'; export function typeToCqlTypeSpecifier( - typeOrSpecifier: string | AnyTypeSpecifier = '{urn:hl7-org:elm-types:r1}Any' + typeOrSpecifier: string | AnyTypeSpecifier = ELM_ANY_TYPE ): AnyTypeSpecifier { if (typeof typeOrSpecifier === 'string') { return { @@ -23,7 +24,7 @@ export function typeToCqlTypeSpecifier( // NOTE: Slightly modified from code in cql-execution: src/elm/type.ts export function typeToCqlTypeString( - typeOrSpecifier: string | AnyTypeSpecifier = '{urn:hl7-org:elm-types:r1}Any' + typeOrSpecifier: string | AnyTypeSpecifier = ELM_ANY_TYPE ): string { if (typeof typeOrSpecifier === 'string') { return typeOrSpecifier.replace('{urn:hl7-org:elm-types:r1}', 'System.'); diff --git a/test/datatypes/interval-data.ts b/test/datatypes/interval-data.ts index 15bac183..e22246ee 100644 --- a/test/datatypes/interval-data.ts +++ b/test/datatypes/interval-data.ts @@ -1,5 +1,6 @@ import { Interval } from '../../src/datatypes/interval'; -import { DateTime } from '../../src/datatypes/datetime'; +import { DateTime, Date } from '../../src/datatypes/datetime'; +import { Quantity } from '../../src/datatypes/quantity'; class TestDateTime { static parse(string: string) { @@ -43,23 +44,33 @@ class TestInterval { toMinute: Interval; toSecond: Interval; toMillisecond: Interval; + withNullStart: TestInterval; + withNullEnd: TestInterval; - constructor(low: any, high: any) { - const [thLow, thHigh] = Array.from([ - TestDateTime.fromDateTime(low), - TestDateTime.fromDateTime(high) - ]); + constructor(low: any, high: any, createNullVariants = true) { this.closed = new Interval(low, high, true, true); this.open = new Interval(low, high, false, false); this.closedOpen = new Interval(low, high, true, false); this.openClosed = new Interval(low, high, false, true); - this.toYear = new Interval(thLow.toYear, thHigh.toYear); - this.toMonth = new Interval(thLow.toMonth, thHigh.toMonth); - this.toDay = new Interval(thLow.toDay, thHigh.toDay); - this.toHour = new Interval(thLow.toHour, thHigh.toHour); - this.toMinute = new Interval(thLow.toMinute, thHigh.toMinute); - this.toSecond = new Interval(thLow.toSecond, thHigh.toSecond); - this.toMillisecond = new Interval(thLow.toMillisecond, thHigh.toMillisecond); + + if (low != null && high != null) { + const [thLow, thHigh] = Array.from([ + TestDateTime.fromDateTime(low), + TestDateTime.fromDateTime(high) + ]); + this.toYear = new Interval(thLow.toYear, thHigh.toYear); + this.toMonth = new Interval(thLow.toMonth, thHigh.toMonth); + this.toDay = new Interval(thLow.toDay, thHigh.toDay); + this.toHour = new Interval(thLow.toHour, thHigh.toHour); + this.toMinute = new Interval(thLow.toMinute, thHigh.toMinute); + this.toSecond = new Interval(thLow.toSecond, thHigh.toSecond); + this.toMillisecond = new Interval(thLow.toMillisecond, thHigh.toMillisecond); + } + + if (createNullVariants) { + this.withNullStart = new TestInterval(null, high, false); + this.withNullEnd = new TestInterval(low, null, false); + } } } @@ -94,6 +105,11 @@ export default () => { data['mid2012'] = TestDateTime.parse('2012-06-01T00:00:00.0'); data['end2012'] = TestDateTime.parse('2012-12-31T23:59:59.999'); data['aft2012'] = TestDateTime.parse('2013-06-01T00:00:00.0'); + data['all2012date'] = new TestInterval(Date.parse('2012-01-01'), Date.parse('2012-12-31')); + data['alldaytime'] = new TestInterval( + DateTime.parse('0001-01-01T00:00:00.0').getTime(), + DateTime.parse('0001-01-01T23:59:59.999').getTime() + ); data['dIvl'] = { sameAs: { // |----------X----------| @@ -276,5 +292,7 @@ export default () => { y: new TestInterval(0n, 100n) } }; + data['zeroPointFiveToNinePointFive'] = new TestInterval(0.5, 9.5); + data['zeroToHundredMg'] = new TestInterval(new Quantity(0, 'mg'), new Quantity(100, 'mg')); return data; }; diff --git a/test/datatypes/interval-test.ts b/test/datatypes/interval-test.ts index d6c34480..75d84c7c 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -1,15 +1,55 @@ import should from 'should'; -import { DateTime } from '../../src/datatypes/datetime'; +import { DateTime, Date } from '../../src/datatypes/datetime'; import { Interval } from '../../src/datatypes/interval'; +import { Quantity, MAX_QUANTITY_VALUE, MIN_QUANTITY_VALUE } from '../../src/datatypes/quantity'; import { Uncertainty } from '../../src/datatypes/uncertainty'; -import { ELM_DECIMAL_TYPE } from '../../src/util/elmTypes'; +import { + ELM_DATE_TYPE, + ELM_DATETIME_TYPE, + ELM_DECIMAL_TYPE, + ELM_INTEGER_TYPE, + ELM_LONG_TYPE, + ELM_QUANTITY_TYPE, + ELM_TIME_TYPE +} from '../../src/util/elmTypes'; +import { + MAX_DATE_VALUE, + MAX_DATETIME_VALUE, + MAX_FLOAT_VALUE, + MAX_INT_VALUE, + MAX_LONG_VALUE, + MAX_TIME_VALUE, + MIN_DATE_VALUE, + MIN_DATETIME_VALUE, + MIN_FLOAT_VALUE, + MIN_INT_VALUE, + MIN_LONG_VALUE, + MIN_TIME_VALUE +} from '../../src/util/math'; import data from './interval-data'; const xy = (obj: any) => [obj.x, obj.y]; -const boundlessInterval = () => new Interval(null, null); -const unknownInterval = () => new Interval(null, null, false, false); +const boundlessInterval = (type?: string) => new Interval(null, null, true, true, type); +const unknownInterval = (type?: string) => new Interval(null, null, false, false, type); describe('Interval', () => { + describe('equalInterval assertion', () => { + it('should compare intervals using interval equality', () => { + new Interval(1, 5).should.equalInterval(new Interval(0, 6, false, false)); + new Interval(1, 5).should.not.equalInterval(new Interval(1, 4)); + }); + + it('should require the object in context to be an interval', () => { + should(() => should({}).equalInterval(new Interval(1, 5))).throw(/to equal interval/); + }); + + it('should treat indeterminate interval equality as equal', () => { + // For test assertions we want to test that the intervals represent the same concept, so we + // consider uncertainties over the same range as equal + unknownInterval(ELM_INTEGER_TYPE).should.equalInterval(unknownInterval(ELM_INTEGER_TYPE)); + }); + }); + it('should properly set all properties when constructed as DateTime interval', () => { const i = new Interval(DateTime.parse('2012-01-01'), DateTime.parse('2013-01-01'), true, false); i.low.should.eql(DateTime.parse('2012-01-01')); @@ -41,6 +81,284 @@ describe('Interval', () => { i.lowClosed.should.be.true(); i.highClosed.should.be.true(); }); + + it('should identify and copy boundless and unknown intervals', () => { + const all = boundlessInterval(); + all.isBoundlessInterval.should.be.true(); + all.isUnknownInterval.should.be.false(); + + const mystery = unknownInterval(); + mystery.isBoundlessInterval.should.be.false(); + mystery.isUnknownInterval.should.be.true(); + + const allCopy = all.copy(); + allCopy.should.eql(all); + allCopy.should.not.equal(all); + }); + + describe('start', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should return low for intervals with closed low', () => { + d.zeroToHundred.closed.start().should.equal(0); + d.zeroPointFiveToNinePointFive.closed.start().should.equal(0.5); + d.zeroToHundredLong.closed.start().should.equal(0n); + d.zeroToHundredMg.closed.start().should.eql(new Quantity(0, 'mg')); + d.all2012date.closed.start().should.eql(Date.parse('2012-01-01')); + d.all2012.closed.start().should.eql(DateTime.parse('2012-01-01T00:00:00.0')); + d.alldaytime.closed.start().should.eql(DateTime.parse('0001-01-01T00:00:00.0').getTime()); + }); + + it('should return successor of low for intervals with open low', () => { + d.zeroToHundred.openClosed.start().should.equal(1); + d.zeroPointFiveToNinePointFive.openClosed.start().should.equal(0.50000001); + d.zeroToHundredLong.openClosed.start().should.equal(1n); + d.zeroToHundredMg.openClosed.start().should.eql(new Quantity(0.00000001, 'mg')); + d.all2012date.openClosed.start().should.eql(Date.parse('2012-01-02')); + d.all2012.openClosed.start().should.eql(DateTime.parse('2012-01-01T00:00:00.001')); + d.alldaytime.openClosed + .start() + .should.eql(DateTime.parse('0001-01-01T00:00:00.001').getTime()); + }); + + it('should return type minimum for closed null low endpoints', () => { + d.zeroToHundred.withNullStart.closed.start().should.equal(MIN_INT_VALUE); + d.zeroToHundredLong.withNullStart.closed.start().should.equal(MIN_LONG_VALUE); + d.zeroPointFiveToNinePointFive.withNullStart.closed.start().should.equal(MIN_FLOAT_VALUE); + d.zeroToHundredMg.withNullStart.closed + .start() + .should.eql(new Quantity(MIN_FLOAT_VALUE, 'mg')); + d.all2012date.withNullStart.closed.start().should.eql(MIN_DATE_VALUE); + d.all2012.withNullStart.closed.start().should.eql(MIN_DATETIME_VALUE); + d.alldaytime.withNullStart.closed.start().should.eql(MIN_TIME_VALUE); + }); + + it('should return null for closed null low endpoints when no point type is available', () => { + should(new Interval(null, null, true, true).start()).be.null(); + should(new Interval(null, null, true, true, 'Any').start()).be.null(); + }); + + it('should return uncertainty for open null low endpoints', () => { + d.zeroToHundred.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(MIN_INT_VALUE, 100)); + d.zeroToHundredLong.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(MIN_LONG_VALUE, 100n)); + d.zeroPointFiveToNinePointFive.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(MIN_FLOAT_VALUE, 9.5)); + d.zeroToHundredMg.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(new Quantity(MIN_FLOAT_VALUE, 'mg'), new Quantity(100, 'mg'))); + d.all2012date.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(MIN_DATE_VALUE, Date.parse('2012-12-31'))); + d.all2012.withNullStart.openClosed + .start() + .should.eql(new Uncertainty(MIN_DATETIME_VALUE, DateTime.parse('2012-12-31T23:59:59.999'))); + d.alldaytime.withNullStart.openClosed + .start() + .should.eql( + new Uncertainty(MIN_TIME_VALUE, DateTime.parse('0001-01-01T23:59:59.999').getTime()) + ); + }); + + it('should use the closed end as the high value for open null low endpoint uncertainty', () => { + d.zeroToHundred.withNullStart.open.start().should.eql(new Uncertainty(MIN_INT_VALUE, 99)); + d.zeroToHundredLong.withNullStart.open + .start() + .should.eql(new Uncertainty(MIN_LONG_VALUE, 99n)); + d.zeroPointFiveToNinePointFive.withNullStart.open + .start() + .should.eql(new Uncertainty(MIN_FLOAT_VALUE, 9.49999999)); + d.zeroToHundredMg.withNullStart.open + .start() + .should.eql( + new Uncertainty(new Quantity(MIN_FLOAT_VALUE, 'mg'), new Quantity(99.99999999, 'mg')) + ); + d.all2012date.withNullStart.open + .start() + .should.eql(new Uncertainty(MIN_DATE_VALUE, Date.parse('2012-12-30'))); + d.all2012.withNullStart.open + .start() + .should.eql(new Uncertainty(MIN_DATETIME_VALUE, DateTime.parse('2012-12-31T23:59:59.998'))); + d.alldaytime.withNullStart.open + .start() + .should.eql( + new Uncertainty(MIN_TIME_VALUE, DateTime.parse('0001-01-01T23:59:59.998').getTime()) + ); + }); + + it('should return null for open null low endpoints without a finite type minimum', () => { + should(new Interval(null, null, false, false).start()).be.null(); + should(new Interval(null, null, false, false, 'Any').start()).be.null(); + }); + + it('should use default point type when both endpoints are null', () => { + new Interval(null, null, true, true, ELM_INTEGER_TYPE).start().should.equal(MIN_INT_VALUE); + new Interval(null, null, true, true, ELM_LONG_TYPE).start().should.equal(MIN_LONG_VALUE); + new Interval(null, null, true, true, ELM_DECIMAL_TYPE).start().should.equal(MIN_FLOAT_VALUE); + new Interval(null, null, true, true, ELM_QUANTITY_TYPE) + .start() + .should.eql(MIN_QUANTITY_VALUE); + new Interval(null, null, true, true, ELM_DATETIME_TYPE) + .start() + .should.eql(MIN_DATETIME_VALUE); + new Interval(null, null, true, true, ELM_DATE_TYPE).start().should.eql(MIN_DATE_VALUE); + new Interval(null, null, true, true, ELM_TIME_TYPE).start().should.eql(MIN_TIME_VALUE); + }); + + it('should return full type uncertainty for open intervals with null endpoints and default point type', () => { + new Interval(null, null, false, false, ELM_INTEGER_TYPE) + .start() + .should.eql(new Uncertainty(MIN_INT_VALUE, MAX_INT_VALUE)); + new Interval(null, null, false, false, ELM_LONG_TYPE) + .start() + .should.eql(new Uncertainty(MIN_LONG_VALUE, MAX_LONG_VALUE)); + new Interval(null, null, false, false, ELM_DECIMAL_TYPE) + .start() + .should.eql(new Uncertainty(MIN_FLOAT_VALUE, MAX_FLOAT_VALUE)); + new Interval(null, null, false, false, ELM_QUANTITY_TYPE) + .start() + .should.eql(new Uncertainty(MIN_QUANTITY_VALUE, MAX_QUANTITY_VALUE)); + new Interval(null, null, false, false, ELM_DATETIME_TYPE) + .start() + .should.eql(new Uncertainty(MIN_DATETIME_VALUE, MAX_DATETIME_VALUE)); + new Interval(null, null, false, false, ELM_TIME_TYPE) + .start() + .should.eql(new Uncertainty(MIN_TIME_VALUE, MAX_TIME_VALUE)); + }); + }); + + describe('end', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should return high for intervals with closed high', () => { + d.zeroToHundred.closed.end().should.equal(100); + d.zeroPointFiveToNinePointFive.closed.end().should.equal(9.5); + d.zeroToHundredLong.closed.end().should.equal(100n); + d.zeroToHundredMg.closed.end().should.eql(new Quantity(100, 'mg')); + d.all2012date.closed.end().should.eql(Date.parse('2012-12-31')); + d.all2012.closed.end().should.eql(DateTime.parse('2012-12-31T23:59:59.999')); + d.alldaytime.closed.end().should.eql(DateTime.parse('0001-01-01T23:59:59.999').getTime()); + }); + + it('should return predecessor of high for intervals with open high', () => { + d.zeroToHundred.closedOpen.end().should.equal(99); + d.zeroPointFiveToNinePointFive.closedOpen.end().should.equal(9.49999999); + d.zeroToHundredLong.closedOpen.end().should.equal(99n); + d.zeroToHundredMg.closedOpen.end().should.eql(new Quantity(99.99999999, 'mg')); + d.all2012date.closedOpen.end().should.eql(Date.parse('2012-12-30')); + d.all2012.closedOpen.end().should.eql(DateTime.parse('2012-12-31T23:59:59.998')); + d.alldaytime.closedOpen.end().should.eql(DateTime.parse('0001-01-01T23:59:59.998').getTime()); + }); + + it('should return type maximum for closed null high endpoints', () => { + d.zeroToHundred.withNullEnd.closed.end().should.equal(MAX_INT_VALUE); + d.zeroToHundredLong.withNullEnd.closed.end().should.equal(MAX_LONG_VALUE); + d.zeroPointFiveToNinePointFive.withNullEnd.closed.end().should.equal(MAX_FLOAT_VALUE); + d.zeroToHundredMg.withNullEnd.closed.end().should.eql(new Quantity(MAX_FLOAT_VALUE, 'mg')); + d.all2012date.withNullEnd.closed.end().should.eql(MAX_DATE_VALUE); + d.all2012.withNullEnd.closed.end().should.eql(MAX_DATETIME_VALUE); + d.alldaytime.withNullEnd.closed.end().should.eql(MAX_TIME_VALUE); + }); + + it('should return null for closed null high endpoints when no point type is available', () => { + should(new Interval(null, null, true, true).end()).be.null(); + should(new Interval(null, null, true, true, 'Any').end()).be.null(); + }); + + it('should return uncertainty for open null high endpoints with inferred finite point type', () => { + d.zeroToHundred.withNullEnd.closedOpen.end().should.eql(new Uncertainty(0, MAX_INT_VALUE)); + d.zeroToHundredLong.withNullEnd.closedOpen + .end() + .should.eql(new Uncertainty(0n, MAX_LONG_VALUE)); + d.zeroPointFiveToNinePointFive.withNullEnd.closedOpen + .end() + .should.eql(new Uncertainty(0.5, MAX_FLOAT_VALUE)); + d.zeroToHundredMg.withNullEnd.closedOpen + .end() + .should.eql(new Uncertainty(new Quantity(0, 'mg'), new Quantity(MAX_FLOAT_VALUE, 'mg'))); + d.all2012date.withNullEnd.closedOpen + .end() + .should.eql(new Uncertainty(Date.parse('2012-01-01'), MAX_DATE_VALUE)); + d.all2012.withNullEnd.closedOpen + .end() + .should.eql(new Uncertainty(DateTime.parse('2012-01-01T00:00:00.0'), MAX_DATETIME_VALUE)); + d.alldaytime.withNullEnd.closedOpen + .end() + .should.eql( + new Uncertainty(DateTime.parse('0001-01-01T00:00:00.0').getTime(), MAX_TIME_VALUE) + ); + }); + + it('should use the closed start as the low value for open null high endpoint uncertainty', () => { + d.zeroToHundred.withNullEnd.open.end().should.eql(new Uncertainty(1, MAX_INT_VALUE)); + d.zeroToHundredLong.withNullEnd.open.end().should.eql(new Uncertainty(1n, MAX_LONG_VALUE)); + d.zeroPointFiveToNinePointFive.withNullEnd.open + .end() + .should.eql(new Uncertainty(0.50000001, MAX_FLOAT_VALUE)); + d.zeroToHundredMg.withNullEnd.open + .end() + .should.eql( + new Uncertainty(new Quantity(0.00000001, 'mg'), new Quantity(MAX_FLOAT_VALUE, 'mg')) + ); + d.all2012date.withNullEnd.open + .end() + .should.eql(new Uncertainty(Date.parse('2012-01-02'), MAX_DATE_VALUE)); + d.all2012.withNullEnd.open + .end() + .should.eql(new Uncertainty(DateTime.parse('2012-01-01T00:00:00.001'), MAX_DATETIME_VALUE)); + d.alldaytime.withNullEnd.open + .end() + .should.eql( + new Uncertainty(DateTime.parse('0001-01-01T00:00:00.001').getTime(), MAX_TIME_VALUE) + ); + }); + + it('should return null for open null high endpoints without a finite type maximum', () => { + should(new Interval(null, null, false, false).end()).be.null(); + should(new Interval(null, null, false, false, 'Any').end()).be.null(); + }); + + it('should use default point type when both endpoints are null', () => { + new Interval(null, null, true, true, ELM_INTEGER_TYPE).end().should.equal(MAX_INT_VALUE); + new Interval(null, null, true, true, ELM_LONG_TYPE).end().should.equal(MAX_LONG_VALUE); + new Interval(null, null, true, true, ELM_DECIMAL_TYPE).end().should.equal(MAX_FLOAT_VALUE); + new Interval(null, null, true, true, ELM_QUANTITY_TYPE).end().should.eql(MAX_QUANTITY_VALUE); + new Interval(null, null, true, true, ELM_DATETIME_TYPE).end().should.eql(MAX_DATETIME_VALUE); + new Interval(null, null, true, true, ELM_DATE_TYPE).end().should.eql(MAX_DATE_VALUE); + new Interval(null, null, true, true, ELM_TIME_TYPE).end().should.eql(MAX_TIME_VALUE); + }); + + it('should return full type uncertainty for open intervals with null endpoints and default point type', () => { + new Interval(null, null, false, false, ELM_INTEGER_TYPE) + .end() + .should.eql(new Uncertainty(MIN_INT_VALUE, MAX_INT_VALUE)); + new Interval(null, null, false, false, ELM_LONG_TYPE) + .end() + .should.eql(new Uncertainty(MIN_LONG_VALUE, MAX_LONG_VALUE)); + new Interval(null, null, false, false, ELM_DECIMAL_TYPE) + .end() + .should.eql(new Uncertainty(MIN_FLOAT_VALUE, MAX_FLOAT_VALUE)); + new Interval(null, null, false, false, ELM_QUANTITY_TYPE) + .end() + .should.eql(new Uncertainty(MIN_QUANTITY_VALUE, MAX_QUANTITY_VALUE)); + new Interval(null, null, false, false, ELM_DATETIME_TYPE) + .end() + .should.eql(new Uncertainty(MIN_DATETIME_VALUE, MAX_DATETIME_VALUE)); + new Interval(null, null, false, false, ELM_TIME_TYPE) + .end() + .should.eql(new Uncertainty(MIN_TIME_VALUE, MAX_TIME_VALUE)); + }); + }); }); describe('DateTimeInterval', () => { @@ -86,6 +404,8 @@ describe('DateTimeInterval', () => { new Interval(date, null, true, false).contains(date).should.be.true(); should(new Interval(date, null, true, false).contains(late)).be.null(); new Interval(date, null, true, false).contains(early).should.be.false(); + boundlessInterval(ELM_DATETIME_TYPE).contains(date).should.be.true(); + should(unknownInterval(ELM_DATETIME_TYPE).contains(date)).be.null(); }); it('should properly handle imprecision', () => { @@ -241,6 +561,19 @@ describe('DateTimeInterval', () => { should.not.exist(x.toYear.includes(y.closed)); }); + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).includes(d.mid2012.full).should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).includes(d.all2012.closed).should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE) + .includes(unknownInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + d.all2012.closed.includes(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should(unknownInterval(ELM_DATETIME_TYPE).includes(d.all2012.closed)).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).includes(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); + it('should include a point date', () => { d.all2012.closed.includes(d.mid2012.full).should.be.true(); }); @@ -368,8 +701,75 @@ describe('DateTimeInterval', () => { should.not.exist(x.toYear.includedIn(y.closed)); }); - it('should include a point date', () => { - d.all2012.closed.includedIn(d.mid2012.full).should.be.true(); + it('should properly handle boundless and unknown intervals', () => { + d.all2012.closed.includedIn(boundlessInterval(ELM_DATETIME_TYPE)).should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).includedIn(d.all2012.closed).should.be.false(); + boundlessInterval(ELM_DATETIME_TYPE) + .includedIn(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + unknownInterval(ELM_DATETIME_TYPE) + .includedIn(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + }); + }); + + describe('properlyIncludes', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).properlyIncludes(d.all2012.closed).should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE) + .properlyIncludes(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).properlyIncludes(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should(unknownInterval(ELM_DATETIME_TYPE).properlyIncludes(d.all2012.closed)).be.null(); + }); + }); + + describe('starts', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .starts(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).starts(d.all2012.closed).should.be.false(); + d.all2012.closed.starts(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).starts(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).starts(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); + }); + + describe('ends', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .ends(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).ends(d.all2012.closed).should.be.false(); + d.all2012.closed.ends(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).ends(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).ends(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); }); }); @@ -463,13 +863,58 @@ describe('DateTimeInterval', () => { y.open.overlaps(x.open).should.be.true(); }); + it('should properly handle null endpoints', () => { + const date = DateTime.parse('2012-01-01T00:00:00.0'); + const early = DateTime.parse('0001-01-01T00:00:00.0'); + const late = DateTime.parse('2999-01-01T00:00:00.0'); + const earlyInterval = new Interval(early, DateTime.parse('2011-01-01T00:00:00.0')); + const lateInterval = new Interval(DateTime.parse('2013-01-01T00:00:00.0'), late); + const startsAtDate = new Interval(date, late); + const endsAtDate = new Interval(early, date); + + should(new Interval(null, date).overlaps(earlyInterval)).be.true(); + should(new Interval(null, date).overlaps(lateInterval)).be.false(); + should(new Interval(null, date, false, true).overlaps(startsAtDate)).be.true(); + should(new Interval(null, date, false, true).overlaps(earlyInterval)).be.null(); + should(new Interval(null, date, false, true).overlaps(lateInterval)).be.false(); + + should(new Interval(date, null).overlaps(lateInterval)).be.true(); + should(new Interval(date, null).overlaps(earlyInterval)).be.false(); + should(new Interval(date, null, true, false).overlaps(endsAtDate)).be.true(); + should(new Interval(date, null, true, false).overlaps(lateInterval)).be.null(); + should(new Interval(date, null, true, false).overlaps(earlyInterval)).be.false(); + + should(boundlessInterval(ELM_DATETIME_TYPE).overlaps(d.all2012.closed)).be.true(); + should(unknownInterval(ELM_DATETIME_TYPE).overlaps(d.all2012.closed)).be.null(); + should(d.all2012.closed.overlaps(boundlessInterval(ELM_DATETIME_TYPE))).be.true(); + should(d.all2012.closed.overlaps(unknownInterval(ELM_DATETIME_TYPE))).be.null(); + should( + boundlessInterval(ELM_DATETIME_TYPE).overlaps(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.true(); + should( + boundlessInterval(ELM_DATETIME_TYPE).overlaps(unknownInterval(ELM_DATETIME_TYPE)) + ).be.true(); + should( + unknownInterval(ELM_DATETIME_TYPE).overlaps(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.true(); + should( + unknownInterval(ELM_DATETIME_TYPE).overlaps(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); + it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(boundlessInterval()).should.be.true(); - boundlessInterval().overlaps(d.all2012.closed).should.be.true(); - d.all2012.closed.overlaps(boundlessInterval()).should.be.true(); - should(boundlessInterval().overlaps(unknownInterval())).be.null(); - should(unknownInterval().overlaps(boundlessInterval())).be.null(); - should(unknownInterval().overlaps(d.all2012.closed)).be.null(); + boundlessInterval(ELM_DATETIME_TYPE) + .overlaps(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).overlaps(d.all2012.closed).should.be.true(); + d.all2012.closed.overlaps(boundlessInterval(ELM_DATETIME_TYPE)).should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE) + .overlaps(unknownInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + unknownInterval(ELM_DATETIME_TYPE) + .overlaps(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + should(unknownInterval(ELM_DATETIME_TYPE).overlaps(d.all2012.closed)).be.null(); }); it('should properly handle imprecision', () => { @@ -504,63 +949,6 @@ describe('DateTimeInterval', () => { }); }); - describe('overlaps(DateTime)', () => { - let d: any; - beforeEach(() => { - d = data(); - }); - - it('should properly calculate dates before it', () => { - d.all2012.closed.overlaps(d.bef2012.full).should.be.false(); - }); - - it('should properly calculate the left boundary date', () => { - d.all2012.closed.overlaps(d.beg2012.full).should.be.true(); - d.all2012.open.overlaps(d.beg2012.full).should.be.false(); - }); - - it('should properly calculate dates in the middle of it', () => { - d.all2012.closed.overlaps(d.mid2012.full).should.be.true(); - }); - - it('should properly calculate the right boundary date', () => { - d.all2012.closed.overlaps(d.end2012.full).should.be.true(); - d.all2012.open.overlaps(d.end2012.full).should.be.false(); - }); - - it('should properly calculate dates after it', () => { - d.all2012.closed.overlaps(d.aft2012.full).should.be.false(); - }); - - it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(d.mid2012.full).should.be.true(); - should(boundlessInterval().overlaps(null)).be.null(); - should(unknownInterval().overlaps(d.mid2012.full)).be.null(); - }); - - it('should properly handle imprecision', () => { - d.all2012.closed.overlaps(d.bef2012.toMonth).should.be.false(); - should.not.exist(d.all2012.closed.overlaps(d.beg2012.toMonth)); - d.all2012.closed.overlaps(d.mid2012.toMonth).should.be.true(); - should.not.exist(d.all2012.closed.overlaps(d.end2012.toMonth)); - d.all2012.closed.overlaps(d.aft2012.toMonth).should.be.false(); - - d.all2012.toMonth.overlaps(d.bef2012.toMonth).should.be.false(); - d.all2012.toMonth.overlaps(d.beg2012.toMonth).should.be.true(); - d.all2012.toMonth.overlaps(d.mid2012.toMonth).should.be.true(); - d.all2012.toMonth.overlaps(d.end2012.toMonth).should.be.true(); - d.all2012.toMonth.overlaps(d.aft2012.toMonth).should.be.false(); - - d.all2012.toMonth.overlaps(d.bef2012.full).should.be.false(); - should.not.exist(d.all2012.toMonth.overlaps(d.beg2012.full)); - d.all2012.toMonth.overlaps(d.mid2012.full).should.be.true(); - should.not.exist(d.all2012.toMonth.overlaps(d.end2012.full)); - d.all2012.toMonth.overlaps(d.aft2012.full).should.be.false(); - - should.not.exist(d.all2012.closed.overlaps(d.mid2012.toYear)); - }); - }); - describe('overlapsBefore', () => { let d: any; beforeEach(() => { @@ -568,10 +956,14 @@ describe('DateTimeInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsBefore(d.mid2012.full).should.be.true(); - d.all2012.closed.overlapsBefore(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsBefore(unknownInterval())).be.null(); - should(unknownInterval().overlapsBefore(boundlessInterval())).be.null(); + boundlessInterval(ELM_DATETIME_TYPE).overlapsBefore(d.all2012.closed).should.be.true(); + d.all2012.closed.overlapsBefore(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).overlapsBefore(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + unknownInterval(ELM_DATETIME_TYPE) + .overlapsBefore(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.false(); }); }); @@ -582,10 +974,14 @@ describe('DateTimeInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsAfter(d.mid2012.full).should.be.true(); - d.all2012.closed.overlapsAfter(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsAfter(unknownInterval())).be.null(); - should(unknownInterval().overlapsAfter(boundlessInterval())).be.null(); + boundlessInterval(ELM_DATETIME_TYPE).overlapsAfter(d.all2012.closed).should.be.true(); + d.all2012.closed.overlapsAfter(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).overlapsAfter(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + unknownInterval(ELM_DATETIME_TYPE) + .overlapsAfter(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.false(); }); }); @@ -743,6 +1139,44 @@ describe('DateTimeInterval', () => { ivl.equals(point).should.be.false(); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .equals(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).equals(d.all2012.closed).should.be.false(); + d.all2012.closed.equals(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).equals(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).equals(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).equals(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); + }); + + describe('sameAs', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .sameAs(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).sameAs(d.all2012.closed).should.be.false(); + d.all2012.closed.sameAs(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_DATETIME_TYPE).sameAs(unknownInterval(ELM_DATETIME_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_DATETIME_TYPE).sameAs(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); }); describe('union', () => { @@ -753,14 +1187,14 @@ describe('DateTimeInterval', () => { it('should properly calculate sameAs unions', () => { const [x, y] = Array.from(xy(d.dIvl.sameAs)); - x.closed.union(y.closed).equals(x.closed).should.be.true(); - x.closed.union(y.open).equals(x.closed).should.be.true(); - x.open.union(y.closed).equals(x.closed).should.be.true(); - x.open.union(y.open).equals(x.open).should.be.true(); - y.closed.union(x.closed).equals(y.closed).should.be.true(); - y.closed.union(x.open).equals(y.closed).should.be.true(); - y.open.union(x.closed).equals(y.closed).should.be.true(); - y.open.union(x.open).equals(y.open).should.be.true(); + x.closed.union(y.closed).should.equalInterval(x.closed); + x.closed.union(y.open).should.equalInterval(x.closed); + x.open.union(y.closed).should.equalInterval(x.closed); + x.open.union(y.open).should.equalInterval(x.open); + y.closed.union(x.closed).should.equalInterval(y.closed); + y.closed.union(x.open).should.equalInterval(y.closed); + y.open.union(x.closed).should.equalInterval(y.closed); + y.open.union(x.open).should.equalInterval(y.open); }); it('should properly calculate before/after unions', () => { @@ -922,8 +1356,23 @@ describe('DateTimeInterval', () => { x.toMonth.high.sameAs(j.high, DateTime.Unit.MONTH).should.be.true(); }); + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .union(d.all2012.closed) + .should.equalInterval(boundlessInterval(ELM_DATETIME_TYPE)); + d.all2012.closed + .union(boundlessInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(boundlessInterval(ELM_DATETIME_TYPE)); + boundlessInterval(ELM_DATETIME_TYPE) + .union(unknownInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(boundlessInterval(ELM_DATETIME_TYPE)); + unknownInterval(ELM_DATETIME_TYPE) + .union(boundlessInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(boundlessInterval(ELM_DATETIME_TYPE)); + }); + it('should throw when the argument is a point', () => { - should(() => d.all2012.closed.union(d.mid2012.closed)).throw(Error); + should(() => d.all2012.closed.union(d.mid2012)).throw(Error); }); }); @@ -1048,6 +1497,21 @@ describe('DateTimeInterval', () => { y.toDay.intersect(x.toDay).high.should.eql(x.toDay.high); }); + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .intersect(d.all2012.closed) + .should.equalInterval(d.all2012.closed); + d.all2012.closed + .intersect(boundlessInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(d.all2012.closed); + boundlessInterval(ELM_DATETIME_TYPE) + .intersect(unknownInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(unknownInterval(ELM_DATETIME_TYPE)); + unknownInterval(ELM_DATETIME_TYPE) + .intersect(boundlessInterval(ELM_DATETIME_TYPE)) + .should.equalInterval(unknownInterval(ELM_DATETIME_TYPE)); + }); + it('should throw when the argument is a point', () => { should(() => d.all2012.intersect(DateTime.parse('2012-07-01T00:00:00.0'))).throw(Error); }); @@ -1073,26 +1537,26 @@ describe('DateTimeInterval', () => { it('should properly calculate before/after except', () => { const [x, y] = Array.from(xy(d.dIvl.before)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate meets except', () => { const [x, y] = Array.from(xy(d.dIvl.meets)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate left/right overlapping except', () => { @@ -1113,7 +1577,7 @@ describe('DateTimeInterval', () => { const [x, y] = Array.from(xy(d.dIvl.begins)); const b = d.julydec; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.low, x.closed.low)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.low, x.closed.low)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.openClosed).should.be.true(); should.not.exist(y.closed.except(x.open)); @@ -1137,7 +1601,7 @@ describe('DateTimeInterval', () => { const [x, y] = Array.from(xy(d.dIvl.ends)); const b = d.janjuly; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.high, x.closed.high)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.high, x.closed.high)); should.not.exist(x.open.except(y.closed)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.closedOpen).should.be.true(); @@ -1155,9 +1619,9 @@ describe('DateTimeInterval', () => { [x, y] = Array.from(xy(d.dIvl.meets)); // [a,b].except([b,c]) (where b is uncertain) should result in [a,b) but spec says we don't know if they overlap - x.toDay.except(y.toDay).should.eql(x.toDay); + x.toDay.except(y.toDay).should.equalInterval(x.toDay); // [b,c].except([a,b]) (where b is uncertain) should result in (b,c] but spec says we don't know if they overlap - y.toDay.except(x.toDay).should.eql(y.toDay); + y.toDay.except(x.toDay).should.equalInterval(y.toDay); [x, y] = Array.from(xy(d.dIvl.during)); should.not.exist(x.toDay.except(y.toDay)); @@ -1168,16 +1632,24 @@ describe('DateTimeInterval', () => { should.not.exist(x.toDay.except(y.toDay)); // x: ['2012-07-01', '2012-12-31'] // y: ['2012-01-01', '2012-12-31'] - y.toDay.except(x.toDay).should.eql(new Interval(y.toDay.low, x.toDay.low, true, false)); - should.not.exist(y.toDay.except(x.toMinute)); + y.toDay + .except(x.toDay) + .should.equalInterval(new Interval(y.toDay.low, x.toDay.low, true, false)); + y.toDay + .except(x.toMinute) + .should.equalInterval(new Interval(y.toDay.low, x.toMinute.low, true, false)); [x, y] = Array.from(xy(d.dIvl.begins)); should.not.exist(x.toDay.except(y.toDay)); should.not.exist(x.toDay.except(y.toDay)); // x: ['2012-01-01', '2012-07-01'] // y: ['2012-01-01', '2012-12-31'] - y.toDay.except(x.toDay).should.eql(new Interval(x.toDay.high, y.toDay.high, false, true)); - should.not.exist(y.toDay.except(x.toMinute)); + y.toDay + .except(x.toDay) + .should.equalInterval(new Interval(x.toDay.high, y.toDay.high, false, true)); + y.toDay + .except(x.toMinute) + .should.equalInterval(new Interval(x.toMinute.high, y.toDay.high, false, true)); }); it('should throw when the argument is a point', () => { @@ -1316,6 +1788,29 @@ describe('DateTimeInterval', () => { should.not.exist(x.toYear.after(y.closed)); should.not.exist(x.toYear.after(x.closed)); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).after(d.all2012.closed).should.be.false(); + d.all2012.closed.after(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + }); + }); + + describe('sameOrAfter', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .sameOrAfter(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).sameOrAfter(d.all2012.closed).should.be.false(); + d.all2012.closed.sameOrAfter(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + unknownInterval(ELM_DATETIME_TYPE).sameOrAfter(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); }); describe('before', () => { @@ -1448,6 +1943,29 @@ describe('DateTimeInterval', () => { should.not.exist(y.toYear.before(x.closed)); should.not.exist(x.toYear.before(y.closed)); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).before(d.all2012.closed).should.be.false(); + d.all2012.closed.before(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + }); + }); + + describe('sameOrBefore', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE) + .sameOrBefore(boundlessInterval(ELM_DATETIME_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DATETIME_TYPE).sameOrBefore(d.all2012.closed).should.be.false(); + d.all2012.closed.sameOrBefore(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + should( + unknownInterval(ELM_DATETIME_TYPE).sameOrBefore(boundlessInterval(ELM_DATETIME_TYPE)) + ).be.null(); + }); }); // TODO Add tests that pass in precision parameters @@ -1571,6 +2089,11 @@ describe('DateTimeInterval', () => { x.toMinute.meets(y.toMinute).should.be.false(); x.toYear.meets(y.closed).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).meets(d.all2012.closed).should.be.false(); + d.all2012.closed.meets(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + }); }); // TODO Add tests that pass in precision parameter @@ -1699,6 +2222,11 @@ describe('DateTimeInterval', () => { x.toMinute.meetsAfter(y.toMinute).should.be.false(); x.toYear.meetsAfter(y.closed).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).meetsAfter(d.all2012.closed).should.be.false(); + d.all2012.closed.meetsAfter(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + }); }); // TODO Add tests that pass in precision parameter @@ -1823,6 +2351,11 @@ describe('DateTimeInterval', () => { x.toMinute.meetsBefore(y.toMinute).should.be.false(); x.toYear.meetsBefore(y.closed).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_DATETIME_TYPE).meetsBefore(d.all2012.closed).should.be.false(); + d.all2012.closed.meetsBefore(boundlessInterval(ELM_DATETIME_TYPE)).should.be.false(); + }); }); }); @@ -1866,6 +2399,8 @@ describe('IntegerInterval', () => { new Interval(0, null, true, false).contains(0).should.be.true(); should(new Interval(0, null, true, false).contains(123456789)).be.null(); new Interval(0, null, true, false).contains(-1).should.be.false(); + boundlessInterval(ELM_INTEGER_TYPE).contains(5).should.be.true(); + should(unknownInterval(ELM_INTEGER_TYPE).contains(5)).be.null(); }); it('should properly handle imprecision', () => { @@ -2017,6 +2552,19 @@ describe('IntegerInterval', () => { it('should include a point Integer', () => { d.zeroToHundred.closed.includes(50).should.be.true(); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).includes(50).should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).includes(d.zeroToHundred.closed).should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE) + .includes(unknownInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + d.zeroToHundred.closed.includes(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should(unknownInterval(ELM_INTEGER_TYPE).includes(d.zeroToHundred.closed)).be.null(); + should( + unknownInterval(ELM_INTEGER_TYPE).includes(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + }); }); describe('includedIn', () => { @@ -2132,9 +2680,71 @@ describe('IntegerInterval', () => { should.not.exist(uIvl.includedIn(uIvl)); }); - it('should include a point integer', () => { - d.zeroToHundred.closed.includedIn(50).should.be.true(); - d.zeroToHundred.closed.includedIn(500).should.be.false(); + it('should properly handle boundless and unknown intervals', () => { + d.zeroToHundred.closed.includedIn(boundlessInterval(ELM_INTEGER_TYPE)).should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).includedIn(d.zeroToHundred.closed).should.be.false(); + boundlessInterval(ELM_INTEGER_TYPE) + .includedIn(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + unknownInterval(ELM_INTEGER_TYPE) + .includedIn(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + }); + }); + + describe('properlyIncludes', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).properlyIncludes(d.zeroToHundred.closed).should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE) + .properlyIncludes(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).properlyIncludes(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + should(unknownInterval(ELM_INTEGER_TYPE).properlyIncludes(d.zeroToHundred.closed)).be.null(); + }); + }); + + describe('starts', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .starts(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).starts(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.starts(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).starts(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_INTEGER_TYPE).starts(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + }); + }); + + describe('ends', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .ends(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).ends(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.ends(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should(boundlessInterval(ELM_INTEGER_TYPE).ends(unknownInterval(ELM_INTEGER_TYPE))).be.null(); + should(unknownInterval(ELM_INTEGER_TYPE).ends(boundlessInterval(ELM_INTEGER_TYPE))).be.null(); }); }); @@ -2228,13 +2838,43 @@ describe('IntegerInterval', () => { y.open.overlaps(x.open).should.be.true(); }); + it('should properly handle null endpoints', () => { + const earlyInterval = new Interval(-123456789, -1); + const lateInterval = new Interval(1, 123456789); + const startsAtZero = new Interval(0, 123456789); + const endsAtZero = new Interval(-123456789, 0); + + should(new Interval(null, 0).overlaps(earlyInterval)).be.true(); + should(new Interval(null, 0).overlaps(lateInterval)).be.false(); + should(new Interval(null, 0, false, true).overlaps(startsAtZero)).be.true(); + should(new Interval(null, 0, false, true).overlaps(earlyInterval)).be.null(); + should(new Interval(null, 0, false, true).overlaps(lateInterval)).be.false(); + + should(new Interval(0, null).overlaps(lateInterval)).be.true(); + should(new Interval(0, null).overlaps(earlyInterval)).be.false(); + should(new Interval(0, null, true, false).overlaps(endsAtZero)).be.true(); + should(new Interval(0, null, true, false).overlaps(lateInterval)).be.null(); + should(new Interval(0, null, true, false).overlaps(earlyInterval)).be.false(); + + should(boundlessInterval(ELM_INTEGER_TYPE).overlaps(d.zeroToHundred.closed)).be.true(); + should(unknownInterval(ELM_INTEGER_TYPE).overlaps(d.zeroToHundred.closed)).be.null(); + should(d.zeroToHundred.closed.overlaps(boundlessInterval(ELM_INTEGER_TYPE))).be.true(); + should(d.zeroToHundred.closed.overlaps(unknownInterval(ELM_INTEGER_TYPE))).be.null(); + }); + it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(boundlessInterval()).should.be.true(); - boundlessInterval().overlaps(d.zeroToHundred.closed).should.be.true(); - d.zeroToHundred.closed.overlaps(boundlessInterval()).should.be.true(); - should(boundlessInterval().overlaps(unknownInterval())).be.null(); - should(unknownInterval().overlaps(boundlessInterval())).be.null(); - should(unknownInterval().overlaps(d.zeroToHundred.closed)).be.null(); + boundlessInterval(ELM_INTEGER_TYPE) + .overlaps(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).overlaps(d.zeroToHundred.closed).should.be.true(); + d.zeroToHundred.closed.overlaps(boundlessInterval(ELM_INTEGER_TYPE)).should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE) + .overlaps(unknownInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + unknownInterval(ELM_INTEGER_TYPE) + .overlaps(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + should(unknownInterval(ELM_INTEGER_TYPE).overlaps(d.zeroToHundred.closed)).be.null(); }); it('should properly handle imprecision', () => { @@ -2260,70 +2900,6 @@ describe('IntegerInterval', () => { }); }); - describe('overlaps(Integer)', () => { - let d: any; - beforeEach(() => { - d = data(); - }); - - it('should properly calculate integers less than it', () => { - d.zeroToHundred.closed.overlaps(-5).should.be.false(); - }); - - it('should properly calculate the left boundary integer', () => { - d.zeroToHundred.closed.overlaps(0).should.be.true(); - d.zeroToHundred.open.overlaps(0).should.be.false(); - }); - - it('should properly calculate integers in the middle of it', () => { - d.zeroToHundred.closed.overlaps(50).should.be.true(); - }); - - it('should properly calculate the right boundary integer', () => { - d.zeroToHundred.closed.overlaps(100).should.be.true(); - d.zeroToHundred.open.overlaps(100).should.be.false(); - }); - - it('should properly calculate integers greater than it', () => { - d.zeroToHundred.closed.overlaps(105).should.be.false(); - }); - - it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(5).should.be.true(); - should(boundlessInterval().overlaps(null)).be.null(); - should(unknownInterval().overlaps(5)).be.null(); - }); - - it('should properly handle imprecision', () => { - d.zeroToHundred.closed.overlaps(new Uncertainty(-20, -10)).should.be.false(); - should.not.exist(d.zeroToHundred.closed.overlaps(new Uncertainty(-20, 20))); - d.zeroToHundred.closed.overlaps(new Uncertainty(0, 100)).should.be.true(); - should.not.exist(d.zeroToHundred.closed.overlaps(new Uncertainty(80, 120))); - d.zeroToHundred.closed.overlaps(new Uncertainty(120, 140)).should.be.false(); - should.not.exist(d.zeroToHundred.closed.overlaps(new Uncertainty(-20, 120))); - - const uIvl = new Interval(new Uncertainty(5, 10), new Uncertainty(15, 20)); - - uIvl.overlaps(0).should.be.false(); - should.not.exist(uIvl.overlaps(5)); - should.not.exist(uIvl.overlaps(6)); - uIvl.overlaps(10).should.be.true(); - uIvl.overlaps(12).should.be.true(); - uIvl.overlaps(15).should.be.true(); - should.not.exist(uIvl.overlaps(16)); - should.not.exist(uIvl.overlaps(20)); - uIvl.overlaps(25).should.be.false(); - - uIvl.overlaps(new Uncertainty(0, 4)).should.be.false(); - should.not.exist(uIvl.overlaps(new Uncertainty(0, 5))); - should.not.exist(uIvl.overlaps(new Uncertainty(5, 10))); - uIvl.overlaps(new Uncertainty(10, 15)).should.be.true(); - should.not.exist(uIvl.overlaps(new Uncertainty(15, 20))); - should.not.exist(uIvl.overlaps(new Uncertainty(20, 25))); - uIvl.overlaps(new Uncertainty(25, 30)).should.be.false(); - }); - }); - describe('overlapsBefore', () => { let d: any; beforeEach(() => { @@ -2331,11 +2907,14 @@ describe('IntegerInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsBefore(d.zeroToHundred.closed).should.be.true(); - boundlessInterval().overlapsBefore(5).should.be.true(); - d.zeroToHundred.closed.overlapsBefore(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsBefore(unknownInterval())).be.null(); - should(unknownInterval().overlapsBefore(boundlessInterval())).be.null(); + boundlessInterval(ELM_INTEGER_TYPE).overlapsBefore(d.zeroToHundred.closed).should.be.true(); + d.zeroToHundred.closed.overlapsBefore(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).overlapsBefore(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + unknownInterval(ELM_INTEGER_TYPE) + .overlapsBefore(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.false(); }); }); @@ -2346,11 +2925,14 @@ describe('IntegerInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsAfter(d.zeroToHundred.closed).should.be.true(); - boundlessInterval().overlapsAfter(5).should.be.true(); - d.zeroToHundred.closed.overlapsAfter(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsAfter(unknownInterval())).be.null(); - should(unknownInterval().overlapsAfter(boundlessInterval())).be.null(); + boundlessInterval(ELM_INTEGER_TYPE).overlapsAfter(d.zeroToHundred.closed).should.be.true(); + d.zeroToHundred.closed.overlapsAfter(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).overlapsAfter(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + unknownInterval(ELM_INTEGER_TYPE) + .overlapsAfter(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.false(); }); }); @@ -2494,6 +3076,42 @@ describe('IntegerInterval', () => { ivl.equals(point).should.be.false(); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .equals(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).equals(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.equals(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).equals(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_INTEGER_TYPE).equals(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + should(unknownInterval(ELM_INTEGER_TYPE).equals(unknownInterval(ELM_INTEGER_TYPE))).be.null(); + }); + }); + + describe('sameAs', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .sameAs(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).sameAs(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.sameAs(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_INTEGER_TYPE).sameAs(unknownInterval(ELM_INTEGER_TYPE)) + ).be.null(); + should( + unknownInterval(ELM_INTEGER_TYPE).sameAs(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + }); }); describe('union', () => { @@ -2614,10 +3232,10 @@ describe('IntegerInterval', () => { ivl = new Interval(10, 15); i = ivl.union(uIvl); - i.should.eql(uIvl); + i.should.equalInterval(uIvl); i = uIvl.union(ivl); - i.should.eql(uIvl); + i.should.equalInterval(uIvl); ivl = new Interval(15, 20); i = ivl.union(uIvl); @@ -2638,6 +3256,21 @@ describe('IntegerInterval', () => { it('should throw when the argument is a point', () => { should(() => d.zeroToHundred.union(300)).throw(Error); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .union(d.zeroToHundred.closed) + .should.equalInterval(boundlessInterval(ELM_INTEGER_TYPE)); + d.zeroToHundred.closed + .union(boundlessInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(boundlessInterval(ELM_INTEGER_TYPE)); + boundlessInterval(ELM_INTEGER_TYPE) + .union(unknownInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(boundlessInterval(ELM_INTEGER_TYPE)); + unknownInterval(ELM_INTEGER_TYPE) + .union(boundlessInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(boundlessInterval(ELM_INTEGER_TYPE)); + }); }); describe('intersect', () => { @@ -2740,8 +3373,8 @@ describe('IntegerInterval', () => { let x = new Interval(b, e); let y = new Interval(a, c); - x.intersect(y).should.eql(new Interval(b, c)); - y.intersect(x).should.eql(new Interval(b, c)); + x.intersect(y).should.equalInterval(new Interval(b, c)); + y.intersect(x).should.equalInterval(new Interval(b, c)); x = new Interval(a, b); y = new Interval(b, d); @@ -2752,13 +3385,13 @@ describe('IntegerInterval', () => { x = new Interval(a, e); y = new Interval(b, d); - x.intersect(y).should.eql(y); - y.intersect(x).should.eql(y); + x.intersect(y).should.equalInterval(y); + y.intersect(x).should.equalInterval(y); x = new Interval(a, d); y = new Interval(b, e); - x.intersect(y).should.eql(new Interval(b, d)); - y.intersect(x).should.eql(new Interval(b, d)); + x.intersect(y).should.equalInterval(new Interval(b, d)); + y.intersect(x).should.equalInterval(new Interval(b, d)); x = new Interval(a, b); y = new Interval(d, e); @@ -2767,13 +3400,32 @@ describe('IntegerInterval', () => { x = new Interval(new Uncertainty(5, 10), new Uncertainty(15, 20)); y = new Interval(8, 17); - x.intersect(y).should.eql(new Interval(new Uncertainty(8, 10), new Uncertainty(15, 17))); - y.intersect(x).should.eql(new Interval(new Uncertainty(8, 10), new Uncertainty(15, 17))); + x.intersect(y).should.equalInterval( + new Interval(new Uncertainty(8, 10), new Uncertainty(15, 17)) + ); + y.intersect(x).should.equalInterval( + new Interval(new Uncertainty(8, 10), new Uncertainty(15, 17)) + ); }); it('should throw when the argument is a point', () => { should(() => d.zeroToHundred.intersect(50)).throw(Error); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .intersect(d.zeroToHundred.closed) + .should.equalInterval(d.zeroToHundred.closed); + d.zeroToHundred.closed + .intersect(boundlessInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(d.zeroToHundred.closed); + boundlessInterval(ELM_INTEGER_TYPE) + .intersect(unknownInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(unknownInterval(ELM_INTEGER_TYPE)); + unknownInterval(ELM_INTEGER_TYPE) + .intersect(boundlessInterval(ELM_INTEGER_TYPE)) + .should.equalInterval(unknownInterval(ELM_INTEGER_TYPE)); + }); }); describe('except', () => { @@ -2796,26 +3448,26 @@ describe('IntegerInterval', () => { it('should properly calculate before/after except', () => { const [x, y] = Array.from(xy(d.iIvl.before)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate meets except', () => { const [x, y] = Array.from(xy(d.iIvl.meets)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate left/right overlapping except', () => { @@ -2836,7 +3488,7 @@ describe('IntegerInterval', () => { const [x, y] = Array.from(xy(d.iIvl.begins)); const b = d.sixtyToHundred; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.low, x.closed.low)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.low, x.closed.low)); should.not.exist(x.open.except(y.closed)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.openClosed).should.be.true(); @@ -2861,7 +3513,7 @@ describe('IntegerInterval', () => { const [x, y] = Array.from(xy(d.iIvl.ends)); const b = d.zeroToForty; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.high, x.closed.high)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.high, x.closed.high)); should.not.exist(x.open.except(y.closed)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.closedOpen).should.be.true(); @@ -2879,8 +3531,8 @@ describe('IntegerInterval', () => { let x = new Interval(b, e); //([10,20] , 100) let y = new Interval(a, c); //( 0 , 50) - x.except(y).should.eql(new Interval(c, e, false, true)); - y.except(x).should.eql(new Interval(a, b, true, false)); + x.except(y).should.equalInterval(new Interval(c, e, false, true)); + y.except(x).should.equalInterval(new Interval(a, b, true, false)); x = new Interval(a, b); y = new Interval(b, d); @@ -2896,13 +3548,13 @@ describe('IntegerInterval', () => { x = new Interval(a, d); y = new Interval(b, e); - x.except(y).should.eql(new Interval(a, b, true, false)); - y.except(x).should.eql(new Interval(d, e, false, true)); + x.except(y).should.equalInterval(new Interval(a, b, true, false)); + y.except(x).should.equalInterval(new Interval(d, e, false, true)); x = new Interval(a, b); y = new Interval(d, e); - x.except(y).should.eql(x); - y.except(x).should.eql(y); + x.except(y).should.equalInterval(x); + y.except(x).should.equalInterval(y); }); it('should throw when the argument is a point', () => { @@ -3029,6 +3681,29 @@ describe('IntegerInterval', () => { uIvl.after(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).after(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.after(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + }); + }); + + describe('sameOrAfter', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .sameOrAfter(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).sameOrAfter(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.sameOrAfter(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + unknownInterval(ELM_INTEGER_TYPE).sameOrAfter(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + }); }); describe('before', () => { @@ -3150,6 +3825,29 @@ describe('IntegerInterval', () => { uIvl.before(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).before(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.before(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + }); + }); + + describe('sameOrBefore', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE) + .sameOrBefore(boundlessInterval(ELM_INTEGER_TYPE)) + .should.be.true(); + boundlessInterval(ELM_INTEGER_TYPE).sameOrBefore(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.sameOrBefore(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + should( + unknownInterval(ELM_INTEGER_TYPE).sameOrBefore(boundlessInterval(ELM_INTEGER_TYPE)) + ).be.null(); + }); }); describe('meets', () => { @@ -3271,6 +3969,11 @@ describe('IntegerInterval', () => { uIvl.meets(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).meets(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.meets(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + }); }); describe('meetsAfter', () => { @@ -3392,6 +4095,11 @@ describe('IntegerInterval', () => { uIvl.meetsAfter(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).meetsAfter(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.meetsAfter(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + }); }); describe('meetsBefore', () => { @@ -3513,6 +4221,11 @@ describe('IntegerInterval', () => { uIvl.meetsBefore(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_INTEGER_TYPE).meetsBefore(d.zeroToHundred.closed).should.be.false(); + d.zeroToHundred.closed.meetsBefore(boundlessInterval(ELM_INTEGER_TYPE)).should.be.false(); + }); }); }); @@ -3556,6 +4269,8 @@ describe('LongInterval', () => { new Interval(0n, null, true, false).contains(0n).should.be.true(); should(new Interval(0n, null, true, false).contains(123456789n)).be.null(); new Interval(0n, null, true, false).contains(-1n).should.be.false(); + boundlessInterval(ELM_LONG_TYPE).contains(5n).should.be.true(); + should(unknownInterval(ELM_LONG_TYPE).contains(5n)).be.null(); }); it('should properly handle imprecision', () => { @@ -3707,6 +4422,15 @@ describe('LongInterval', () => { it('should include a point Long', () => { d.zeroToHundredLong.closed.includes(50n).should.be.true(); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE).includes(50n).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).includes(d.zeroToHundredLong.closed).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).includes(unknownInterval(ELM_LONG_TYPE)).should.be.true(); + d.zeroToHundredLong.closed.includes(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).includes(d.zeroToHundredLong.closed)).be.null(); + should(unknownInterval(ELM_LONG_TYPE).includes(boundlessInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('includedIn', () => { @@ -3822,9 +4546,63 @@ describe('LongInterval', () => { should.not.exist(uIvl.includedIn(uIvl)); }); - it('should include a point long', () => { - d.zeroToHundredLong.closed.includedIn(50n).should.be.true(); - d.zeroToHundredLong.closed.includedIn(500n).should.be.false(); + it('should properly handle boundless and unknown intervals', () => { + d.zeroToHundredLong.closed.includedIn(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).includedIn(d.zeroToHundredLong.closed).should.be.false(); + boundlessInterval(ELM_LONG_TYPE) + .includedIn(boundlessInterval(ELM_LONG_TYPE)) + .should.be.true(); + unknownInterval(ELM_LONG_TYPE).includedIn(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + }); + }); + + describe('properlyIncludes', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .properlyIncludes(d.zeroToHundredLong.closed) + .should.be.true(); + boundlessInterval(ELM_LONG_TYPE) + .properlyIncludes(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); + should( + boundlessInterval(ELM_LONG_TYPE).properlyIncludes(unknownInterval(ELM_LONG_TYPE)) + ).be.null(); + should(unknownInterval(ELM_LONG_TYPE).properlyIncludes(d.zeroToHundredLong.closed)).be.null(); + }); + }); + + describe('starts', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE).starts(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).starts(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.starts(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(boundlessInterval(ELM_LONG_TYPE).starts(unknownInterval(ELM_INTEGER_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).starts(boundlessInterval(ELM_LONG_TYPE))).be.null(); + }); + }); + + describe('ends', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE).ends(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).ends(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.ends(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(boundlessInterval(ELM_LONG_TYPE).ends(unknownInterval(ELM_LONG_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).ends(boundlessInterval(ELM_LONG_TYPE))).be.null(); }); }); @@ -3918,13 +4696,37 @@ describe('LongInterval', () => { y.open.overlaps(x.open).should.be.true(); }); + it('should properly handle null endpoints', () => { + const negativeInterval = new Interval(-123456789n, -1n); + const positiveInterval = new Interval(1n, 123456789n); + const startsAtZero = new Interval(0n, 123456789n); + const endsAtZero = new Interval(-123456789n, 0n); + + should(new Interval(null, 0n).overlaps(negativeInterval)).be.true(); + should(new Interval(null, 0n).overlaps(positiveInterval)).be.false(); + should(new Interval(null, 0n, false, true).overlaps(startsAtZero)).be.true(); + should(new Interval(null, 0n, false, true).overlaps(negativeInterval)).be.null(); + should(new Interval(null, 0n, false, true).overlaps(positiveInterval)).be.false(); + + should(new Interval(0n, null).overlaps(positiveInterval)).be.true(); + should(new Interval(0n, null).overlaps(negativeInterval)).be.false(); + should(new Interval(0n, null, true, false).overlaps(endsAtZero)).be.true(); + should(new Interval(0n, null, true, false).overlaps(positiveInterval)).be.null(); + should(new Interval(0n, null, true, false).overlaps(negativeInterval)).be.false(); + + should(boundlessInterval(ELM_LONG_TYPE).overlaps(d.zeroToHundredLong.closed)).be.true(); + should(unknownInterval(ELM_LONG_TYPE).overlaps(d.zeroToHundredLong.closed)).be.null(); + should(d.zeroToHundredLong.closed.overlaps(boundlessInterval(ELM_LONG_TYPE))).be.true(); + should(d.zeroToHundredLong.closed.overlaps(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); + it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(boundlessInterval()).should.be.true(); - boundlessInterval().overlaps(d.zeroToHundredLong.closed).should.be.true(); - d.zeroToHundredLong.closed.overlaps(boundlessInterval()).should.be.true(); - should(boundlessInterval().overlaps(unknownInterval())).be.null(); - should(unknownInterval().overlaps(boundlessInterval())).be.null(); - should(unknownInterval().overlaps(d.zeroToHundredLong.closed)).be.null(); + boundlessInterval(ELM_LONG_TYPE).overlaps(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).overlaps(d.zeroToHundredLong.closed).should.be.true(); + d.zeroToHundredLong.closed.overlaps(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).overlaps(unknownInterval(ELM_LONG_TYPE)).should.be.true(); + unknownInterval(ELM_LONG_TYPE).overlaps(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + should(unknownInterval(ELM_LONG_TYPE).overlaps(d.zeroToHundredLong.closed)).be.null(); }); it('should properly handle imprecision', () => { @@ -3950,70 +4752,6 @@ describe('LongInterval', () => { }); }); - describe('overlaps(Long)', () => { - let d: any; - beforeEach(() => { - d = data(); - }); - - it('should properly calculate longs less than it', () => { - d.zeroToHundredLong.closed.overlaps(-5n).should.be.false(); - }); - - it('should properly calculate the left boundary long', () => { - d.zeroToHundredLong.closed.overlaps(0n).should.be.true(); - d.zeroToHundredLong.open.overlaps(0n).should.be.false(); - }); - - it('should properly calculate longs in the middle of it', () => { - d.zeroToHundredLong.closed.overlaps(50n).should.be.true(); - }); - - it('should properly calculate the right boundary long', () => { - d.zeroToHundredLong.closed.overlaps(100n).should.be.true(); - d.zeroToHundredLong.open.overlaps(100n).should.be.false(); - }); - - it('should properly calculate longs greater than it', () => { - d.zeroToHundredLong.closed.overlaps(105n).should.be.false(); - }); - - it('should properly handle boundless and unknown intervals', () => { - boundlessInterval().overlaps(5n).should.be.true(); - should(boundlessInterval().overlaps(null)).be.null(); - should(unknownInterval().overlaps(5n)).be.null(); - }); - - it('should properly handle imprecision', () => { - d.zeroToHundredLong.closed.overlaps(new Uncertainty(-20n, -10n)).should.be.false(); - should.not.exist(d.zeroToHundredLong.closed.overlaps(new Uncertainty(-20n, 20n))); - d.zeroToHundredLong.closed.overlaps(new Uncertainty(0n, 100n)).should.be.true(); - should.not.exist(d.zeroToHundredLong.closed.overlaps(new Uncertainty(80n, 120n))); - d.zeroToHundredLong.closed.overlaps(new Uncertainty(120n, 140n)).should.be.false(); - should.not.exist(d.zeroToHundredLong.closed.overlaps(new Uncertainty(-20n, 120n))); - - const uIvl = new Interval(new Uncertainty(5n, 10n), new Uncertainty(15n, 20n)); - - uIvl.overlaps(0n).should.be.false(); - should.not.exist(uIvl.overlaps(5n)); - should.not.exist(uIvl.overlaps(6n)); - uIvl.overlaps(10n).should.be.true(); - uIvl.overlaps(12n).should.be.true(); - uIvl.overlaps(15n).should.be.true(); - should.not.exist(uIvl.overlaps(16n)); - should.not.exist(uIvl.overlaps(20n)); - uIvl.overlaps(25n).should.be.false(); - - uIvl.overlaps(new Uncertainty(0n, 4n)).should.be.false(); - should.not.exist(uIvl.overlaps(new Uncertainty(0n, 5n))); - should.not.exist(uIvl.overlaps(new Uncertainty(5n, 10n))); - uIvl.overlaps(new Uncertainty(10n, 15n)).should.be.true(); - should.not.exist(uIvl.overlaps(new Uncertainty(15n, 20n))); - should.not.exist(uIvl.overlaps(new Uncertainty(20n, 25n))); - uIvl.overlaps(new Uncertainty(25n, 30n)).should.be.false(); - }); - }); - describe('overlapsBefore', () => { let d: any; beforeEach(() => { @@ -4021,11 +4759,14 @@ describe('LongInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsBefore(d.zeroToHundredLong.closed).should.be.true(); - boundlessInterval().overlapsBefore(5n).should.be.true(); - d.zeroToHundredLong.closed.overlapsBefore(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsBefore(unknownInterval())).be.null(); - should(unknownInterval().overlapsBefore(boundlessInterval())).be.null(); + boundlessInterval(ELM_LONG_TYPE).overlapsBefore(d.zeroToHundredLong.closed).should.be.true(); + d.zeroToHundredLong.closed.overlapsBefore(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_LONG_TYPE).overlapsBefore(unknownInterval(ELM_LONG_TYPE)) + ).be.null(); + unknownInterval(ELM_LONG_TYPE) + .overlapsBefore(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); }); }); @@ -4036,11 +4777,14 @@ describe('LongInterval', () => { }); it('should properly handle boundless intervals', () => { - boundlessInterval().overlapsAfter(d.zeroToHundredLong.closed).should.be.true(); - boundlessInterval().overlapsAfter(5n).should.be.true(); - d.zeroToHundredLong.closed.overlapsAfter(boundlessInterval()).should.be.false(); - should(boundlessInterval().overlapsAfter(unknownInterval())).be.null(); - should(unknownInterval().overlapsAfter(boundlessInterval())).be.null(); + boundlessInterval(ELM_LONG_TYPE).overlapsAfter(d.zeroToHundredLong.closed).should.be.true(); + d.zeroToHundredLong.closed.overlapsAfter(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should( + boundlessInterval(ELM_LONG_TYPE).overlapsAfter(unknownInterval(ELM_LONG_TYPE)) + ).be.null(); + unknownInterval(ELM_LONG_TYPE) + .overlapsAfter(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); }); }); @@ -4184,6 +4928,31 @@ describe('LongInterval', () => { ivl.equals(point).should.be.false(); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE).equals(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).equals(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.equals(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(boundlessInterval(ELM_LONG_TYPE).equals(unknownInterval(ELM_LONG_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).equals(boundlessInterval(ELM_LONG_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).equals(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); + }); + + describe('sameAs', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE).sameAs(boundlessInterval(ELM_LONG_TYPE)).should.be.true(); + boundlessInterval(ELM_LONG_TYPE).sameAs(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.sameAs(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(boundlessInterval(ELM_LONG_TYPE).sameAs(unknownInterval(ELM_LONG_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).sameAs(boundlessInterval(ELM_LONG_TYPE))).be.null(); + should(unknownInterval(ELM_LONG_TYPE).sameAs(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('union', () => { @@ -4304,10 +5073,10 @@ describe('LongInterval', () => { ivl = new Interval(10n, 15n); i = ivl.union(uIvl); - i.should.eql(uIvl); + i.should.equalInterval(uIvl); i = uIvl.union(ivl); - i.should.eql(uIvl); + i.should.equalInterval(uIvl); ivl = new Interval(15n, 20n); i = ivl.union(uIvl); @@ -4328,6 +5097,22 @@ describe('LongInterval', () => { it('should throw when the argument is a point', () => { should(() => d.zeroToHundredLong.union(300n)).throw(Error); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .union(d.zeroToHundredLong.closed) + .should.equalInterval(boundlessInterval(ELM_LONG_TYPE)); + d.zeroToHundredLong.closed + .union(boundlessInterval(ELM_LONG_TYPE)) + .should.equalInterval(boundlessInterval(ELM_LONG_TYPE)); + boundlessInterval(ELM_LONG_TYPE) + .union(unknownInterval(ELM_LONG_TYPE)) + .should.equalInterval(boundlessInterval(ELM_LONG_TYPE)); + unknownInterval(ELM_LONG_TYPE) + .union(boundlessInterval(ELM_LONG_TYPE)) + .should.equalInterval(boundlessInterval(ELM_LONG_TYPE)); + should(unknownInterval(ELM_LONG_TYPE).union(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('intersect', () => { @@ -4430,8 +5215,8 @@ describe('LongInterval', () => { let x = new Interval(b, e); let y = new Interval(a, c); - x.intersect(y).should.eql(new Interval(b, c)); - y.intersect(x).should.eql(new Interval(b, c)); + x.intersect(y).should.equalInterval(new Interval(b, c)); + y.intersect(x).should.equalInterval(new Interval(b, c)); x = new Interval(a, b); y = new Interval(b, d); @@ -4442,13 +5227,13 @@ describe('LongInterval', () => { x = new Interval(a, e); y = new Interval(b, d); - x.intersect(y).should.eql(y); - y.intersect(x).should.eql(y); + x.intersect(y).should.equalInterval(y); + y.intersect(x).should.equalInterval(y); x = new Interval(a, d); y = new Interval(b, e); - x.intersect(y).should.eql(new Interval(b, d)); - y.intersect(x).should.eql(new Interval(b, d)); + x.intersect(y).should.equalInterval(new Interval(b, d)); + y.intersect(x).should.equalInterval(new Interval(b, d)); x = new Interval(a, b); y = new Interval(d, e); @@ -4457,13 +5242,33 @@ describe('LongInterval', () => { x = new Interval(new Uncertainty(5n, 10n), new Uncertainty(15n, 20n)); y = new Interval(8n, 17n); - x.intersect(y).should.eql(new Interval(new Uncertainty(8n, 10n), new Uncertainty(15n, 17n))); - y.intersect(x).should.eql(new Interval(new Uncertainty(8n, 10n), new Uncertainty(15n, 17n))); + x.intersect(y).should.equalInterval( + new Interval(new Uncertainty(8n, 10n), new Uncertainty(15n, 17n)) + ); + y.intersect(x).should.equalInterval( + new Interval(new Uncertainty(8n, 10n), new Uncertainty(15n, 17n)) + ); }); it('should throw when the argument is a point', () => { should(() => d.zeroToHundredLong.intersect(50n)).throw(Error); }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .intersect(d.zeroToHundredLong.closed) + .should.equalInterval(d.zeroToHundredLong.closed); + d.zeroToHundredLong.closed + .intersect(boundlessInterval(ELM_LONG_TYPE)) + .should.equalInterval(d.zeroToHundredLong.closed); + boundlessInterval(ELM_LONG_TYPE) + .intersect(unknownInterval(ELM_LONG_TYPE)) + .should.equalInterval(unknownInterval(ELM_LONG_TYPE)); + unknownInterval(ELM_LONG_TYPE) + .intersect(boundlessInterval(ELM_LONG_TYPE)) + .should.equalInterval(unknownInterval(ELM_LONG_TYPE)); + should(unknownInterval(ELM_LONG_TYPE).intersect(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('except', () => { @@ -4486,26 +5291,26 @@ describe('LongInterval', () => { it('should properly calculate before/after except', () => { const [x, y] = Array.from(xy(d.lIvl.before)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate meets except', () => { const [x, y] = Array.from(xy(d.lIvl.meets)); - x.closed.except(y.closed).should.eql(x.closed); - x.closed.except(y.open).should.eql(x.closed); - x.open.except(y.closed).should.eql(x.open); - x.open.except(y.open).should.eql(x.open); - y.closed.except(x.closed).should.eql(y.closed); - y.closed.except(x.open).should.eql(y.closed); - y.open.except(x.closed).should.eql(y.open); - y.open.except(x.open).should.eql(y.open); + x.closed.except(y.closed).should.equalInterval(x.closed); + x.closed.except(y.open).should.equalInterval(x.closed); + x.open.except(y.closed).should.equalInterval(x.open); + x.open.except(y.open).should.equalInterval(x.open); + y.closed.except(x.closed).should.equalInterval(y.closed); + y.closed.except(x.open).should.equalInterval(y.closed); + y.open.except(x.closed).should.equalInterval(y.open); + y.open.except(x.open).should.equalInterval(y.open); }); it('should properly calculate left/right overlapping except', () => { @@ -4526,7 +5331,7 @@ describe('LongInterval', () => { const [x, y] = Array.from(xy(d.lIvl.begins)); const b = d.sixtyToHundredLong; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.low, x.closed.low)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.low, x.closed.low)); should.not.exist(x.open.except(y.closed)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.openClosed).should.be.true(); @@ -4551,7 +5356,7 @@ describe('LongInterval', () => { const [x, y] = Array.from(xy(d.lIvl.ends)); const b = d.zeroToFortyLong; should.not.exist(x.closed.except(y.closed)); - x.closed.except(y.open).should.eql(new Interval(x.closed.high, x.closed.high)); + x.closed.except(y.open).should.equalInterval(new Interval(x.closed.high, x.closed.high)); should.not.exist(x.open.except(y.closed)); should.not.exist(x.open.except(y.open)); y.closed.except(x.closed).equals(b.closedOpen).should.be.true(); @@ -4569,8 +5374,8 @@ describe('LongInterval', () => { let x = new Interval(b, e); //([10n,20n] , 100n) let y = new Interval(a, c); //( 0n , 50n) - x.except(y).should.eql(new Interval(c, e, false, true)); - y.except(x).should.eql(new Interval(a, b, true, false)); + x.except(y).should.equalInterval(new Interval(c, e, false, true)); + y.except(x).should.equalInterval(new Interval(a, b, true, false)); x = new Interval(a, b); y = new Interval(b, d); @@ -4586,13 +5391,13 @@ describe('LongInterval', () => { x = new Interval(a, d); y = new Interval(b, e); - x.except(y).should.eql(new Interval(a, b, true, false)); - y.except(x).should.eql(new Interval(d, e, false, true)); + x.except(y).should.equalInterval(new Interval(a, b, true, false)); + y.except(x).should.equalInterval(new Interval(d, e, false, true)); x = new Interval(a, b); y = new Interval(d, e); - x.except(y).should.eql(x); - y.except(x).should.eql(y); + x.except(y).should.equalInterval(x); + y.except(x).should.equalInterval(y); }); it('should throw when the argument is a point', () => { @@ -4719,6 +5524,33 @@ describe('LongInterval', () => { uIvl.after(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_LONG_TYPE).after(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + boundlessInterval(ELM_LONG_TYPE).after(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.after(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + unknownInterval(ELM_LONG_TYPE).after(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).after(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); + }); + + describe('sameOrAfter', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .sameOrAfter(boundlessInterval(ELM_LONG_TYPE)) + .should.be.true(); + boundlessInterval(ELM_LONG_TYPE).sameOrAfter(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.sameOrAfter(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should( + unknownInterval(ELM_LONG_TYPE).sameOrAfter(boundlessInterval(ELM_LONG_TYPE)) + ).be.null(); + should(unknownInterval(ELM_LONG_TYPE).sameOrAfter(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('before', () => { @@ -4840,6 +5672,33 @@ describe('LongInterval', () => { uIvl.before(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_LONG_TYPE).before(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + boundlessInterval(ELM_LONG_TYPE).before(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.before(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + unknownInterval(ELM_LONG_TYPE).before(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).before(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); + }); + + describe('sameOrBefore', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + + it('should properly handle boundless and unknown intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .sameOrBefore(boundlessInterval(ELM_LONG_TYPE)) + .should.be.true(); + boundlessInterval(ELM_LONG_TYPE).sameOrBefore(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.sameOrBefore(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should( + unknownInterval(ELM_LONG_TYPE).sameOrBefore(boundlessInterval(ELM_LONG_TYPE)) + ).be.null(); + should(unknownInterval(ELM_LONG_TYPE).sameOrBefore(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('meets', () => { @@ -4961,6 +5820,14 @@ describe('LongInterval', () => { uIvl.meets(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_LONG_TYPE).meets(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + boundlessInterval(ELM_LONG_TYPE).meets(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.meets(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + unknownInterval(ELM_LONG_TYPE).meets(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).meets(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('meetsAfter', () => { @@ -5082,6 +5949,16 @@ describe('LongInterval', () => { uIvl.meetsAfter(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .meetsAfter(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); + boundlessInterval(ELM_LONG_TYPE).meetsAfter(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.meetsAfter(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + unknownInterval(ELM_LONG_TYPE).meetsAfter(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).meetsAfter(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); describe('meetsBefore', () => { @@ -5203,10 +6080,27 @@ describe('LongInterval', () => { uIvl.meetsBefore(uIvl).should.be.false(); }); + + it('should properly handle boundless intervals', () => { + boundlessInterval(ELM_LONG_TYPE) + .meetsBefore(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); + boundlessInterval(ELM_LONG_TYPE).meetsBefore(d.zeroToHundredLong.closed).should.be.false(); + d.zeroToHundredLong.closed.meetsBefore(boundlessInterval(ELM_LONG_TYPE)).should.be.false(); + unknownInterval(ELM_LONG_TYPE) + .meetsBefore(boundlessInterval(ELM_LONG_TYPE)) + .should.be.false(); + should(unknownInterval(ELM_LONG_TYPE).meetsBefore(unknownInterval(ELM_LONG_TYPE))).be.null(); + }); }); }); describe('DecimalInterval', () => { + let d: any; + beforeEach(() => { + d = data(); + }); + it('should close open decimal uncertainty endpoints using decimal point size', () => { const closed = new Interval( new Uncertainty(1, 2), @@ -5236,5 +6130,151 @@ describe('DecimalInterval', () => { later.meetsAfter(earlier).should.be.true(); }); - // TODO: More decimal tests, similar to IntegerInterval and LongInterval test suites + it('should properly calculate meets intervals', () => { + const [x, y] = Array.from(xy(d.dIvl.meets)); + x.closed.overlaps(y.closed).should.be.false(); + x.closed.overlaps(y.open).should.be.false(); + x.open.overlaps(y.closed).should.be.false(); + x.open.overlaps(y.open).should.be.false(); + y.closed.overlaps(x.closed).should.be.false(); + y.closed.overlaps(x.open).should.be.false(); + y.open.overlaps(x.closed).should.be.false(); + y.open.overlaps(x.open).should.be.false(); + }); + + it('should properly calculate left/right overlapping intervals', () => { + const [x, y] = Array.from(xy(d.dIvl.overlaps)); + x.closed.overlaps(y.closed).should.be.true(); + x.closed.overlaps(y.open).should.be.true(); + x.open.overlaps(y.closed).should.be.true(); + x.open.overlaps(y.open).should.be.true(); + y.closed.overlaps(x.closed).should.be.true(); + y.closed.overlaps(x.open).should.be.true(); + y.open.overlaps(x.closed).should.be.true(); + y.open.overlaps(x.open).should.be.true(); + }); + + it('should properly calculate begins/begun by intervals', () => { + const [x, y] = Array.from(xy(d.dIvl.begins)); + x.closed.overlaps(y.closed).should.be.true(); + x.closed.overlaps(y.open).should.be.true(); + x.open.overlaps(y.closed).should.be.true(); + x.open.overlaps(y.open).should.be.true(); + y.closed.overlaps(x.closed).should.be.true(); + y.closed.overlaps(x.open).should.be.true(); + y.open.overlaps(x.closed).should.be.true(); + y.open.overlaps(x.open).should.be.true(); + }); + + it('should properly calculate includes/included by intervals', () => { + const [x, y] = Array.from(xy(d.dIvl.during)); + x.closed.overlaps(y.closed).should.be.true(); + x.closed.overlaps(y.open).should.be.true(); + x.open.overlaps(y.closed).should.be.true(); + x.open.overlaps(y.open).should.be.true(); + y.closed.overlaps(x.closed).should.be.true(); + y.closed.overlaps(x.open).should.be.true(); + y.open.overlaps(x.closed).should.be.true(); + y.open.overlaps(x.open).should.be.true(); + }); + + it('should properly calculate ends/ended by intervals', () => { + const [x, y] = Array.from(xy(d.dIvl.ends)); + x.closed.overlaps(y.closed).should.be.true(); + x.closed.overlaps(y.open).should.be.true(); + x.open.overlaps(y.closed).should.be.true(); + x.open.overlaps(y.open).should.be.true(); + y.closed.overlaps(x.closed).should.be.true(); + y.closed.overlaps(x.open).should.be.true(); + y.open.overlaps(x.closed).should.be.true(); + y.open.overlaps(x.open).should.be.true(); + }); + + it('should properly handle null endpoints', () => { + const decimal = 1.5; + const early = -1.5; + const late = 3.5; + const decimalInterval = new Interval(0.5, 1.5); + const earlyInterval = new Interval(early, -0.5); + const lateInterval = new Interval(3.5, late); + const startsAtDecimal = new Interval(decimal, late); + const endsAtDecimal = new Interval(early, decimal); + + should(new Interval(null, decimal).overlaps(earlyInterval)).be.true(); + should(new Interval(null, decimal).overlaps(lateInterval)).be.false(); + should(new Interval(null, decimal, false, true).overlaps(startsAtDecimal)).be.true(); + should(new Interval(null, decimal, false, true).overlaps(earlyInterval)).be.null(); + should(new Interval(null, decimal, false, true).overlaps(lateInterval)).be.false(); + + should(new Interval(decimal, null).overlaps(lateInterval)).be.true(); + should(new Interval(decimal, null).overlaps(earlyInterval)).be.false(); + should(new Interval(decimal, null, true, false).overlaps(endsAtDecimal)).be.true(); + should(new Interval(decimal, null, true, false).overlaps(lateInterval)).be.null(); + should(new Interval(decimal, null, true, false).overlaps(earlyInterval)).be.false(); + + should(boundlessInterval(ELM_DECIMAL_TYPE).overlaps(decimalInterval)).be.true(); + should(unknownInterval(ELM_DECIMAL_TYPE).overlaps(decimalInterval)).be.null(); + should(decimalInterval.overlaps(boundlessInterval(ELM_DECIMAL_TYPE))).be.true(); + should(decimalInterval.overlaps(unknownInterval(ELM_DECIMAL_TYPE))).be.null(); + should( + boundlessInterval(ELM_DECIMAL_TYPE).overlaps(boundlessInterval(ELM_DECIMAL_TYPE)) + ).be.true(); + should( + boundlessInterval(ELM_DECIMAL_TYPE).overlaps(unknownInterval(ELM_DECIMAL_TYPE)) + ).be.true(); + should( + unknownInterval(ELM_DECIMAL_TYPE).overlaps(boundlessInterval(ELM_DECIMAL_TYPE)) + ).be.true(); + should(unknownInterval(ELM_DECIMAL_TYPE).overlaps(unknownInterval(ELM_DECIMAL_TYPE))).be.null(); + }); + + it('should properly handle boundless and unknown intervals', () => { + const decimalInterval = new Interval(0.5, 1.5); + + boundlessInterval(ELM_DECIMAL_TYPE) + .overlaps(boundlessInterval(ELM_DECIMAL_TYPE)) + .should.be.true(); + boundlessInterval(ELM_DECIMAL_TYPE).overlaps(decimalInterval).should.be.true(); + decimalInterval.overlaps(boundlessInterval(ELM_DECIMAL_TYPE)).should.be.true(); + boundlessInterval(ELM_DECIMAL_TYPE) + .overlaps(unknownInterval(ELM_DECIMAL_TYPE)) + .should.be.true(); + unknownInterval(ELM_DECIMAL_TYPE) + .overlaps(boundlessInterval(ELM_DECIMAL_TYPE)) + .should.be.true(); + should(unknownInterval(ELM_DECIMAL_TYPE).overlaps(decimalInterval)).be.null(); + }); + + it('should properly handle imprecision', () => { + let [x, y] = Array.from(xy(d.dIvl.sameAs)); + x.closed.overlaps(y.toMinute).should.be.true(); + x.toHour.overlaps(y.toMinute).should.be.true(); + + [x, y] = Array.from(xy(d.dIvl.before)); + x.toMonth.overlaps(y.toMonth).should.be.false(); + should.not.exist(x.toYear.overlaps(y.closed)); + + [x, y] = Array.from(xy(d.dIvl.meets)); + x.toMonth.overlaps(y.toMonth).should.be.false(); + should.not.exist(x.toYear.overlaps(y.closed)); + + [x, y] = Array.from(xy(d.dIvl.overlaps)); + x.toMonth.overlaps(y.toMonth).should.be.true(); + should.not.exist(x.toYear.overlaps(y.closed)); + + [x, y] = Array.from(xy(d.dIvl.begins)); + x.toMinute.overlaps(y.toMinute).should.be.true(); + should.not.exist(x.toYear.overlaps(y.closed)); + + [x, y] = Array.from(xy(d.dIvl.during)); + x.toMonth.overlaps(y.toMonth).should.be.true(); + y.toMonth.overlaps(x.toMonth).should.be.true(); + should.not.exist(x.toYear.overlaps(y.closed)); + + [x, y] = Array.from(xy(d.dIvl.ends)); + x.toMinute.overlaps(y.toMinute).should.be.true(); + should.not.exist(x.toYear.overlaps(y.closed)); + }); }); + +// TODO: Tests for real numbers (i.e., floats) diff --git a/test/elm/interval/data.cql b/test/elm/interval/data.cql index 9dcb441b..89579caa 100644 --- a/test/elm/interval/data.cql +++ b/test/elm/interval/data.cql @@ -77,12 +77,12 @@ define MayContainImpreciseDate: DateIvlHighOpen contains DateTime(2012) define PrecisionDateIvlHighOpen: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) define PrecisionDateIvlHighClosed: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)] define ContainsDayOfDateLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 2, 0, 0, 0, 0) -define NotContainsDayOfDateHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) +define ContainsDayOfDateHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) define ContainsDayOfDateHighEdgeClosed: PrecisionDateIvlHighClosed contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) define NotContainsDayOfDateLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 1, 23, 59, 59, 999) define NotContainsDayOfDateBeyondHighEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 3, 0, 0, 0, 0) define ContainsDayOfDateImpreciseLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 2) -define NotContainsDayOfDateImpreciseHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2) +define ContainsDayOfDateImpreciseHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2) define ContainsDayOfDateImpreciseHighEdgeClosed: PrecisionDateIvlHighClosed contains day of DateTime(2012, 9, 2) define ContainsDayOfDateVeryImpreciseMiddle: PrecisionDateIvlHighOpen contains day of DateTime(2012, 6) define NotContainsDayOfDateVeryImpreciseLow: PrecisionDateIvlHighOpen contains day of DateTime(2012, 2) @@ -146,12 +146,12 @@ define MayContainImpreciseDate: DateTime(2012) in DateIvlHighClosed define PrecisionDateIvlHighOpen: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) define PrecisionDateIvlHighClosed: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)] define ContainsDayOfDateLowEdge: DateTime(2012, 3, 2, 0, 0, 0, 0) in day of PrecisionDateIvlHighOpen -define NotContainsDayOfDateHighEdgeOpen: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen +define ContainsDayOfDateHighEdgeOpen: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateHighEdgeClosed: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighClosed define NotContainsDayOfDateLowEdge: DateTime(2012, 3, 1, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen define NotContainsDayOfDateBeyondHighEdge: DateTime(2012, 9, 3, 0, 0, 0, 0) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateImpreciseLowEdge: DateTime(2012, 3, 2) in day of PrecisionDateIvlHighOpen -define NotContainsDayOfDateImpreciseHighEdgeOpen: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighOpen +define ContainsDayOfDateImpreciseHighEdgeOpen: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateImpreciseHighEdgeClosed: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighClosed define ContainsDayOfDateVeryImpreciseMiddle: DateTime(2012, 6) in day of PrecisionDateIvlHighOpen define NotContainsDayOfDateVeryImpreciseLow: DateTime(2012, 2) in day of PrecisionDateIvlHighOpen @@ -787,8 +787,8 @@ define OverlapsBeforeRealIvl: Interval[1.234, 1.567] overlaps Interval[1.345, 1. define OverlapsAfterRealIvl: Interval[1.345, 1.678] overlaps Interval[1.234, 1.567] define OverlapsBoundaryRealIvl: Interval[1.0, 1.234] overlaps Interval[1.234, 2.0] define NoOverlapsRealIvl: Interval[1.0, 1.23456789) overlaps Interval[1.23456789, 2.0] -define OverlapsClosedNullIntervalLHS: Interval[null, null] overlaps Interval[6, 10] -define OverlapsClosedNullIntervalRHS: Interval[6, 10] overlaps Interval[null, null] +define OverlapsClosedNullIntervalLHS: Interval[null as Integer, null as Integer] overlaps Interval[6, 10] +define OverlapsClosedNullIntervalRHS: Interval[6, 10] overlaps (Interval[null as Integer, null as Integer]) define OverlapsIsNull: Interval[6, 10] overlaps (null as Interval) // @Test: OverlapsDateTime @@ -809,8 +809,8 @@ define NoOverlap: ivlC overlaps ivlD define NoImpreciseOverlap: ivlE overlaps ivlG define UnknownOverlap: ivlE overlaps ivlH define MatchingPrecisionOverlap: ivlF overlaps ivlG -define OverlapsClosedNullIntervalLHS: Interval[null, null] overlaps ivlA -define OverlapsClosedNullIntervalRHS: ivlA overlaps Interval[null, null] +define OverlapsClosedNullIntervalLHS: Interval[null as DateTime, null as DateTime] overlaps ivlA +define OverlapsClosedNullIntervalRHS: ivlA overlaps Interval[null as DateTime, null as DateTime] define PrecisionDateIvl: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) // NOTE: There appears to be a bug in cql-to-elm that translates these 'overlaps' to 'OverlapsAfter'! define OverlapsBeforeDayOfIvlEdge: PrecisionDateIvl overlaps day of Interval[DateTime(2012, 9, 2, 23, 59, 59, 999), DateTime(2012, 10, 1, 0, 0, 0, 0)] @@ -964,7 +964,7 @@ define OpenLongNotNull: end of Interval(1L, 3L) define OpenNull: end of Interval(DateTime(2013, 1, 1), null) // @Test: Starts -define TestStartsNull: Interval[null, null] starts Interval[1, 10] +define TestStartsNull: Interval[null as Integer, null as Integer] starts Interval[1, 10] define IntegerIntervalStartsTrue: Interval[4,10] starts Interval[4, 15] define IntegerIntervalStartsFalse: Interval[1, 10] starts Interval[4, 10] define IntegerIntervalStartEndsFalse: Interval[4, 10] starts Interval[4, 9] @@ -983,7 +983,7 @@ define DateTimeIntervalStartsDayOfTrue: Interval[DateTime(2012, 1, 5), DateTime( define DateTimeIntervalStartsEndsFalse: Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] starts day of Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 24)] // @Test: Ends -define TestEndsNull: Interval[1, 10] ends Interval[null, null] +define TestEndsNull: Interval[1, 10] ends Interval[null as Integer, null as Integer] define IntegerIntervalEndsTrue: Interval[4,10] ends Interval[1,10] define IntegerIntervalEndsFalse: Interval[4, 9] ends Interval[1,10] define IntegerIntervalEndsStartsFalse: Interval[0, 10] ends Interval[1,10] @@ -1291,7 +1291,7 @@ define DateTimeNullStartCollapseNoOverlap: collapse { DateTime9_10Interval, Date define DateTimeNullStartCollapseNoOverlapExpected: { DateTimeNull_5Interval, DateTime9_10Interval } define DateTimeNullEndCollapseExpected: { Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), null] } define DateTimeNullStartEndCollapse: collapse { DateTimeNull_5Interval, DateTime1_10Interval, DateTime5_NullInterval } -define DateTimeNullStartEndCollapseExpected: { Interval[null, null] } +define DateTimeNullStartEndCollapseExpected: { Interval[null as DateTime, null as DateTime] } define QuantityMeterNullLowIntervalList: { Interval[null, ToQuantity('1.995 \'m\'')], Interval[ToQuantity('2 \'m\''), ToQuantity('3 \'m\'')] } define CollapseQuantityNullLowUnitsWithinPer: collapse QuantityMeterNullLowIntervalList per ToQuantity('1 \'cm\'') define CollapseQuantityNullLowUnitsWithinPerExpected : { Interval[null, ToQuantity('3 \'m\'')] } @@ -1300,7 +1300,7 @@ define CollapseQuantityNullHighUnitsWithinPer: collapse QuantityMeterNullHighInt define CollapseQuantityNullHighUnitsWithinPerExpected : { Interval[ToQuantity('1 \'m\''), null] } define QuantityIntervalListWithNulls: { Interval[ToQuantity(4), ToQuantity(8)], Interval[null, ToQuantity(2)], Interval[ToQuantity(1), ToQuantity(4)], Interval[ToQuantity(7), null] } define CollapseQuantityIntervalListWithNulls: collapse QuantityIntervalListWithNulls -define CollapseQuantityIntervalListWithNullsExpected: { Interval[null, null] } +define CollapseQuantityIntervalListWithNullsExpected: { Interval[null as Quantity, null as Quantity] } define QuantityIntervalListWithNullLowNoOverlap: { Interval[ToQuantity(4), ToQuantity(8)], Interval[null, ToQuantity(2)] } define CollapseQuantityIntervalListWithNullLowNoOverlap: collapse QuantityIntervalListWithNullLowNoOverlap define CollapseQuantityIntervalListWithNullLowNoOverlapExpected: { Interval[null, ToQuantity(2)], Interval[ToQuantity(4), ToQuantity(8)]} diff --git a/test/elm/interval/data.js b/test/elm/interval/data.js index 1c0ba826..b6fe0a68 100644 --- a/test/elm/interval/data.js +++ b/test/elm/interval/data.js @@ -10471,12 +10471,12 @@ define MayContainImpreciseDate: DateIvlHighOpen contains DateTime(2012) define PrecisionDateIvlHighOpen: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) define PrecisionDateIvlHighClosed: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)] define ContainsDayOfDateLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 2, 0, 0, 0, 0) -define NotContainsDayOfDateHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) +define ContainsDayOfDateHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) define ContainsDayOfDateHighEdgeClosed: PrecisionDateIvlHighClosed contains day of DateTime(2012, 9, 2, 23, 59, 59, 999) define NotContainsDayOfDateLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 1, 23, 59, 59, 999) define NotContainsDayOfDateBeyondHighEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 3, 0, 0, 0, 0) define ContainsDayOfDateImpreciseLowEdge: PrecisionDateIvlHighOpen contains day of DateTime(2012, 3, 2) -define NotContainsDayOfDateImpreciseHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2) +define ContainsDayOfDateImpreciseHighEdgeOpen: PrecisionDateIvlHighOpen contains day of DateTime(2012, 9, 2) define ContainsDayOfDateImpreciseHighEdgeClosed: PrecisionDateIvlHighClosed contains day of DateTime(2012, 9, 2) define ContainsDayOfDateVeryImpreciseMiddle: PrecisionDateIvlHighOpen contains day of DateTime(2012, 6) define NotContainsDayOfDateVeryImpreciseLow: PrecisionDateIvlHighOpen contains day of DateTime(2012, 2) @@ -13430,7 +13430,7 @@ module.exports['Contains'] = { }, { "localId" : "724", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "name" : "NotContainsDayOfDateHighEdgeOpen", + "name" : "ContainsDayOfDateHighEdgeOpen", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -13439,7 +13439,7 @@ module.exports['Contains'] = { "s" : { "r" : "724", "s" : [ { - "value" : [ "", "define ", "NotContainsDayOfDateHighEdgeOpen", ": " ] + "value" : [ "", "define ", "ContainsDayOfDateHighEdgeOpen", ": " ] }, { "r" : "725", "s" : [ { @@ -14223,7 +14223,7 @@ module.exports['Contains'] = { }, { "localId" : "882", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "name" : "NotContainsDayOfDateImpreciseHighEdgeOpen", + "name" : "ContainsDayOfDateImpreciseHighEdgeOpen", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -14232,7 +14232,7 @@ module.exports['Contains'] = { "s" : { "r" : "882", "s" : [ { - "value" : [ "", "define ", "NotContainsDayOfDateImpreciseHighEdgeOpen", ": " ] + "value" : [ "", "define ", "ContainsDayOfDateImpreciseHighEdgeOpen", ": " ] }, { "r" : "883", "s" : [ { @@ -20675,12 +20675,12 @@ define MayContainImpreciseDate: DateTime(2012) in DateIvlHighClosed define PrecisionDateIvlHighOpen: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) define PrecisionDateIvlHighClosed: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)] define ContainsDayOfDateLowEdge: DateTime(2012, 3, 2, 0, 0, 0, 0) in day of PrecisionDateIvlHighOpen -define NotContainsDayOfDateHighEdgeOpen: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen +define ContainsDayOfDateHighEdgeOpen: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateHighEdgeClosed: DateTime(2012, 9, 2, 23, 59, 59, 999) in day of PrecisionDateIvlHighClosed define NotContainsDayOfDateLowEdge: DateTime(2012, 3, 1, 23, 59, 59, 999) in day of PrecisionDateIvlHighOpen define NotContainsDayOfDateBeyondHighEdge: DateTime(2012, 9, 3, 0, 0, 0, 0) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateImpreciseLowEdge: DateTime(2012, 3, 2) in day of PrecisionDateIvlHighOpen -define NotContainsDayOfDateImpreciseHighEdgeOpen: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighOpen +define ContainsDayOfDateImpreciseHighEdgeOpen: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighOpen define ContainsDayOfDateImpreciseHighEdgeClosed: DateTime(2012, 9, 2) in day of PrecisionDateIvlHighClosed define ContainsDayOfDateVeryImpreciseMiddle: DateTime(2012, 6) in day of PrecisionDateIvlHighOpen define NotContainsDayOfDateVeryImpreciseLow: DateTime(2012, 2) in day of PrecisionDateIvlHighOpen @@ -23640,7 +23640,7 @@ module.exports['In'] = { }, { "localId" : "724", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "name" : "NotContainsDayOfDateHighEdgeOpen", + "name" : "ContainsDayOfDateHighEdgeOpen", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -23649,7 +23649,7 @@ module.exports['In'] = { "s" : { "r" : "724", "s" : [ { - "value" : [ "", "define ", "NotContainsDayOfDateHighEdgeOpen", ": " ] + "value" : [ "", "define ", "ContainsDayOfDateHighEdgeOpen", ": " ] }, { "r" : "725", "s" : [ { @@ -24433,7 +24433,7 @@ module.exports['In'] = { }, { "localId" : "882", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", - "name" : "NotContainsDayOfDateImpreciseHighEdgeOpen", + "name" : "ContainsDayOfDateImpreciseHighEdgeOpen", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -24442,7 +24442,7 @@ module.exports['In'] = { "s" : { "r" : "882", "s" : [ { - "value" : [ "", "define ", "NotContainsDayOfDateImpreciseHighEdgeOpen", ": " ] + "value" : [ "", "define ", "ContainsDayOfDateImpreciseHighEdgeOpen", ": " ] }, { "r" : "883", "s" : [ { @@ -157688,8 +157688,8 @@ define OverlapsBeforeRealIvl: Interval[1.234, 1.567] overlaps Interval[1.345, 1. define OverlapsAfterRealIvl: Interval[1.345, 1.678] overlaps Interval[1.234, 1.567] define OverlapsBoundaryRealIvl: Interval[1.0, 1.234] overlaps Interval[1.234, 2.0] define NoOverlapsRealIvl: Interval[1.0, 1.23456789) overlaps Interval[1.23456789, 2.0] -define OverlapsClosedNullIntervalLHS: Interval[null, null] overlaps Interval[6, 10] -define OverlapsClosedNullIntervalRHS: Interval[6, 10] overlaps Interval[null, null] +define OverlapsClosedNullIntervalLHS: Interval[null as Integer, null as Integer] overlaps Interval[6, 10] +define OverlapsClosedNullIntervalRHS: Interval[6, 10] overlaps (Interval[null as Integer, null as Integer]) define OverlapsIsNull: Interval[6, 10] overlaps (null as Interval) */ @@ -157705,7 +157705,7 @@ module.exports['Overlaps'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "480", + "r" : "476", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -159327,20 +159327,45 @@ module.exports['Overlaps'] = { "s" : [ { "value" : [ "", "define ", "OverlapsClosedNullIntervalLHS", ": " ] }, { - "r" : "441", + "r" : "445", "s" : [ { - "r" : "433", + "r" : "437", "s" : [ { + "value" : [ "Interval[" ] + }, { "r" : "431", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "432", + "value" : [ "null", " as " ] + }, { + "r" : "433", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "434", + "s" : [ { + "r" : "435", + "value" : [ "null", " as " ] + }, { + "r" : "436", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] }, { - "r" : "441", + "r" : "445", "value" : [ " ", "overlaps", " " ] }, { - "r" : "438", + "r" : "442", "s" : [ { - "r" : "436", + "r" : "440", "value" : [ "Interval[", "6", ", ", "10", "]" ] } ] } ] @@ -159349,212 +159374,109 @@ module.exports['Overlaps'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "441", + "localId" : "445", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "449", + "localId" : "446", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "450", + "localId" : "447", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "451", + "localId" : "448", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "452", + "localId" : "449", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "442", + "localId" : "437", + "lowClosed" : true, + "highClosed" : true, "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "438", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "439", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } + }, "low" : { "type" : "As", - "localId" : "444", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "431", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "443", - "path" : "low", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "433", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "434", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "435", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "431", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "432", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "lowClosedExpression" : { - "type" : "Property", - "localId" : "445", - "path" : "lowClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", + "type" : "Null", + "localId" : "432", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", "localId" : "433", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "434", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "435", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "431", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "432", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } }, "high" : { "type" : "As", - "localId" : "447", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "434", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "446", - "path" : "high", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "433", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "434", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "435", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "431", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "432", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "highClosedExpression" : { - "type" : "Property", - "localId" : "448", - "path" : "highClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "433", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "434", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "435", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "431", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "432", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "type" : "Null", + "localId" : "435", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "436", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "438", + "localId" : "442", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "439", + "localId" : "443", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "440", + "localId" : "444", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "436", + "localId" : "440", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "6", @@ -159562,7 +159484,7 @@ module.exports['Overlaps'] = { }, "high" : { "type" : "Literal", - "localId" : "437", + "localId" : "441", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -159571,7 +159493,7 @@ module.exports['Overlaps'] = { } ] } }, { - "localId" : "455", + "localId" : "452", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsClosedNullIntervalRHS", "context" : "Patient", @@ -159580,25 +159502,57 @@ module.exports['Overlaps'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "455", + "r" : "452", "s" : [ { "value" : [ "", "define ", "OverlapsClosedNullIntervalRHS", ": " ] }, { - "r" : "466", + "r" : "469", "s" : [ { - "r" : "458", + "r" : "455", "s" : [ { - "r" : "456", + "r" : "453", "value" : [ "Interval[", "6", ", ", "10", "]" ] } ] }, { - "r" : "466", + "r" : "469", "value" : [ " ", "overlaps", " " ] }, { - "r" : "463", + "r" : "464", "s" : [ { - "r" : "461", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "value" : [ "(" ] + }, { + "r" : "464", + "s" : [ { + "value" : [ "Interval[" ] + }, { + "r" : "458", + "s" : [ { + "r" : "459", + "value" : [ "null", " as " ] + }, { + "r" : "460", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "461", + "s" : [ { + "r" : "462", + "value" : [ "null", " as " ] + }, { + "r" : "463", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ "]" ] + } ] + }, { + "value" : [ ")" ] } ] } ] } ] @@ -159606,50 +159560,50 @@ module.exports['Overlaps'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "466", + "localId" : "469", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "474", + "localId" : "470", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "475", + "localId" : "471", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "476", + "localId" : "472", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "477", + "localId" : "473", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "458", + "localId" : "455", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "459", + "localId" : "456", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "460", + "localId" : "457", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "456", + "localId" : "453", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "6", @@ -159657,7 +159611,7 @@ module.exports['Overlaps'] = { }, "high" : { "type" : "Literal", - "localId" : "457", + "localId" : "454", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -159665,170 +159619,67 @@ module.exports['Overlaps'] = { } }, { "type" : "Interval", - "localId" : "467", + "localId" : "464", + "lowClosed" : true, + "highClosed" : true, "annotation" : [ ], - "low" : { - "type" : "As", - "localId" : "469", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "467", "annotation" : [ ], - "signature" : [ ], - "operand" : { - "type" : "Property", + "pointType" : { + "type" : "NamedTypeSpecifier", "localId" : "468", - "path" : "low", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "463", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "464", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "465", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "461", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "462", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } }, - "lowClosedExpression" : { - "type" : "Property", - "localId" : "470", - "path" : "lowClosed", + "low" : { + "type" : "As", + "localId" : "458", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "463", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "464", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "465", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "461", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "462", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "459", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "460", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } }, "high" : { "type" : "As", - "localId" : "472", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "461", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "471", - "path" : "high", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "463", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "464", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "465", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "461", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "462", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "highClosedExpression" : { - "type" : "Property", - "localId" : "473", - "path" : "highClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", + "type" : "Null", + "localId" : "462", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", "localId" : "463", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "464", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "465", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "461", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "462", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } } } ] } }, { - "localId" : "480", + "localId" : "476", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsIsNull", "context" : "Patient", @@ -159837,35 +159688,35 @@ module.exports['Overlaps'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "480", + "r" : "476", "s" : [ { "value" : [ "", "define ", "OverlapsIsNull", ": " ] }, { - "r" : "496", + "r" : "492", "s" : [ { - "r" : "483", + "r" : "479", "s" : [ { - "r" : "481", + "r" : "477", "value" : [ "Interval[", "6", ", ", "10", "]" ] } ] }, { - "r" : "496", + "r" : "492", "value" : [ " ", "overlaps", " " ] }, { - "r" : "486", + "r" : "482", "s" : [ { "value" : [ "(" ] }, { - "r" : "486", + "r" : "482", "s" : [ { - "r" : "487", + "r" : "483", "value" : [ "null", " as " ] }, { - "r" : "488", + "r" : "484", "s" : [ { "value" : [ "Interval<" ] }, { - "r" : "489", + "r" : "485", "s" : [ { "value" : [ "Integer" ] } ] @@ -159882,50 +159733,50 @@ module.exports['Overlaps'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "496", + "localId" : "492", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "497", + "localId" : "493", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "498", + "localId" : "494", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "499", + "localId" : "495", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "500", + "localId" : "496", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "483", + "localId" : "479", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "484", + "localId" : "480", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "485", + "localId" : "481", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "481", + "localId" : "477", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "6", @@ -159933,7 +159784,7 @@ module.exports['Overlaps'] = { }, "high" : { "type" : "Literal", - "localId" : "482", + "localId" : "478", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -159941,16 +159792,16 @@ module.exports['Overlaps'] = { } }, { "type" : "As", - "localId" : "486", + "localId" : "482", "strict" : false, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "494", + "localId" : "490", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "495", + "localId" : "491", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } @@ -159958,28 +159809,28 @@ module.exports['Overlaps'] = { "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "487", + "localId" : "483", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "488", + "localId" : "484", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "490", + "localId" : "486", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "491", + "localId" : "487", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "489", + "localId" : "485", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] @@ -160013,8 +159864,8 @@ define NoOverlap: ivlC overlaps ivlD define NoImpreciseOverlap: ivlE overlaps ivlG define UnknownOverlap: ivlE overlaps ivlH define MatchingPrecisionOverlap: ivlF overlaps ivlG -define OverlapsClosedNullIntervalLHS: Interval[null, null] overlaps ivlA -define OverlapsClosedNullIntervalRHS: ivlA overlaps Interval[null, null] +define OverlapsClosedNullIntervalLHS: Interval[null as DateTime, null as DateTime] overlaps ivlA +define OverlapsClosedNullIntervalRHS: ivlA overlaps Interval[null as DateTime, null as DateTime] define PrecisionDateIvl: Interval[DateTime(2012, 3, 2, 12, 34, 56, 789), DateTime(2012, 9, 2, 1, 23, 45, 678)) // NOTE: There appears to be a bug in cql-to-elm that translates these 'overlaps' to 'OverlapsAfter'! define OverlapsBeforeDayOfIvlEdge: PrecisionDateIvl overlaps day of Interval[DateTime(2012, 9, 2, 23, 59, 59, 999), DateTime(2012, 10, 1, 0, 0, 0, 0)] @@ -160039,7 +159890,7 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "1129", + "r" : "1123", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -162456,18 +162307,43 @@ module.exports['OverlapsDateTime'] = { "s" : [ { "value" : [ "", "define ", "OverlapsClosedNullIntervalLHS", ": " ] }, { - "r" : "662", + "r" : "666", "s" : [ { - "r" : "656", + "r" : "660", "s" : [ { + "value" : [ "Interval[" ] + }, { "r" : "654", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "655", + "value" : [ "null", " as " ] + }, { + "r" : "656", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "657", + "s" : [ { + "r" : "658", + "value" : [ "null", " as " ] + }, { + "r" : "659", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] }, { - "r" : "662", + "r" : "666", "value" : [ " ", "overlaps", " " ] }, { - "r" : "659", + "r" : "663", "s" : [ { "value" : [ "ivlA" ] } ] @@ -162477,204 +162353,101 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "662", + "localId" : "666", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "670", + "localId" : "667", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "671", + "localId" : "668", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "672", + "localId" : "669", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "673", + "localId" : "670", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "663", + "localId" : "660", + "lowClosed" : true, + "highClosed" : true, "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "661", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "662", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] + } + }, "low" : { "type" : "As", - "localId" : "665", - "asType" : "{urn:hl7-org:elm-types:r1}DateTime", + "localId" : "654", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "664", - "path" : "low", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "656", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "657", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "658", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "654", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "655", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "lowClosedExpression" : { - "type" : "Property", - "localId" : "666", - "path" : "lowClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", + "type" : "Null", + "localId" : "655", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", "localId" : "656", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "657", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "658", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "654", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "655", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] } }, "high" : { "type" : "As", - "localId" : "668", - "asType" : "{urn:hl7-org:elm-types:r1}DateTime", + "localId" : "657", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "667", - "path" : "high", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "656", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "657", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "658", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "654", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "655", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "highClosedExpression" : { - "type" : "Property", - "localId" : "669", - "path" : "highClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "656", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "657", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "658", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "654", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "655", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "type" : "Null", + "localId" : "658", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "659", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] } } }, { "type" : "ExpressionRef", - "localId" : "659", + "localId" : "663", "name" : "ivlA", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "660", + "localId" : "664", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "661", + "localId" : "665", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } @@ -162682,7 +162455,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "676", + "localId" : "673", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsClosedNullIntervalRHS", "context" : "Patient", @@ -162691,24 +162464,49 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "676", + "r" : "673", "s" : [ { "value" : [ "", "define ", "OverlapsClosedNullIntervalRHS", ": " ] }, { - "r" : "685", + "r" : "686", "s" : [ { - "r" : "677", + "r" : "674", "s" : [ { "value" : [ "ivlA" ] } ] }, { - "r" : "685", + "r" : "686", "value" : [ " ", "overlaps", " " ] }, { - "r" : "682", + "r" : "683", "s" : [ { + "value" : [ "Interval[" ] + }, { + "r" : "677", + "s" : [ { + "r" : "678", + "value" : [ "null", " as " ] + }, { + "r" : "679", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { "r" : "680", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "681", + "value" : [ "null", " as " ] + }, { + "r" : "682", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] } ] } ] @@ -162716,212 +162514,109 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "685", + "localId" : "686", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "693", + "localId" : "687", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "694", + "localId" : "688", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "695", + "localId" : "689", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "696", + "localId" : "690", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "677", + "localId" : "674", "name" : "ivlA", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "678", + "localId" : "675", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "679", + "localId" : "676", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "686", + "localId" : "683", + "lowClosed" : true, + "highClosed" : true, "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "684", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "685", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] + } + }, "low" : { "type" : "As", - "localId" : "688", - "asType" : "{urn:hl7-org:elm-types:r1}DateTime", + "localId" : "677", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "687", - "path" : "low", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "682", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "683", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "684", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "680", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "681", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "lowClosedExpression" : { - "type" : "Property", - "localId" : "689", - "path" : "lowClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "682", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "683", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "684", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "680", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "681", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "type" : "Null", + "localId" : "678", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "679", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] } }, "high" : { "type" : "As", - "localId" : "691", - "asType" : "{urn:hl7-org:elm-types:r1}DateTime", + "localId" : "680", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "690", - "path" : "high", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "682", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "683", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "684", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "680", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "681", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "highClosedExpression" : { - "type" : "Property", - "localId" : "692", - "path" : "highClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", + "type" : "Null", + "localId" : "681", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", "localId" : "682", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "683", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "684", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "680", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "681", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] } } } ] } }, { - "localId" : "699", + "localId" : "693", "name" : "PrecisionDateIvl", "context" : "Patient", "accessLevel" : "Public", @@ -162929,25 +162624,25 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "699", + "r" : "693", "s" : [ { "value" : [ "", "define ", "PrecisionDateIvl", ": " ] }, { - "r" : "748", + "r" : "742", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "716", + "r" : "710", "s" : [ { - "r" : "700", + "r" : "694", "value" : [ "DateTime", "(", "2012", ", ", "3", ", ", "2", ", ", "12", ", ", "34", ", ", "56", ", ", "789", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "740", + "r" : "734", "s" : [ { - "r" : "724", + "r" : "718", "value" : [ "DateTime", "(", "2012", ", ", "9", ", ", "2", ", ", "1", ", ", "23", ", ", "45", ", ", "678", ")" ] } ] }, { @@ -162958,76 +162653,76 @@ module.exports['OverlapsDateTime'] = { } ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "751", + "localId" : "745", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "752", + "localId" : "746", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "expression" : { "type" : "Interval", - "localId" : "748", + "localId" : "742", "lowClosed" : true, "highClosed" : false, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "749", + "localId" : "743", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "750", + "localId" : "744", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "716", + "localId" : "710", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "717", + "localId" : "711", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "718", + "localId" : "712", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "719", + "localId" : "713", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "720", + "localId" : "714", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "721", + "localId" : "715", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "722", + "localId" : "716", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "723", + "localId" : "717", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "700", + "localId" : "694", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163035,7 +162730,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "701", + "localId" : "695", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "3", @@ -163043,7 +162738,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "702", + "localId" : "696", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -163051,7 +162746,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "703", + "localId" : "697", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "12", @@ -163059,7 +162754,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "704", + "localId" : "698", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "34", @@ -163067,7 +162762,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "705", + "localId" : "699", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "56", @@ -163075,7 +162770,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "706", + "localId" : "700", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "789", @@ -163084,48 +162779,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "740", + "localId" : "734", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "741", + "localId" : "735", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "742", + "localId" : "736", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "743", + "localId" : "737", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "744", + "localId" : "738", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "745", + "localId" : "739", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "746", + "localId" : "740", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "747", + "localId" : "741", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "724", + "localId" : "718", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163133,7 +162828,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "725", + "localId" : "719", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "9", @@ -163141,7 +162836,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "726", + "localId" : "720", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -163149,7 +162844,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "727", + "localId" : "721", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -163157,7 +162852,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "728", + "localId" : "722", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "23", @@ -163165,7 +162860,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "729", + "localId" : "723", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "45", @@ -163173,7 +162868,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "730", + "localId" : "724", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "678", @@ -163182,7 +162877,7 @@ module.exports['OverlapsDateTime'] = { } } }, { - "localId" : "755", + "localId" : "749", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsBeforeDayOfIvlEdge", "context" : "Patient", @@ -163191,35 +162886,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "755", + "r" : "749", "s" : [ { "value" : [ "// NOTE: There appears to be a bug in cql-to-elm that translates these 'overlaps' to 'OverlapsAfter'!\n", "define ", "OverlapsBeforeDayOfIvlEdge", ": " ] }, { - "r" : "810", + "r" : "804", "s" : [ { - "r" : "756", + "r" : "750", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "810", + "r" : "804", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "807", + "r" : "801", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "775", + "r" : "769", "s" : [ { - "r" : "759", + "r" : "753", "value" : [ "DateTime", "(", "2012", ", ", "9", ", ", "2", ", ", "23", ", ", "59", ", ", "59", ", ", "999", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "799", + "r" : "793", "s" : [ { - "r" : "783", + "r" : "777", "value" : [ "DateTime", "(", "2012", ", ", "10", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -163231,108 +162926,108 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "810", + "localId" : "804", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "811", + "localId" : "805", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "812", + "localId" : "806", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "813", + "localId" : "807", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "814", + "localId" : "808", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "756", + "localId" : "750", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "757", + "localId" : "751", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "758", + "localId" : "752", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "807", + "localId" : "801", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "808", + "localId" : "802", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "809", + "localId" : "803", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "775", + "localId" : "769", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "776", + "localId" : "770", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "777", + "localId" : "771", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "778", + "localId" : "772", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "779", + "localId" : "773", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "780", + "localId" : "774", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "781", + "localId" : "775", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "782", + "localId" : "776", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "759", + "localId" : "753", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163340,7 +163035,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "760", + "localId" : "754", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "9", @@ -163348,7 +163043,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "761", + "localId" : "755", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -163356,7 +163051,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "762", + "localId" : "756", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "23", @@ -163364,7 +163059,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "763", + "localId" : "757", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "59", @@ -163372,7 +163067,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "764", + "localId" : "758", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "59", @@ -163380,7 +163075,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "765", + "localId" : "759", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "999", @@ -163389,48 +163084,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "799", + "localId" : "793", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "800", + "localId" : "794", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "801", + "localId" : "795", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "802", + "localId" : "796", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "803", + "localId" : "797", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "804", + "localId" : "798", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "805", + "localId" : "799", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "806", + "localId" : "800", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "783", + "localId" : "777", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163438,7 +163133,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "784", + "localId" : "778", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -163446,7 +163141,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "785", + "localId" : "779", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -163454,7 +163149,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "786", + "localId" : "780", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163462,7 +163157,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "787", + "localId" : "781", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163470,7 +163165,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "788", + "localId" : "782", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163478,7 +163173,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "789", + "localId" : "783", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163488,7 +163183,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "817", + "localId" : "811", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsAfterDayOfIvlEdge", "context" : "Patient", @@ -163497,35 +163192,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "817", + "r" : "811", "s" : [ { "value" : [ "", "define ", "OverlapsAfterDayOfIvlEdge", ": " ] }, { - "r" : "872", + "r" : "866", "s" : [ { - "r" : "818", + "r" : "812", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "872", + "r" : "866", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "869", + "r" : "863", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "837", + "r" : "831", "s" : [ { - "r" : "821", + "r" : "815", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "2", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "861", + "r" : "855", "s" : [ { - "r" : "845", + "r" : "839", "value" : [ "DateTime", "(", "2012", ", ", "3", ", ", "2", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -163537,108 +163232,108 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "872", + "localId" : "866", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "873", + "localId" : "867", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "874", + "localId" : "868", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "875", + "localId" : "869", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "876", + "localId" : "870", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "818", + "localId" : "812", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "819", + "localId" : "813", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "820", + "localId" : "814", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "869", + "localId" : "863", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "870", + "localId" : "864", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "871", + "localId" : "865", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "837", + "localId" : "831", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "838", + "localId" : "832", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "839", + "localId" : "833", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "840", + "localId" : "834", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "841", + "localId" : "835", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "842", + "localId" : "836", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "843", + "localId" : "837", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "844", + "localId" : "838", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "821", + "localId" : "815", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163646,7 +163341,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "822", + "localId" : "816", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -163654,7 +163349,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "823", + "localId" : "817", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -163662,7 +163357,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "824", + "localId" : "818", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163670,7 +163365,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "825", + "localId" : "819", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163678,7 +163373,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "826", + "localId" : "820", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163686,7 +163381,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "827", + "localId" : "821", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163695,48 +163390,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "861", + "localId" : "855", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "862", + "localId" : "856", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "863", + "localId" : "857", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "864", + "localId" : "858", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "865", + "localId" : "859", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "866", + "localId" : "860", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "867", + "localId" : "861", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "868", + "localId" : "862", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "845", + "localId" : "839", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163744,7 +163439,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "846", + "localId" : "840", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "3", @@ -163752,7 +163447,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "847", + "localId" : "841", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -163760,7 +163455,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "848", + "localId" : "842", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163768,7 +163463,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "849", + "localId" : "843", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163776,7 +163471,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "850", + "localId" : "844", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163784,7 +163479,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "851", + "localId" : "845", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163794,7 +163489,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "879", + "localId" : "873", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsContainsDayOfIvl", "context" : "Patient", @@ -163803,35 +163498,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "879", + "r" : "873", "s" : [ { "value" : [ "", "define ", "OverlapsContainsDayOfIvl", ": " ] }, { - "r" : "934", + "r" : "928", "s" : [ { - "r" : "880", + "r" : "874", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "934", + "r" : "928", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "931", + "r" : "925", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "899", + "r" : "893", "s" : [ { - "r" : "883", + "r" : "877", "value" : [ "DateTime", "(", "2012", ", ", "5", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "923", + "r" : "917", "s" : [ { - "r" : "907", + "r" : "901", "value" : [ "DateTime", "(", "2012", ", ", "6", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -163843,108 +163538,108 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "934", + "localId" : "928", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "935", + "localId" : "929", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "936", + "localId" : "930", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "937", + "localId" : "931", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "938", + "localId" : "932", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "880", + "localId" : "874", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "881", + "localId" : "875", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "882", + "localId" : "876", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "931", + "localId" : "925", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "932", + "localId" : "926", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "933", + "localId" : "927", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "899", + "localId" : "893", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "900", + "localId" : "894", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "901", + "localId" : "895", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "902", + "localId" : "896", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "903", + "localId" : "897", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "904", + "localId" : "898", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "905", + "localId" : "899", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "906", + "localId" : "900", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "883", + "localId" : "877", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -163952,7 +163647,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "884", + "localId" : "878", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -163960,7 +163655,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "885", + "localId" : "879", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -163968,7 +163663,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "886", + "localId" : "880", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163976,7 +163671,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "887", + "localId" : "881", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163984,7 +163679,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "888", + "localId" : "882", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -163992,7 +163687,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "889", + "localId" : "883", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164001,48 +163696,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "923", + "localId" : "917", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "924", + "localId" : "918", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "925", + "localId" : "919", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "926", + "localId" : "920", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "927", + "localId" : "921", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "928", + "localId" : "922", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "929", + "localId" : "923", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "930", + "localId" : "924", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "907", + "localId" : "901", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164050,7 +163745,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "908", + "localId" : "902", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "6", @@ -164058,7 +163753,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "909", + "localId" : "903", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164066,7 +163761,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "910", + "localId" : "904", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164074,7 +163769,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "911", + "localId" : "905", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164082,7 +163777,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "912", + "localId" : "906", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164090,7 +163785,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "913", + "localId" : "907", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164100,7 +163795,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "941", + "localId" : "935", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsContainedByDayOfIvl", "context" : "Patient", @@ -164109,35 +163804,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "941", + "r" : "935", "s" : [ { "value" : [ "", "define ", "OverlapsContainedByDayOfIvl", ": " ] }, { - "r" : "996", + "r" : "990", "s" : [ { - "r" : "942", + "r" : "936", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "996", + "r" : "990", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "993", + "r" : "987", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "961", + "r" : "955", "s" : [ { - "r" : "945", + "r" : "939", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "985", + "r" : "979", "s" : [ { - "r" : "969", + "r" : "963", "value" : [ "DateTime", "(", "2012", ", ", "12", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -164149,108 +163844,108 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "996", + "localId" : "990", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "997", + "localId" : "991", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "998", + "localId" : "992", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "999", + "localId" : "993", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1000", + "localId" : "994", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "942", + "localId" : "936", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "943", + "localId" : "937", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "944", + "localId" : "938", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "993", + "localId" : "987", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "994", + "localId" : "988", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "995", + "localId" : "989", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "961", + "localId" : "955", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "962", + "localId" : "956", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "963", + "localId" : "957", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "964", + "localId" : "958", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "965", + "localId" : "959", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "966", + "localId" : "960", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "967", + "localId" : "961", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "968", + "localId" : "962", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "945", + "localId" : "939", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164258,7 +163953,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "946", + "localId" : "940", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164266,7 +163961,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "947", + "localId" : "941", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164274,7 +163969,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "948", + "localId" : "942", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164282,7 +163977,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "949", + "localId" : "943", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164290,7 +163985,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "950", + "localId" : "944", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164298,7 +163993,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "951", + "localId" : "945", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164307,48 +164002,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "985", + "localId" : "979", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "986", + "localId" : "980", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "987", + "localId" : "981", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "988", + "localId" : "982", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "989", + "localId" : "983", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "990", + "localId" : "984", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "991", + "localId" : "985", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "992", + "localId" : "986", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "969", + "localId" : "963", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164356,7 +164051,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "970", + "localId" : "964", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "12", @@ -164364,7 +164059,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "971", + "localId" : "965", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164372,7 +164067,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "972", + "localId" : "966", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164380,7 +164075,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "973", + "localId" : "967", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164388,7 +164083,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "974", + "localId" : "968", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164396,7 +164091,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "975", + "localId" : "969", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164406,7 +164101,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "1003", + "localId" : "997", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "NotOverlapsDayOfIvl", "context" : "Patient", @@ -164415,35 +164110,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "1003", + "r" : "997", "s" : [ { "value" : [ "", "define ", "NotOverlapsDayOfIvl", ": " ] }, { - "r" : "1058", + "r" : "1052", "s" : [ { - "r" : "1004", + "r" : "998", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "1058", + "r" : "1052", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "1055", + "r" : "1049", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "1023", + "r" : "1017", "s" : [ { - "r" : "1007", + "r" : "1001", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "2", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "1047", + "r" : "1041", "s" : [ { - "r" : "1031", + "r" : "1025", "value" : [ "DateTime", "(", "2012", ", ", "3", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -164455,108 +164150,108 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "1058", + "localId" : "1052", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "1059", + "localId" : "1053", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1060", + "localId" : "1054", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "1061", + "localId" : "1055", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1062", + "localId" : "1056", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "1004", + "localId" : "998", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1005", + "localId" : "999", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1006", + "localId" : "1000", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "1055", + "localId" : "1049", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1056", + "localId" : "1050", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1057", + "localId" : "1051", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "1023", + "localId" : "1017", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1024", + "localId" : "1018", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1025", + "localId" : "1019", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1026", + "localId" : "1020", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1027", + "localId" : "1021", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1028", + "localId" : "1022", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1029", + "localId" : "1023", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1030", + "localId" : "1024", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1007", + "localId" : "1001", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164564,7 +164259,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1008", + "localId" : "1002", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164572,7 +164267,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "1009", + "localId" : "1003", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -164580,7 +164275,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "1010", + "localId" : "1004", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164588,7 +164283,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "1011", + "localId" : "1005", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164596,7 +164291,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "1012", + "localId" : "1006", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164604,7 +164299,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "1013", + "localId" : "1007", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164613,48 +164308,48 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "1047", + "localId" : "1041", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1048", + "localId" : "1042", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1049", + "localId" : "1043", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1050", + "localId" : "1044", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1051", + "localId" : "1045", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1052", + "localId" : "1046", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1053", + "localId" : "1047", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1054", + "localId" : "1048", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1031", + "localId" : "1025", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164662,7 +164357,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1032", + "localId" : "1026", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "3", @@ -164670,7 +164365,7 @@ module.exports['OverlapsDateTime'] = { }, "day" : { "type" : "Literal", - "localId" : "1033", + "localId" : "1027", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164678,7 +164373,7 @@ module.exports['OverlapsDateTime'] = { }, "hour" : { "type" : "Literal", - "localId" : "1034", + "localId" : "1028", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164686,7 +164381,7 @@ module.exports['OverlapsDateTime'] = { }, "minute" : { "type" : "Literal", - "localId" : "1035", + "localId" : "1029", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164694,7 +164389,7 @@ module.exports['OverlapsDateTime'] = { }, "second" : { "type" : "Literal", - "localId" : "1036", + "localId" : "1030", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164702,7 +164397,7 @@ module.exports['OverlapsDateTime'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "1037", + "localId" : "1031", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -164712,7 +164407,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "1065", + "localId" : "1059", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "OverlapsAfterDayOfImpreciseInterval", "context" : "Patient", @@ -164721,35 +164416,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "1065", + "r" : "1059", "s" : [ { "value" : [ "", "define ", "OverlapsAfterDayOfImpreciseInterval", ": " ] }, { - "r" : "1090", + "r" : "1084", "s" : [ { - "r" : "1066", + "r" : "1060", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "1090", + "r" : "1084", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "1087", + "r" : "1081", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "1075", + "r" : "1069", "s" : [ { - "r" : "1069", + "r" : "1063", "value" : [ "DateTime", "(", "2012", ", ", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "1084", + "r" : "1078", "s" : [ { - "r" : "1078", + "r" : "1072", "value" : [ "DateTime", "(", "2012", ", ", "4", ")" ] } ] }, { @@ -164761,83 +164456,83 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "1090", + "localId" : "1084", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "1091", + "localId" : "1085", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1092", + "localId" : "1086", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "1093", + "localId" : "1087", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1094", + "localId" : "1088", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "1066", + "localId" : "1060", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1067", + "localId" : "1061", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1068", + "localId" : "1062", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "1087", + "localId" : "1081", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1088", + "localId" : "1082", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1089", + "localId" : "1083", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "1075", + "localId" : "1069", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1076", + "localId" : "1070", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1077", + "localId" : "1071", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1069", + "localId" : "1063", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164845,7 +164540,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1070", + "localId" : "1064", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -164854,23 +164549,23 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "1084", + "localId" : "1078", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1085", + "localId" : "1079", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1086", + "localId" : "1080", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1078", + "localId" : "1072", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -164878,7 +164573,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1079", + "localId" : "1073", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -164888,7 +164583,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "1097", + "localId" : "1091", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "MayOverlapBeforeDayOfImpreciseIvl", "context" : "Patient", @@ -164897,35 +164592,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "1097", + "r" : "1091", "s" : [ { "value" : [ "", "define ", "MayOverlapBeforeDayOfImpreciseIvl", ": " ] }, { - "r" : "1122", + "r" : "1116", "s" : [ { - "r" : "1098", + "r" : "1092", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "1122", + "r" : "1116", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "1119", + "r" : "1113", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "1107", + "r" : "1101", "s" : [ { - "r" : "1101", + "r" : "1095", "value" : [ "DateTime", "(", "2012", ", ", "9", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "1116", + "r" : "1110", "s" : [ { - "r" : "1110", + "r" : "1104", "value" : [ "DateTime", "(", "2012", ", ", "10", ")" ] } ] }, { @@ -164937,83 +164632,83 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "1122", + "localId" : "1116", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "1123", + "localId" : "1117", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1124", + "localId" : "1118", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "1125", + "localId" : "1119", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1126", + "localId" : "1120", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "1098", + "localId" : "1092", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1099", + "localId" : "1093", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1100", + "localId" : "1094", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "1119", + "localId" : "1113", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1120", + "localId" : "1114", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1121", + "localId" : "1115", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "1107", + "localId" : "1101", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1108", + "localId" : "1102", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1109", + "localId" : "1103", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1101", + "localId" : "1095", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -165021,7 +164716,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1102", + "localId" : "1096", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "9", @@ -165030,23 +164725,23 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "1116", + "localId" : "1110", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1117", + "localId" : "1111", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1118", + "localId" : "1112", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1110", + "localId" : "1104", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -165054,7 +164749,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1111", + "localId" : "1105", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -165064,7 +164759,7 @@ module.exports['OverlapsDateTime'] = { } ] } }, { - "localId" : "1129", + "localId" : "1123", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "MayOverlapAfterDayOfImpreciseIvl", "context" : "Patient", @@ -165073,35 +164768,35 @@ module.exports['OverlapsDateTime'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "1129", + "r" : "1123", "s" : [ { "value" : [ "", "define ", "MayOverlapAfterDayOfImpreciseIvl", ": " ] }, { - "r" : "1154", + "r" : "1148", "s" : [ { - "r" : "1130", + "r" : "1124", "s" : [ { "value" : [ "PrecisionDateIvl" ] } ] }, { - "r" : "1154", + "r" : "1148", "value" : [ " ", "overlaps day of", " " ] }, { - "r" : "1151", + "r" : "1145", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "1139", + "r" : "1133", "s" : [ { - "r" : "1133", + "r" : "1127", "value" : [ "DateTime", "(", "2012", ", ", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "1148", + "r" : "1142", "s" : [ { - "r" : "1142", + "r" : "1136", "value" : [ "DateTime", "(", "2012", ", ", "3", ")" ] } ] }, { @@ -165113,83 +164808,83 @@ module.exports['OverlapsDateTime'] = { } ], "expression" : { "type" : "Overlaps", - "localId" : "1154", + "localId" : "1148", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "1155", + "localId" : "1149", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1156", + "localId" : "1150", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "1157", + "localId" : "1151", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1158", + "localId" : "1152", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "1130", + "localId" : "1124", "name" : "PrecisionDateIvl", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1131", + "localId" : "1125", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1132", + "localId" : "1126", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "1151", + "localId" : "1145", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "1152", + "localId" : "1146", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "1153", + "localId" : "1147", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "1139", + "localId" : "1133", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1140", + "localId" : "1134", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1141", + "localId" : "1135", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1133", + "localId" : "1127", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -165197,7 +164892,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1134", + "localId" : "1128", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -165206,23 +164901,23 @@ module.exports['OverlapsDateTime'] = { }, "high" : { "type" : "DateTime", - "localId" : "1148", + "localId" : "1142", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "1149", + "localId" : "1143", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "1150", + "localId" : "1144", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "1142", + "localId" : "1136", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -165230,7 +164925,7 @@ module.exports['OverlapsDateTime'] = { }, "month" : { "type" : "Literal", - "localId" : "1143", + "localId" : "1137", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "3", @@ -184014,7 +183709,7 @@ module.exports['End'] = { library TestSnippet version '1' using Simple version '1.0.0' context Patient -define TestStartsNull: Interval[null, null] starts Interval[1, 10] +define TestStartsNull: Interval[null as Integer, null as Integer] starts Interval[1, 10] define IntegerIntervalStartsTrue: Interval[4,10] starts Interval[4, 15] define IntegerIntervalStartsFalse: Interval[1, 10] starts Interval[4, 10] define IntegerIntervalStartEndsFalse: Interval[4, 10] starts Interval[4, 9] @@ -184045,7 +183740,7 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "682", + "r" : "686", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -184131,20 +183826,45 @@ module.exports['Starts'] = { "s" : [ { "value" : [ "", "define ", "TestStartsNull", ": " ] }, { - "r" : "225", + "r" : "229", "s" : [ { - "r" : "217", + "r" : "221", "s" : [ { + "value" : [ "Interval[" ] + }, { "r" : "215", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "216", + "value" : [ "null", " as " ] + }, { + "r" : "217", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "218", + "s" : [ { + "r" : "219", + "value" : [ "null", " as " ] + }, { + "r" : "220", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] }, { - "r" : "225", + "r" : "229", "value" : [ " ", "starts", " " ] }, { - "r" : "222", + "r" : "226", "s" : [ { - "r" : "220", + "r" : "224", "value" : [ "Interval[", "1", ", ", "10", "]" ] } ] } ] @@ -184153,79 +183873,109 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "225", + "localId" : "229", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "226", + "localId" : "230", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "227", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "231", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "228", + "localId" : "232", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "229", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "233", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "217", + "localId" : "221", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "218", + "localId" : "222", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "219", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "223", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { - "type" : "Null", + "type" : "As", "localId" : "215", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "216", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "217", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } }, "high" : { - "type" : "Null", - "localId" : "216", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "type" : "As", + "localId" : "218", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "219", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "220", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } } }, { "type" : "Interval", - "localId" : "222", + "localId" : "226", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "223", + "localId" : "227", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "224", + "localId" : "228", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "220", + "localId" : "224", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -184233,7 +183983,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "221", + "localId" : "225", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -184242,7 +183992,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "232", + "localId" : "236", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalStartsTrue", "context" : "Patient", @@ -184251,24 +184001,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "232", + "r" : "236", "s" : [ { "value" : [ "", "define ", "IntegerIntervalStartsTrue", ": " ] }, { - "r" : "243", + "r" : "247", "s" : [ { - "r" : "235", + "r" : "239", "s" : [ { - "r" : "233", + "r" : "237", "value" : [ "Interval[", "4", ",", "10", "]" ] } ] }, { - "r" : "243", + "r" : "247", "value" : [ " ", "starts", " " ] }, { - "r" : "240", + "r" : "244", "s" : [ { - "r" : "238", + "r" : "242", "value" : [ "Interval[", "4", ", ", "15", "]" ] } ] } ] @@ -184277,50 +184027,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "243", + "localId" : "247", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "244", + "localId" : "248", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "245", + "localId" : "249", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "246", + "localId" : "250", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "247", + "localId" : "251", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "235", + "localId" : "239", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "236", + "localId" : "240", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "237", + "localId" : "241", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "233", + "localId" : "237", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -184328,7 +184078,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "234", + "localId" : "238", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -184336,24 +184086,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "240", + "localId" : "244", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "241", + "localId" : "245", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "242", + "localId" : "246", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "238", + "localId" : "242", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -184361,7 +184111,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "239", + "localId" : "243", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -184370,7 +184120,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "250", + "localId" : "254", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalStartsFalse", "context" : "Patient", @@ -184379,24 +184129,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "250", + "r" : "254", "s" : [ { "value" : [ "", "define ", "IntegerIntervalStartsFalse", ": " ] }, { - "r" : "261", + "r" : "265", "s" : [ { - "r" : "253", + "r" : "257", "s" : [ { - "r" : "251", + "r" : "255", "value" : [ "Interval[", "1", ", ", "10", "]" ] } ] }, { - "r" : "261", + "r" : "265", "value" : [ " ", "starts", " " ] }, { - "r" : "258", + "r" : "262", "s" : [ { - "r" : "256", + "r" : "260", "value" : [ "Interval[", "4", ", ", "10", "]" ] } ] } ] @@ -184405,50 +184155,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "261", + "localId" : "265", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "262", + "localId" : "266", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "263", + "localId" : "267", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "264", + "localId" : "268", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "265", + "localId" : "269", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "253", + "localId" : "257", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "254", + "localId" : "258", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "255", + "localId" : "259", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "251", + "localId" : "255", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -184456,7 +184206,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "252", + "localId" : "256", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -184464,24 +184214,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "258", + "localId" : "262", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "259", + "localId" : "263", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "260", + "localId" : "264", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "256", + "localId" : "260", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -184489,7 +184239,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "257", + "localId" : "261", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -184498,7 +184248,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "268", + "localId" : "272", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalStartEndsFalse", "context" : "Patient", @@ -184507,24 +184257,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "268", + "r" : "272", "s" : [ { "value" : [ "", "define ", "IntegerIntervalStartEndsFalse", ": " ] }, { - "r" : "279", + "r" : "283", "s" : [ { - "r" : "271", + "r" : "275", "s" : [ { - "r" : "269", + "r" : "273", "value" : [ "Interval[", "4", ", ", "10", "]" ] } ] }, { - "r" : "279", + "r" : "283", "value" : [ " ", "starts", " " ] }, { - "r" : "276", + "r" : "280", "s" : [ { - "r" : "274", + "r" : "278", "value" : [ "Interval[", "4", ", ", "9", "]" ] } ] } ] @@ -184533,50 +184283,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "279", + "localId" : "283", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "280", + "localId" : "284", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "281", + "localId" : "285", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "282", + "localId" : "286", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "283", + "localId" : "287", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "271", + "localId" : "275", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "272", + "localId" : "276", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "273", + "localId" : "277", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "269", + "localId" : "273", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -184584,7 +184334,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "270", + "localId" : "274", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -184592,24 +184342,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "276", + "localId" : "280", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "277", + "localId" : "281", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "278", + "localId" : "282", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "274", + "localId" : "278", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -184617,7 +184367,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "275", + "localId" : "279", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "9", @@ -184626,7 +184376,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "286", + "localId" : "290", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalStartsTrue", "context" : "Patient", @@ -184635,24 +184385,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "286", + "r" : "290", "s" : [ { "value" : [ "", "define ", "LongIntervalStartsTrue", ": " ] }, { - "r" : "297", + "r" : "301", "s" : [ { - "r" : "289", + "r" : "293", "s" : [ { - "r" : "287", + "r" : "291", "value" : [ "Interval[", "4L", ",", "10L", "]" ] } ] }, { - "r" : "297", + "r" : "301", "value" : [ " ", "starts", " " ] }, { - "r" : "294", + "r" : "298", "s" : [ { - "r" : "292", + "r" : "296", "value" : [ "Interval[", "4L", ", ", "15L", "]" ] } ] } ] @@ -184661,50 +184411,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "297", + "localId" : "301", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "298", + "localId" : "302", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "299", + "localId" : "303", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "300", + "localId" : "304", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "301", + "localId" : "305", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "289", + "localId" : "293", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "290", + "localId" : "294", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "291", + "localId" : "295", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "287", + "localId" : "291", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -184712,7 +184462,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "288", + "localId" : "292", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -184720,24 +184470,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "294", + "localId" : "298", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "295", + "localId" : "299", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "296", + "localId" : "300", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "292", + "localId" : "296", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -184745,7 +184495,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "293", + "localId" : "297", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "15", @@ -184754,7 +184504,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "304", + "localId" : "308", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalStartsFalse", "context" : "Patient", @@ -184763,24 +184513,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "304", + "r" : "308", "s" : [ { "value" : [ "", "define ", "LongIntervalStartsFalse", ": " ] }, { - "r" : "315", + "r" : "319", "s" : [ { - "r" : "307", + "r" : "311", "s" : [ { - "r" : "305", + "r" : "309", "value" : [ "Interval[", "1L", ", ", "10L", "]" ] } ] }, { - "r" : "315", + "r" : "319", "value" : [ " ", "starts", " " ] }, { - "r" : "312", + "r" : "316", "s" : [ { - "r" : "310", + "r" : "314", "value" : [ "Interval[", "4L", ", ", "10L", "]" ] } ] } ] @@ -184789,50 +184539,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "315", + "localId" : "319", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "316", + "localId" : "320", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "317", + "localId" : "321", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "318", + "localId" : "322", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "319", + "localId" : "323", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "307", + "localId" : "311", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "308", + "localId" : "312", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "309", + "localId" : "313", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "305", + "localId" : "309", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "1", @@ -184840,7 +184590,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "306", + "localId" : "310", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -184848,24 +184598,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "312", + "localId" : "316", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "313", + "localId" : "317", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "314", + "localId" : "318", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "310", + "localId" : "314", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -184873,7 +184623,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "311", + "localId" : "315", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -184882,7 +184632,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "322", + "localId" : "326", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalStartEndsFalse", "context" : "Patient", @@ -184891,24 +184641,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "322", + "r" : "326", "s" : [ { "value" : [ "", "define ", "LongIntervalStartEndsFalse", ": " ] }, { - "r" : "333", + "r" : "337", "s" : [ { - "r" : "325", + "r" : "329", "s" : [ { - "r" : "323", + "r" : "327", "value" : [ "Interval[", "4L", ", ", "10L", "]" ] } ] }, { - "r" : "333", + "r" : "337", "value" : [ " ", "starts", " " ] }, { - "r" : "330", + "r" : "334", "s" : [ { - "r" : "328", + "r" : "332", "value" : [ "Interval[", "4L", ", ", "9L", "]" ] } ] } ] @@ -184917,50 +184667,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "333", + "localId" : "337", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "334", + "localId" : "338", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "335", + "localId" : "339", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "336", + "localId" : "340", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "337", + "localId" : "341", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "325", + "localId" : "329", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "326", + "localId" : "330", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "327", + "localId" : "331", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "323", + "localId" : "327", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -184968,7 +184718,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "324", + "localId" : "328", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -184976,24 +184726,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "330", + "localId" : "334", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "331", + "localId" : "335", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "332", + "localId" : "336", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "328", + "localId" : "332", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -185001,7 +184751,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "329", + "localId" : "333", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "9", @@ -185010,7 +184760,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "340", + "localId" : "344", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalStartsTrue", "context" : "Patient", @@ -185019,24 +184769,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "340", + "r" : "344", "s" : [ { "value" : [ "", "define ", "DecimalIntervalStartsTrue", ": " ] }, { - "r" : "351", + "r" : "355", "s" : [ { - "r" : "343", + "r" : "347", "s" : [ { - "r" : "341", + "r" : "345", "value" : [ "Interval[", "4.0", ", ", "10.0", "]" ] } ] }, { - "r" : "351", + "r" : "355", "value" : [ " ", "starts", " " ] }, { - "r" : "348", + "r" : "352", "s" : [ { - "r" : "346", + "r" : "350", "value" : [ "Interval[", "4.0", ", ", "15.0", "]" ] } ] } ] @@ -185045,50 +184795,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "351", + "localId" : "355", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "352", + "localId" : "356", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "353", + "localId" : "357", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "354", + "localId" : "358", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "355", + "localId" : "359", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "343", + "localId" : "347", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "344", + "localId" : "348", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "345", + "localId" : "349", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "341", + "localId" : "345", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -185096,7 +184846,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "342", + "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -185104,24 +184854,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "348", + "localId" : "352", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "349", + "localId" : "353", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "350", + "localId" : "354", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "346", + "localId" : "350", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -185129,7 +184879,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "347", + "localId" : "351", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "15.0", @@ -185138,7 +184888,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "358", + "localId" : "362", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalStartsFalse", "context" : "Patient", @@ -185147,24 +184897,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "358", + "r" : "362", "s" : [ { "value" : [ "", "define ", "DecimalIntervalStartsFalse", ": " ] }, { - "r" : "369", + "r" : "373", "s" : [ { - "r" : "361", + "r" : "365", "s" : [ { - "r" : "359", + "r" : "363", "value" : [ "Interval[", "1.0", ", ", "10.0", "]" ] } ] }, { - "r" : "369", + "r" : "373", "value" : [ " ", "starts", " " ] }, { - "r" : "366", + "r" : "370", "s" : [ { - "r" : "364", + "r" : "368", "value" : [ "Interval[", "4.0", ", ", "10.0", "]" ] } ] } ] @@ -185173,50 +184923,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "369", + "localId" : "373", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "370", + "localId" : "374", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "371", + "localId" : "375", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "372", + "localId" : "376", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "373", + "localId" : "377", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "361", + "localId" : "365", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "362", + "localId" : "366", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "363", + "localId" : "367", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "359", + "localId" : "363", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "1.0", @@ -185224,7 +184974,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "360", + "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -185232,24 +184982,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "366", + "localId" : "370", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "367", + "localId" : "371", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "368", + "localId" : "372", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "364", + "localId" : "368", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -185257,7 +185007,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "365", + "localId" : "369", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -185266,7 +185016,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "376", + "localId" : "380", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalStartsEndsFalse", "context" : "Patient", @@ -185275,24 +185025,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "376", + "r" : "380", "s" : [ { "value" : [ "", "define ", "DecimalIntervalStartsEndsFalse", ": " ] }, { - "r" : "387", + "r" : "391", "s" : [ { - "r" : "379", + "r" : "383", "s" : [ { - "r" : "377", + "r" : "381", "value" : [ "Interval[", "4.0", ", ", "10.0", "]" ] } ] }, { - "r" : "387", + "r" : "391", "value" : [ " ", "starts", " " ] }, { - "r" : "384", + "r" : "388", "s" : [ { - "r" : "382", + "r" : "386", "value" : [ "Interval[", "4.0", ", ", "9.0", "]" ] } ] } ] @@ -185301,50 +185051,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "387", + "localId" : "391", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "388", + "localId" : "392", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "389", + "localId" : "393", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "390", + "localId" : "394", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "391", + "localId" : "395", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "379", + "localId" : "383", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "380", + "localId" : "384", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "381", + "localId" : "385", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "377", + "localId" : "381", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -185352,7 +185102,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "378", + "localId" : "382", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -185360,24 +185110,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "384", + "localId" : "388", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "385", + "localId" : "389", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "386", + "localId" : "390", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "382", + "localId" : "386", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -185385,7 +185135,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Literal", - "localId" : "383", + "localId" : "387", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "9.0", @@ -185394,7 +185144,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "394", + "localId" : "398", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalStartsTrue", "context" : "Patient", @@ -185403,24 +185153,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "394", + "r" : "398", "s" : [ { "value" : [ "", "define ", "QuantityIntervalStartsTrue", ": " ] }, { - "r" : "405", + "r" : "409", "s" : [ { - "r" : "397", + "r" : "401", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "395", + "r" : "399", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "396", + "r" : "400", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -185428,21 +185178,21 @@ module.exports['Starts'] = { "value" : [ "]" ] } ] }, { - "r" : "405", + "r" : "409", "value" : [ " ", "starts", " " ] }, { - "r" : "402", + "r" : "406", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "400", + "r" : "404", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "401", + "r" : "405", "s" : [ { "value" : [ "15.0 ", "'g'" ] } ] @@ -185455,50 +185205,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "405", + "localId" : "409", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "406", + "localId" : "410", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "407", + "localId" : "411", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "408", + "localId" : "412", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "409", + "localId" : "413", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "397", + "localId" : "401", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "398", + "localId" : "402", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "399", + "localId" : "403", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "395", + "localId" : "399", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -185506,7 +185256,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "396", + "localId" : "400", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -185514,24 +185264,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "402", + "localId" : "406", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "403", + "localId" : "407", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "404", + "localId" : "408", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "400", + "localId" : "404", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -185539,7 +185289,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "401", + "localId" : "405", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 15.0, "unit" : "g", @@ -185548,7 +185298,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "412", + "localId" : "416", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalStartsFalse", "context" : "Patient", @@ -185557,24 +185307,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "412", + "r" : "416", "s" : [ { "value" : [ "", "define ", "QuantityIntervalStartsFalse", ": " ] }, { - "r" : "423", + "r" : "427", "s" : [ { - "r" : "415", + "r" : "419", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "413", + "r" : "417", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "414", + "r" : "418", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -185582,21 +185332,21 @@ module.exports['Starts'] = { "value" : [ "]" ] } ] }, { - "r" : "423", + "r" : "427", "value" : [ " ", "starts", " " ] }, { - "r" : "420", + "r" : "424", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "418", + "r" : "422", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "419", + "r" : "423", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -185609,50 +185359,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "423", + "localId" : "427", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "424", + "localId" : "428", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "425", + "localId" : "429", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "426", + "localId" : "430", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "427", + "localId" : "431", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "415", + "localId" : "419", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "416", + "localId" : "420", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "417", + "localId" : "421", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "413", + "localId" : "417", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", @@ -185660,7 +185410,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "414", + "localId" : "418", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -185668,24 +185418,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "420", + "localId" : "424", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "421", + "localId" : "425", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "422", + "localId" : "426", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "418", + "localId" : "422", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -185693,7 +185443,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "419", + "localId" : "423", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -185702,7 +185452,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "430", + "localId" : "434", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalStartsEndsFalse", "context" : "Patient", @@ -185711,24 +185461,24 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "430", + "r" : "434", "s" : [ { "value" : [ "", "define ", "QuantityIntervalStartsEndsFalse", ": " ] }, { - "r" : "441", + "r" : "445", "s" : [ { - "r" : "433", + "r" : "437", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "431", + "r" : "435", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "432", + "r" : "436", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -185736,21 +185486,21 @@ module.exports['Starts'] = { "value" : [ "]" ] } ] }, { - "r" : "441", + "r" : "445", "value" : [ " ", "starts", " " ] }, { - "r" : "438", + "r" : "442", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "436", + "r" : "440", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "437", + "r" : "441", "s" : [ { "value" : [ "9.9 ", "'g'" ] } ] @@ -185763,50 +185513,50 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "441", + "localId" : "445", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "442", + "localId" : "446", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "443", + "localId" : "447", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "444", + "localId" : "448", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "445", + "localId" : "449", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "433", + "localId" : "437", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "434", + "localId" : "438", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "435", + "localId" : "439", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "431", + "localId" : "435", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -185814,7 +185564,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "432", + "localId" : "436", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -185822,24 +185572,24 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "438", + "localId" : "442", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "439", + "localId" : "443", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "440", + "localId" : "444", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "436", + "localId" : "440", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -185847,7 +185597,7 @@ module.exports['Starts'] = { }, "high" : { "type" : "Quantity", - "localId" : "437", + "localId" : "441", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 9.9, "unit" : "g", @@ -185856,7 +185606,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "448", + "localId" : "452", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalStartsTrue", "context" : "Patient", @@ -185865,51 +185615,51 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "448", + "r" : "452", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalStartsTrue", ": " ] }, { - "r" : "551", + "r" : "555", "s" : [ { - "r" : "497", + "r" : "501", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "465", + "r" : "469", "s" : [ { - "r" : "449", + "r" : "453", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "489", + "r" : "493", "s" : [ { - "r" : "473", + "r" : "477", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "25", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "551", + "r" : "555", "value" : [ " ", "starts", " " ] }, { - "r" : "548", + "r" : "552", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "516", + "r" : "520", "s" : [ { - "r" : "500", + "r" : "504", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "540", + "r" : "544", "s" : [ { - "r" : "524", + "r" : "528", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "27", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -185921,91 +185671,91 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "551", + "localId" : "555", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "552", + "localId" : "556", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "553", + "localId" : "557", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "554", + "localId" : "558", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "555", + "localId" : "559", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "497", + "localId" : "501", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "498", + "localId" : "502", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "499", + "localId" : "503", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "465", + "localId" : "469", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "466", + "localId" : "470", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "467", + "localId" : "471", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "468", + "localId" : "472", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "469", + "localId" : "473", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "470", + "localId" : "474", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "471", + "localId" : "475", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "472", + "localId" : "476", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "449", + "localId" : "453", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186013,7 +185763,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "450", + "localId" : "454", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186021,7 +185771,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "451", + "localId" : "455", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -186029,7 +185779,7 @@ module.exports['Starts'] = { }, "hour" : { "type" : "Literal", - "localId" : "452", + "localId" : "456", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186037,7 +185787,7 @@ module.exports['Starts'] = { }, "minute" : { "type" : "Literal", - "localId" : "453", + "localId" : "457", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186045,7 +185795,7 @@ module.exports['Starts'] = { }, "second" : { "type" : "Literal", - "localId" : "454", + "localId" : "458", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186053,7 +185803,7 @@ module.exports['Starts'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "455", + "localId" : "459", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186062,48 +185812,48 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "489", + "localId" : "493", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "490", + "localId" : "494", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "491", + "localId" : "495", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "492", + "localId" : "496", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "493", + "localId" : "497", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "494", + "localId" : "498", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "495", + "localId" : "499", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "496", + "localId" : "500", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "473", + "localId" : "477", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186111,7 +185861,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "474", + "localId" : "478", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186119,7 +185869,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "475", + "localId" : "479", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "25", @@ -186127,7 +185877,7 @@ module.exports['Starts'] = { }, "hour" : { "type" : "Literal", - "localId" : "476", + "localId" : "480", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186135,7 +185885,7 @@ module.exports['Starts'] = { }, "minute" : { "type" : "Literal", - "localId" : "477", + "localId" : "481", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186143,7 +185893,7 @@ module.exports['Starts'] = { }, "second" : { "type" : "Literal", - "localId" : "478", + "localId" : "482", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186151,7 +185901,7 @@ module.exports['Starts'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "479", + "localId" : "483", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186160,65 +185910,65 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "548", + "localId" : "552", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "549", + "localId" : "553", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "550", + "localId" : "554", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "516", + "localId" : "520", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "517", + "localId" : "521", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "518", + "localId" : "522", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "519", + "localId" : "523", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "520", + "localId" : "524", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "521", + "localId" : "525", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "522", + "localId" : "526", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "523", + "localId" : "527", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "500", + "localId" : "504", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186226,7 +185976,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "501", + "localId" : "505", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186234,7 +185984,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "502", + "localId" : "506", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -186242,7 +185992,7 @@ module.exports['Starts'] = { }, "hour" : { "type" : "Literal", - "localId" : "503", + "localId" : "507", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186250,7 +186000,7 @@ module.exports['Starts'] = { }, "minute" : { "type" : "Literal", - "localId" : "504", + "localId" : "508", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186258,7 +186008,7 @@ module.exports['Starts'] = { }, "second" : { "type" : "Literal", - "localId" : "505", + "localId" : "509", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186266,7 +186016,7 @@ module.exports['Starts'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "506", + "localId" : "510", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186275,48 +186025,48 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "540", + "localId" : "544", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "541", + "localId" : "545", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "542", + "localId" : "546", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "543", + "localId" : "547", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "544", + "localId" : "548", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "545", + "localId" : "549", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "546", + "localId" : "550", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "547", + "localId" : "551", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "524", + "localId" : "528", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186324,7 +186074,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "525", + "localId" : "529", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186332,7 +186082,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "526", + "localId" : "530", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "27", @@ -186340,7 +186090,7 @@ module.exports['Starts'] = { }, "hour" : { "type" : "Literal", - "localId" : "527", + "localId" : "531", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186348,7 +186098,7 @@ module.exports['Starts'] = { }, "minute" : { "type" : "Literal", - "localId" : "528", + "localId" : "532", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186356,7 +186106,7 @@ module.exports['Starts'] = { }, "second" : { "type" : "Literal", - "localId" : "529", + "localId" : "533", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186364,7 +186114,7 @@ module.exports['Starts'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "530", + "localId" : "534", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -186374,7 +186124,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "558", + "localId" : "562", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalStartsFalse", "context" : "Patient", @@ -186383,51 +186133,51 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "558", + "r" : "562", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalStartsFalse", ": " ] }, { - "r" : "613", + "r" : "617", "s" : [ { - "r" : "583", + "r" : "587", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "567", + "r" : "571", "s" : [ { - "r" : "559", + "r" : "563", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "579", + "r" : "583", "s" : [ { - "r" : "571", + "r" : "575", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "25", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "613", + "r" : "617", "value" : [ " ", "starts day of", " " ] }, { - "r" : "610", + "r" : "614", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "594", + "r" : "598", "s" : [ { - "r" : "586", + "r" : "590", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "6", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "606", + "r" : "610", "s" : [ { - "r" : "598", + "r" : "602", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "27", ")" ] } ] }, { @@ -186439,72 +186189,72 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "613", + "localId" : "617", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "614", + "localId" : "618", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "615", + "localId" : "619", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "616", + "localId" : "620", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "617", + "localId" : "621", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "583", + "localId" : "587", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "584", + "localId" : "588", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "585", + "localId" : "589", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "567", + "localId" : "571", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "568", + "localId" : "572", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "569", + "localId" : "573", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "570", + "localId" : "574", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "559", + "localId" : "563", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186512,7 +186262,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "560", + "localId" : "564", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186520,7 +186270,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "561", + "localId" : "565", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -186529,28 +186279,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "579", + "localId" : "583", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "580", + "localId" : "584", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "581", + "localId" : "585", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "582", + "localId" : "586", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "571", + "localId" : "575", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186558,7 +186308,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "572", + "localId" : "576", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186566,7 +186316,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "573", + "localId" : "577", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "25", @@ -186575,45 +186325,45 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "610", + "localId" : "614", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "611", + "localId" : "615", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "612", + "localId" : "616", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "594", + "localId" : "598", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "595", + "localId" : "599", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "596", + "localId" : "600", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "597", + "localId" : "601", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "586", + "localId" : "590", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186621,7 +186371,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "587", + "localId" : "591", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186629,7 +186379,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "588", + "localId" : "592", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "6", @@ -186638,28 +186388,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "606", + "localId" : "610", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "607", + "localId" : "611", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "608", + "localId" : "612", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "609", + "localId" : "613", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "598", + "localId" : "602", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186667,7 +186417,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "599", + "localId" : "603", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186675,7 +186425,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "600", + "localId" : "604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "27", @@ -186685,7 +186435,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "620", + "localId" : "624", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalStartsDayOfTrue", "context" : "Patient", @@ -186694,51 +186444,51 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "620", + "r" : "624", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalStartsDayOfTrue", ": " ] }, { - "r" : "675", + "r" : "679", "s" : [ { - "r" : "645", + "r" : "649", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "629", + "r" : "633", "s" : [ { - "r" : "621", + "r" : "625", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "641", + "r" : "645", "s" : [ { - "r" : "633", + "r" : "637", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "25", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "675", + "r" : "679", "value" : [ " ", "starts day of", " " ] }, { - "r" : "672", + "r" : "676", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "656", + "r" : "660", "s" : [ { - "r" : "648", + "r" : "652", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "668", + "r" : "672", "s" : [ { - "r" : "660", + "r" : "664", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "27", ")" ] } ] }, { @@ -186750,72 +186500,72 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "675", + "localId" : "679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "676", + "localId" : "680", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "677", + "localId" : "681", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "678", + "localId" : "682", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "679", + "localId" : "683", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "645", + "localId" : "649", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "646", + "localId" : "650", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "647", + "localId" : "651", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "629", + "localId" : "633", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "630", + "localId" : "634", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "631", + "localId" : "635", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "632", + "localId" : "636", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "621", + "localId" : "625", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186823,7 +186573,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "622", + "localId" : "626", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186831,7 +186581,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "623", + "localId" : "627", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -186840,28 +186590,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "641", + "localId" : "645", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "642", + "localId" : "646", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "643", + "localId" : "647", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "644", + "localId" : "648", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "633", + "localId" : "637", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186869,7 +186619,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "634", + "localId" : "638", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186877,7 +186627,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "635", + "localId" : "639", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "25", @@ -186886,45 +186636,45 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "672", + "localId" : "676", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "673", + "localId" : "677", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "674", + "localId" : "678", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "656", + "localId" : "660", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "657", + "localId" : "661", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "658", + "localId" : "662", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "659", + "localId" : "663", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "648", + "localId" : "652", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186932,7 +186682,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "649", + "localId" : "653", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186940,7 +186690,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "650", + "localId" : "654", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -186949,28 +186699,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "668", + "localId" : "672", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "669", + "localId" : "673", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "670", + "localId" : "674", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "671", + "localId" : "675", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "660", + "localId" : "664", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -186978,7 +186728,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "661", + "localId" : "665", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -186986,7 +186736,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "662", + "localId" : "666", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "27", @@ -186996,7 +186746,7 @@ module.exports['Starts'] = { } ] } }, { - "localId" : "682", + "localId" : "686", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalStartsEndsFalse", "context" : "Patient", @@ -187005,51 +186755,51 @@ module.exports['Starts'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "682", + "r" : "686", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalStartsEndsFalse", ": " ] }, { - "r" : "737", + "r" : "741", "s" : [ { - "r" : "707", + "r" : "711", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "691", + "r" : "695", "s" : [ { - "r" : "683", + "r" : "687", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "703", + "r" : "707", "s" : [ { - "r" : "695", + "r" : "699", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "25", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "737", + "r" : "741", "value" : [ " ", "starts day of", " " ] }, { - "r" : "734", + "r" : "738", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "718", + "r" : "722", "s" : [ { - "r" : "710", + "r" : "714", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "730", + "r" : "734", "s" : [ { - "r" : "722", + "r" : "726", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "24", ")" ] } ] }, { @@ -187061,72 +186811,72 @@ module.exports['Starts'] = { } ], "expression" : { "type" : "Starts", - "localId" : "737", + "localId" : "741", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "738", + "localId" : "742", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "739", + "localId" : "743", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "740", + "localId" : "744", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "741", + "localId" : "745", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "707", + "localId" : "711", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "708", + "localId" : "712", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "709", + "localId" : "713", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "691", + "localId" : "695", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "692", + "localId" : "696", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "693", + "localId" : "697", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "694", + "localId" : "698", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "683", + "localId" : "687", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -187134,7 +186884,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "684", + "localId" : "688", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187142,7 +186892,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "685", + "localId" : "689", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -187151,28 +186901,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "703", + "localId" : "707", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "704", + "localId" : "708", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "705", + "localId" : "709", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "706", + "localId" : "710", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "695", + "localId" : "699", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -187180,7 +186930,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "696", + "localId" : "700", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187188,7 +186938,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "697", + "localId" : "701", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "25", @@ -187197,45 +186947,45 @@ module.exports['Starts'] = { } }, { "type" : "Interval", - "localId" : "734", + "localId" : "738", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "735", + "localId" : "739", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "736", + "localId" : "740", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "718", + "localId" : "722", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "719", + "localId" : "723", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "720", + "localId" : "724", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "721", + "localId" : "725", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "710", + "localId" : "714", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -187243,7 +186993,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "711", + "localId" : "715", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187251,7 +187001,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "712", + "localId" : "716", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -187260,28 +187010,28 @@ module.exports['Starts'] = { }, "high" : { "type" : "DateTime", - "localId" : "730", + "localId" : "734", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "731", + "localId" : "735", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "732", + "localId" : "736", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "733", + "localId" : "737", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "722", + "localId" : "726", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -187289,7 +187039,7 @@ module.exports['Starts'] = { }, "month" : { "type" : "Literal", - "localId" : "723", + "localId" : "727", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187297,7 +187047,7 @@ module.exports['Starts'] = { }, "day" : { "type" : "Literal", - "localId" : "724", + "localId" : "728", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "24", @@ -187315,7 +187065,7 @@ module.exports['Starts'] = { library TestSnippet version '1' using Simple version '1.0.0' context Patient -define TestEndsNull: Interval[1, 10] ends Interval[null, null] +define TestEndsNull: Interval[1, 10] ends Interval[null as Integer, null as Integer] define IntegerIntervalEndsTrue: Interval[4,10] ends Interval[1,10] define IntegerIntervalEndsFalse: Interval[4, 9] ends Interval[1,10] define IntegerIntervalEndsStartsFalse: Interval[0, 10] ends Interval[1,10] @@ -187346,7 +187096,7 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "689", + "r" : "686", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -187432,7 +187182,7 @@ module.exports['Ends'] = { "s" : [ { "value" : [ "", "define ", "TestEndsNull", ": " ] }, { - "r" : "225", + "r" : "229", "s" : [ { "r" : "217", "s" : [ { @@ -187440,13 +187190,38 @@ module.exports['Ends'] = { "value" : [ "Interval[", "1", ", ", "10", "]" ] } ] }, { - "r" : "225", + "r" : "229", "value" : [ " ", "ends", " " ] }, { - "r" : "222", + "r" : "226", "s" : [ { + "value" : [ "Interval[" ] + }, { "r" : "220", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "221", + "value" : [ "null", " as " ] + }, { + "r" : "222", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "223", + "s" : [ { + "r" : "224", + "value" : [ "null", " as " ] + }, { + "r" : "225", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] } ] } ] @@ -187454,26 +187229,26 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "225", + "localId" : "229", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "233", + "localId" : "230", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "234", + "localId" : "231", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "235", + "localId" : "232", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "236", + "localId" : "233", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } @@ -187514,169 +187289,66 @@ module.exports['Ends'] = { }, { "type" : "Interval", "localId" : "226", + "lowClosed" : true, + "highClosed" : true, "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "227", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "228", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } + }, "low" : { "type" : "As", - "localId" : "228", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "220", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "227", - "path" : "low", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "222", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "223", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "224", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "220", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "221", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "lowClosedExpression" : { - "type" : "Property", - "localId" : "229", - "path" : "lowClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", + "type" : "Null", + "localId" : "221", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", "localId" : "222", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "223", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "224", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "220", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "221", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } }, "high" : { "type" : "As", - "localId" : "231", - "asType" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "223", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { - "type" : "Property", - "localId" : "230", - "path" : "high", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "222", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "223", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "224", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "220", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "221", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - } - } - }, - "highClosedExpression" : { - "type" : "Property", - "localId" : "232", - "path" : "highClosed", - "annotation" : [ ], - "source" : { - "type" : "Interval", - "localId" : "222", - "lowClosed" : true, - "highClosed" : true, - "annotation" : [ ], - "resultTypeSpecifier" : { - "type" : "IntervalTypeSpecifier", - "localId" : "223", - "annotation" : [ ], - "pointType" : { - "type" : "NamedTypeSpecifier", - "localId" : "224", - "name" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } - }, - "low" : { - "type" : "Null", - "localId" : "220", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - }, - "high" : { - "type" : "Null", - "localId" : "221", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] - } + "type" : "Null", + "localId" : "224", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "225", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } } } ] } }, { - "localId" : "239", + "localId" : "236", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalEndsTrue", "context" : "Patient", @@ -187685,24 +187357,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "239", + "r" : "236", "s" : [ { "value" : [ "", "define ", "IntegerIntervalEndsTrue", ": " ] }, { - "r" : "250", + "r" : "247", "s" : [ { - "r" : "242", + "r" : "239", "s" : [ { - "r" : "240", + "r" : "237", "value" : [ "Interval[", "4", ",", "10", "]" ] } ] }, { - "r" : "250", + "r" : "247", "value" : [ " ", "ends", " " ] }, { - "r" : "247", + "r" : "244", "s" : [ { - "r" : "245", + "r" : "242", "value" : [ "Interval[", "1", ",", "10", "]" ] } ] } ] @@ -187711,50 +187383,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "250", + "localId" : "247", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "251", + "localId" : "248", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "252", + "localId" : "249", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "253", + "localId" : "250", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "254", + "localId" : "251", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "242", + "localId" : "239", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "243", + "localId" : "240", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "244", + "localId" : "241", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "240", + "localId" : "237", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -187762,7 +187434,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "241", + "localId" : "238", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -187770,24 +187442,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "247", + "localId" : "244", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "248", + "localId" : "245", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "249", + "localId" : "246", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "245", + "localId" : "242", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187795,7 +187467,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "246", + "localId" : "243", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -187804,7 +187476,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "257", + "localId" : "254", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalEndsFalse", "context" : "Patient", @@ -187813,24 +187485,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "257", + "r" : "254", "s" : [ { "value" : [ "", "define ", "IntegerIntervalEndsFalse", ": " ] }, { - "r" : "268", + "r" : "265", "s" : [ { - "r" : "260", + "r" : "257", "s" : [ { - "r" : "258", + "r" : "255", "value" : [ "Interval[", "4", ", ", "9", "]" ] } ] }, { - "r" : "268", + "r" : "265", "value" : [ " ", "ends", " " ] }, { - "r" : "265", + "r" : "262", "s" : [ { - "r" : "263", + "r" : "260", "value" : [ "Interval[", "1", ",", "10", "]" ] } ] } ] @@ -187839,50 +187511,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "268", + "localId" : "265", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "269", + "localId" : "266", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "270", + "localId" : "267", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "271", + "localId" : "268", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "272", + "localId" : "269", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "260", + "localId" : "257", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "261", + "localId" : "258", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "262", + "localId" : "259", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "258", + "localId" : "255", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -187890,7 +187562,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "259", + "localId" : "256", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "9", @@ -187898,24 +187570,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "265", + "localId" : "262", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "266", + "localId" : "263", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "267", + "localId" : "264", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "263", + "localId" : "260", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -187923,7 +187595,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "264", + "localId" : "261", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -187932,7 +187604,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "275", + "localId" : "272", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "IntegerIntervalEndsStartsFalse", "context" : "Patient", @@ -187941,24 +187613,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "275", + "r" : "272", "s" : [ { "value" : [ "", "define ", "IntegerIntervalEndsStartsFalse", ": " ] }, { - "r" : "286", + "r" : "283", "s" : [ { - "r" : "278", + "r" : "275", "s" : [ { - "r" : "276", + "r" : "273", "value" : [ "Interval[", "0", ", ", "10", "]" ] } ] }, { - "r" : "286", + "r" : "283", "value" : [ " ", "ends", " " ] }, { - "r" : "283", + "r" : "280", "s" : [ { - "r" : "281", + "r" : "278", "value" : [ "Interval[", "1", ",", "10", "]" ] } ] } ] @@ -187967,50 +187639,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "286", + "localId" : "283", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "287", + "localId" : "284", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "288", + "localId" : "285", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "289", + "localId" : "286", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "290", + "localId" : "287", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "278", + "localId" : "275", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "279", + "localId" : "276", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "280", + "localId" : "277", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "276", + "localId" : "273", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -188018,7 +187690,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "277", + "localId" : "274", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -188026,24 +187698,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "283", + "localId" : "280", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "284", + "localId" : "281", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "285", + "localId" : "282", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "281", + "localId" : "278", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -188051,7 +187723,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "282", + "localId" : "279", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -188060,7 +187732,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "293", + "localId" : "290", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalEndsTrue", "context" : "Patient", @@ -188069,24 +187741,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "293", + "r" : "290", "s" : [ { "value" : [ "", "define ", "LongIntervalEndsTrue", ": " ] }, { - "r" : "304", + "r" : "301", "s" : [ { - "r" : "296", + "r" : "293", "s" : [ { - "r" : "294", + "r" : "291", "value" : [ "Interval[", "4L", ",", "10L", "]" ] } ] }, { - "r" : "304", + "r" : "301", "value" : [ " ", "ends", " " ] }, { - "r" : "301", + "r" : "298", "s" : [ { - "r" : "299", + "r" : "296", "value" : [ "Interval[", "1L", ",", "10L", "]" ] } ] } ] @@ -188095,50 +187767,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "304", + "localId" : "301", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "305", + "localId" : "302", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "306", + "localId" : "303", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "307", + "localId" : "304", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "308", + "localId" : "305", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "296", + "localId" : "293", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "297", + "localId" : "294", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "298", + "localId" : "295", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "294", + "localId" : "291", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -188146,7 +187818,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "295", + "localId" : "292", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -188154,24 +187826,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "301", + "localId" : "298", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "302", + "localId" : "299", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "303", + "localId" : "300", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "299", + "localId" : "296", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "1", @@ -188179,7 +187851,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "300", + "localId" : "297", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -188188,7 +187860,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "311", + "localId" : "308", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalEndsFalse", "context" : "Patient", @@ -188197,24 +187869,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "311", + "r" : "308", "s" : [ { "value" : [ "", "define ", "LongIntervalEndsFalse", ": " ] }, { - "r" : "322", + "r" : "319", "s" : [ { - "r" : "314", + "r" : "311", "s" : [ { - "r" : "312", + "r" : "309", "value" : [ "Interval[", "4L", ", ", "9L", "]" ] } ] }, { - "r" : "322", + "r" : "319", "value" : [ " ", "ends", " " ] }, { - "r" : "319", + "r" : "316", "s" : [ { - "r" : "317", + "r" : "314", "value" : [ "Interval[", "1L", ",", "10L", "]" ] } ] } ] @@ -188223,50 +187895,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "322", + "localId" : "319", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "323", + "localId" : "320", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "324", + "localId" : "321", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "325", + "localId" : "322", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "326", + "localId" : "323", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "314", + "localId" : "311", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "315", + "localId" : "312", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "316", + "localId" : "313", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "312", + "localId" : "309", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "4", @@ -188274,7 +187946,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "313", + "localId" : "310", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "9", @@ -188282,24 +187954,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "319", + "localId" : "316", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "320", + "localId" : "317", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "321", + "localId" : "318", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "317", + "localId" : "314", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "1", @@ -188307,7 +187979,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "318", + "localId" : "315", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -188316,7 +187988,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "329", + "localId" : "326", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "LongIntervalEndsStartsFalse", "context" : "Patient", @@ -188325,24 +187997,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "329", + "r" : "326", "s" : [ { "value" : [ "", "define ", "LongIntervalEndsStartsFalse", ": " ] }, { - "r" : "340", + "r" : "337", "s" : [ { - "r" : "332", + "r" : "329", "s" : [ { - "r" : "330", + "r" : "327", "value" : [ "Interval[", "0L", ", ", "10L", "]" ] } ] }, { - "r" : "340", + "r" : "337", "value" : [ " ", "ends", " " ] }, { - "r" : "337", + "r" : "334", "s" : [ { - "r" : "335", + "r" : "332", "value" : [ "Interval[", "1L", ",", "10L", "]" ] } ] } ] @@ -188351,50 +188023,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "340", + "localId" : "337", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "341", + "localId" : "338", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "342", + "localId" : "339", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "343", + "localId" : "340", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "344", + "localId" : "341", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "332", + "localId" : "329", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "333", + "localId" : "330", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "334", + "localId" : "331", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "330", + "localId" : "327", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "0", @@ -188402,7 +188074,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "331", + "localId" : "328", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -188410,24 +188082,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "337", + "localId" : "334", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "338", + "localId" : "335", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "339", + "localId" : "336", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "335", + "localId" : "332", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "1", @@ -188435,7 +188107,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "336", + "localId" : "333", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -188444,7 +188116,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "347", + "localId" : "344", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalEndsTrue", "context" : "Patient", @@ -188453,24 +188125,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "347", + "r" : "344", "s" : [ { "value" : [ "", "define ", "DecimalIntervalEndsTrue", ": " ] }, { - "r" : "358", + "r" : "355", "s" : [ { - "r" : "350", + "r" : "347", "s" : [ { - "r" : "348", + "r" : "345", "value" : [ "Interval[", "4.0", ",", "10.0", "]" ] } ] }, { - "r" : "358", + "r" : "355", "value" : [ " ", "ends", " " ] }, { - "r" : "355", + "r" : "352", "s" : [ { - "r" : "353", + "r" : "350", "value" : [ "Interval[", "1.0", ",", "10.0", "]" ] } ] } ] @@ -188479,50 +188151,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "358", + "localId" : "355", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "359", + "localId" : "356", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "360", + "localId" : "357", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "361", + "localId" : "358", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "362", + "localId" : "359", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "350", + "localId" : "347", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "351", + "localId" : "348", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "352", + "localId" : "349", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "348", + "localId" : "345", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "4.0", @@ -188530,7 +188202,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "349", + "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -188538,24 +188210,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "355", + "localId" : "352", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "356", + "localId" : "353", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "357", + "localId" : "354", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "353", + "localId" : "350", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "1.0", @@ -188563,7 +188235,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "354", + "localId" : "351", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -188572,7 +188244,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "365", + "localId" : "362", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalEndsFalse", "context" : "Patient", @@ -188581,24 +188253,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "365", + "r" : "362", "s" : [ { "value" : [ "", "define ", "DecimalIntervalEndsFalse", ": " ] }, { - "r" : "376", + "r" : "373", "s" : [ { - "r" : "368", + "r" : "365", "s" : [ { - "r" : "366", + "r" : "363", "value" : [ "Interval[", "11.0", ", ", "20.0", "]" ] } ] }, { - "r" : "376", + "r" : "373", "value" : [ " ", "ends", " " ] }, { - "r" : "373", + "r" : "370", "s" : [ { - "r" : "371", + "r" : "368", "value" : [ "Interval[", "1.0", ",", "10.0", "]" ] } ] } ] @@ -188607,50 +188279,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "376", + "localId" : "373", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "377", + "localId" : "374", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "378", + "localId" : "375", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "379", + "localId" : "376", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "380", + "localId" : "377", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "368", + "localId" : "365", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "369", + "localId" : "366", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "370", + "localId" : "367", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "366", + "localId" : "363", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "11.0", @@ -188658,7 +188330,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "367", + "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "20.0", @@ -188666,24 +188338,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "373", + "localId" : "370", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "374", + "localId" : "371", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "375", + "localId" : "372", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "371", + "localId" : "368", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "1.0", @@ -188691,7 +188363,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "372", + "localId" : "369", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -188700,7 +188372,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "383", + "localId" : "380", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DecimalIntervalEndsStartsFalse", "context" : "Patient", @@ -188709,24 +188381,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "383", + "r" : "380", "s" : [ { "value" : [ "", "define ", "DecimalIntervalEndsStartsFalse", ": " ] }, { - "r" : "394", + "r" : "391", "s" : [ { - "r" : "386", + "r" : "383", "s" : [ { - "r" : "384", + "r" : "381", "value" : [ "Interval[", "0.0", ", ", "10.0", "]" ] } ] }, { - "r" : "394", + "r" : "391", "value" : [ " ", "ends", " " ] }, { - "r" : "391", + "r" : "388", "s" : [ { - "r" : "389", + "r" : "386", "value" : [ "Interval[", "1.0", ", ", "10.0", "]" ] } ] } ] @@ -188735,50 +188407,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "394", + "localId" : "391", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "395", + "localId" : "392", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "396", + "localId" : "393", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "397", + "localId" : "394", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "398", + "localId" : "395", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "386", + "localId" : "383", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "387", + "localId" : "384", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "388", + "localId" : "385", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "384", + "localId" : "381", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "0.0", @@ -188786,7 +188458,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "385", + "localId" : "382", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -188794,24 +188466,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "391", + "localId" : "388", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "392", + "localId" : "389", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "393", + "localId" : "390", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "low" : { "type" : "Literal", - "localId" : "389", + "localId" : "386", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "1.0", @@ -188819,7 +188491,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Literal", - "localId" : "390", + "localId" : "387", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "10.0", @@ -188828,7 +188500,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "401", + "localId" : "398", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalEndsTrue", "context" : "Patient", @@ -188837,24 +188509,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "401", + "r" : "398", "s" : [ { "value" : [ "", "define ", "QuantityIntervalEndsTrue", ": " ] }, { - "r" : "412", + "r" : "409", "s" : [ { - "r" : "404", + "r" : "401", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "402", + "r" : "399", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "403", + "r" : "400", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -188862,21 +188534,21 @@ module.exports['Ends'] = { "value" : [ "]" ] } ] }, { - "r" : "412", + "r" : "409", "value" : [ " ", "ends", " " ] }, { - "r" : "409", + "r" : "406", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "407", + "r" : "404", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "408", + "r" : "405", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -188889,50 +188561,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "412", + "localId" : "409", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "413", + "localId" : "410", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "414", + "localId" : "411", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "415", + "localId" : "412", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "416", + "localId" : "413", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "404", + "localId" : "401", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "405", + "localId" : "402", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "406", + "localId" : "403", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "402", + "localId" : "399", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -188940,7 +188612,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "403", + "localId" : "400", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -188948,24 +188620,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "409", + "localId" : "406", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "410", + "localId" : "407", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "411", + "localId" : "408", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "407", + "localId" : "404", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", @@ -188973,7 +188645,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "408", + "localId" : "405", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -188982,7 +188654,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "419", + "localId" : "416", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalEndsFalse", "context" : "Patient", @@ -188991,24 +188663,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "419", + "r" : "416", "s" : [ { "value" : [ "", "define ", "QuantityIntervalEndsFalse", ": " ] }, { - "r" : "430", + "r" : "427", "s" : [ { - "r" : "422", + "r" : "419", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "420", + "r" : "417", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "421", + "r" : "418", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -189016,21 +188688,21 @@ module.exports['Ends'] = { "value" : [ "]" ] } ] }, { - "r" : "430", + "r" : "427", "value" : [ " ", "ends", " " ] }, { - "r" : "427", + "r" : "424", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "425", + "r" : "422", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "426", + "r" : "423", "s" : [ { "value" : [ "10.5 ", "'g'" ] } ] @@ -189043,50 +188715,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "430", + "localId" : "427", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "431", + "localId" : "428", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "432", + "localId" : "429", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "433", + "localId" : "430", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "434", + "localId" : "431", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "422", + "localId" : "419", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "423", + "localId" : "420", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "424", + "localId" : "421", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "420", + "localId" : "417", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -189094,7 +188766,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "421", + "localId" : "418", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -189102,24 +188774,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "427", + "localId" : "424", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "428", + "localId" : "425", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "429", + "localId" : "426", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "425", + "localId" : "422", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", @@ -189127,7 +188799,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "426", + "localId" : "423", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.5, "unit" : "g", @@ -189136,7 +188808,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "437", + "localId" : "434", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "QuantityIntervalEndsStartsFalse", "context" : "Patient", @@ -189145,24 +188817,24 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "437", + "r" : "434", "s" : [ { "value" : [ "", "define ", "QuantityIntervalEndsStartsFalse", ": " ] }, { - "r" : "448", + "r" : "445", "s" : [ { - "r" : "440", + "r" : "437", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "438", + "r" : "435", "s" : [ { "value" : [ "4.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "439", + "r" : "436", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -189170,21 +188842,21 @@ module.exports['Ends'] = { "value" : [ "]" ] } ] }, { - "r" : "448", + "r" : "445", "value" : [ " ", "ends", " " ] }, { - "r" : "445", + "r" : "442", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "443", + "r" : "440", "s" : [ { "value" : [ "5.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "444", + "r" : "441", "s" : [ { "value" : [ "10.0 ", "'g'" ] } ] @@ -189197,50 +188869,50 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "448", + "localId" : "445", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "449", + "localId" : "446", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "450", + "localId" : "447", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "451", + "localId" : "448", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "452", + "localId" : "449", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "440", + "localId" : "437", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "441", + "localId" : "438", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "442", + "localId" : "439", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "438", + "localId" : "435", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4.0, "unit" : "g", @@ -189248,7 +188920,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "439", + "localId" : "436", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -189256,24 +188928,24 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "445", + "localId" : "442", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "446", + "localId" : "443", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "447", + "localId" : "444", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "Quantity", - "localId" : "443", + "localId" : "440", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5.0, "unit" : "g", @@ -189281,7 +188953,7 @@ module.exports['Ends'] = { }, "high" : { "type" : "Quantity", - "localId" : "444", + "localId" : "441", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 10.0, "unit" : "g", @@ -189290,7 +188962,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "455", + "localId" : "452", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalEndsTrue", "context" : "Patient", @@ -189299,51 +188971,51 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "455", + "r" : "452", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalEndsTrue", ": " ] }, { - "r" : "558", + "r" : "555", "s" : [ { - "r" : "504", + "r" : "501", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "472", + "r" : "469", "s" : [ { - "r" : "456", + "r" : "453", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "496", + "r" : "493", "s" : [ { - "r" : "480", + "r" : "477", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "15", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "558", + "r" : "555", "value" : [ " ", "ends", " " ] }, { - "r" : "555", + "r" : "552", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "523", + "r" : "520", "s" : [ { - "r" : "507", + "r" : "504", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "1", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "547", + "r" : "544", "s" : [ { - "r" : "531", + "r" : "528", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "15", ", ", "0", ", ", "0", ", ", "0", ", ", "0", ")" ] } ] }, { @@ -189355,91 +189027,91 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "558", + "localId" : "555", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "559", + "localId" : "556", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "560", + "localId" : "557", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "561", + "localId" : "558", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "562", + "localId" : "559", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "504", + "localId" : "501", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "505", + "localId" : "502", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "506", + "localId" : "503", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "472", + "localId" : "469", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "473", + "localId" : "470", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "474", + "localId" : "471", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "475", + "localId" : "472", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "476", + "localId" : "473", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "477", + "localId" : "474", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "478", + "localId" : "475", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "479", + "localId" : "476", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "456", + "localId" : "453", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189447,7 +189119,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "457", + "localId" : "454", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189455,7 +189127,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "458", + "localId" : "455", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -189463,7 +189135,7 @@ module.exports['Ends'] = { }, "hour" : { "type" : "Literal", - "localId" : "459", + "localId" : "456", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189471,7 +189143,7 @@ module.exports['Ends'] = { }, "minute" : { "type" : "Literal", - "localId" : "460", + "localId" : "457", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189479,7 +189151,7 @@ module.exports['Ends'] = { }, "second" : { "type" : "Literal", - "localId" : "461", + "localId" : "458", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189487,7 +189159,7 @@ module.exports['Ends'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "462", + "localId" : "459", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189496,48 +189168,48 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "496", + "localId" : "493", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "497", + "localId" : "494", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "498", + "localId" : "495", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "499", + "localId" : "496", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "500", + "localId" : "497", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "501", + "localId" : "498", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "502", + "localId" : "499", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "503", + "localId" : "500", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "480", + "localId" : "477", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189545,7 +189217,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "481", + "localId" : "478", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189553,7 +189225,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "482", + "localId" : "479", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -189561,7 +189233,7 @@ module.exports['Ends'] = { }, "hour" : { "type" : "Literal", - "localId" : "483", + "localId" : "480", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189569,7 +189241,7 @@ module.exports['Ends'] = { }, "minute" : { "type" : "Literal", - "localId" : "484", + "localId" : "481", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189577,7 +189249,7 @@ module.exports['Ends'] = { }, "second" : { "type" : "Literal", - "localId" : "485", + "localId" : "482", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189585,7 +189257,7 @@ module.exports['Ends'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "486", + "localId" : "483", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189594,65 +189266,65 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "555", + "localId" : "552", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "556", + "localId" : "553", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "557", + "localId" : "554", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "523", + "localId" : "520", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "524", + "localId" : "521", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "525", + "localId" : "522", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "526", + "localId" : "523", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "527", + "localId" : "524", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "528", + "localId" : "525", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "529", + "localId" : "526", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "530", + "localId" : "527", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "507", + "localId" : "504", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189660,7 +189332,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "508", + "localId" : "505", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189668,7 +189340,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "509", + "localId" : "506", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189676,7 +189348,7 @@ module.exports['Ends'] = { }, "hour" : { "type" : "Literal", - "localId" : "510", + "localId" : "507", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189684,7 +189356,7 @@ module.exports['Ends'] = { }, "minute" : { "type" : "Literal", - "localId" : "511", + "localId" : "508", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189692,7 +189364,7 @@ module.exports['Ends'] = { }, "second" : { "type" : "Literal", - "localId" : "512", + "localId" : "509", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189700,7 +189372,7 @@ module.exports['Ends'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "513", + "localId" : "510", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189709,48 +189381,48 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "547", + "localId" : "544", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "548", + "localId" : "545", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "549", + "localId" : "546", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "550", + "localId" : "547", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "551", + "localId" : "548", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "552", + "localId" : "549", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "553", + "localId" : "550", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "554", + "localId" : "551", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "531", + "localId" : "528", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189758,7 +189430,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "532", + "localId" : "529", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189766,7 +189438,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "533", + "localId" : "530", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -189774,7 +189446,7 @@ module.exports['Ends'] = { }, "hour" : { "type" : "Literal", - "localId" : "534", + "localId" : "531", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189782,7 +189454,7 @@ module.exports['Ends'] = { }, "minute" : { "type" : "Literal", - "localId" : "535", + "localId" : "532", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189790,7 +189462,7 @@ module.exports['Ends'] = { }, "second" : { "type" : "Literal", - "localId" : "536", + "localId" : "533", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189798,7 +189470,7 @@ module.exports['Ends'] = { }, "millisecond" : { "type" : "Literal", - "localId" : "537", + "localId" : "534", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", @@ -189808,7 +189480,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "565", + "localId" : "562", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalEndsFalse", "context" : "Patient", @@ -189817,51 +189489,51 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "565", + "r" : "562", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalEndsFalse", ": " ] }, { - "r" : "620", + "r" : "617", "s" : [ { - "r" : "590", + "r" : "587", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "574", + "r" : "571", "s" : [ { - "r" : "566", + "r" : "563", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "586", + "r" : "583", "s" : [ { - "r" : "578", + "r" : "575", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "15", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "620", + "r" : "617", "value" : [ " ", "ends day of", " " ] }, { - "r" : "617", + "r" : "614", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "601", + "r" : "598", "s" : [ { - "r" : "593", + "r" : "590", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "613", + "r" : "610", "s" : [ { - "r" : "605", + "r" : "602", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "16", ")" ] } ] }, { @@ -189873,72 +189545,72 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "620", + "localId" : "617", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "621", + "localId" : "618", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "622", + "localId" : "619", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "623", + "localId" : "620", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "624", + "localId" : "621", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "590", + "localId" : "587", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "591", + "localId" : "588", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "592", + "localId" : "589", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "574", + "localId" : "571", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "575", + "localId" : "572", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "576", + "localId" : "573", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "577", + "localId" : "574", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "566", + "localId" : "563", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189946,7 +189618,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "567", + "localId" : "564", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -189954,7 +189626,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "568", + "localId" : "565", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -189963,28 +189635,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "586", + "localId" : "583", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "587", + "localId" : "584", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "588", + "localId" : "585", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "589", + "localId" : "586", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "578", + "localId" : "575", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -189992,7 +189664,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "579", + "localId" : "576", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190000,7 +189672,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "580", + "localId" : "577", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -190009,45 +189681,45 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "617", + "localId" : "614", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "618", + "localId" : "615", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "619", + "localId" : "616", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "601", + "localId" : "598", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "602", + "localId" : "599", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "603", + "localId" : "600", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "604", + "localId" : "601", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "593", + "localId" : "590", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190055,7 +189727,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "594", + "localId" : "591", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190063,7 +189735,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "595", + "localId" : "592", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190072,28 +189744,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "613", + "localId" : "610", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "614", + "localId" : "611", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "615", + "localId" : "612", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "616", + "localId" : "613", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "605", + "localId" : "602", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190101,7 +189773,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "606", + "localId" : "603", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190109,7 +189781,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "607", + "localId" : "604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "16", @@ -190119,7 +189791,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "627", + "localId" : "624", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalEndsDayOfTrue", "context" : "Patient", @@ -190128,51 +189800,51 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "627", + "r" : "624", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalEndsDayOfTrue", ": " ] }, { - "r" : "682", + "r" : "679", "s" : [ { - "r" : "652", + "r" : "649", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "636", + "r" : "633", "s" : [ { - "r" : "628", + "r" : "625", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "648", + "r" : "645", "s" : [ { - "r" : "640", + "r" : "637", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "15", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "682", + "r" : "679", "value" : [ " ", "ends day of", " " ] }, { - "r" : "679", + "r" : "676", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "663", + "r" : "660", "s" : [ { - "r" : "655", + "r" : "652", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "675", + "r" : "672", "s" : [ { - "r" : "667", + "r" : "664", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "15", ")" ] } ] }, { @@ -190184,72 +189856,72 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "682", + "localId" : "679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "683", + "localId" : "680", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "684", + "localId" : "681", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "685", + "localId" : "682", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "686", + "localId" : "683", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "652", + "localId" : "649", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "653", + "localId" : "650", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "654", + "localId" : "651", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "636", + "localId" : "633", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "637", + "localId" : "634", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "638", + "localId" : "635", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "639", + "localId" : "636", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "628", + "localId" : "625", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190257,7 +189929,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "629", + "localId" : "626", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190265,7 +189937,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "630", + "localId" : "627", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -190274,28 +189946,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "648", + "localId" : "645", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "649", + "localId" : "646", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "650", + "localId" : "647", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "651", + "localId" : "648", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "640", + "localId" : "637", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190303,7 +189975,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "641", + "localId" : "638", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190311,7 +189983,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "642", + "localId" : "639", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -190320,45 +189992,45 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "679", + "localId" : "676", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "680", + "localId" : "677", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "681", + "localId" : "678", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "663", + "localId" : "660", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "664", + "localId" : "661", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "665", + "localId" : "662", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "666", + "localId" : "663", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "655", + "localId" : "652", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190366,7 +190038,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "656", + "localId" : "653", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190374,7 +190046,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "657", + "localId" : "654", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190383,28 +190055,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "675", + "localId" : "672", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "676", + "localId" : "673", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "677", + "localId" : "674", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "678", + "localId" : "675", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "667", + "localId" : "664", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190412,7 +190084,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "668", + "localId" : "665", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190420,7 +190092,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "669", + "localId" : "666", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "15", @@ -190430,7 +190102,7 @@ module.exports['Ends'] = { } ] } }, { - "localId" : "689", + "localId" : "686", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "name" : "DateTimeIntervalEndsStartsFalse", "context" : "Patient", @@ -190439,51 +190111,51 @@ module.exports['Ends'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "689", + "r" : "686", "s" : [ { "value" : [ "", "define ", "DateTimeIntervalEndsStartsFalse", ": " ] }, { - "r" : "744", + "r" : "741", "s" : [ { - "r" : "714", + "r" : "711", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "698", + "r" : "695", "s" : [ { - "r" : "690", + "r" : "687", "value" : [ "DateTime", "(", "2012", ", ", "1", ", ", "5", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "710", + "r" : "707", "s" : [ { - "r" : "702", + "r" : "699", "value" : [ "DateTime", "(", "2012", ", ", "2", ", ", "16", ")" ] } ] }, { "value" : [ "]" ] } ] }, { - "r" : "744", + "r" : "741", "value" : [ " ", "ends day of", " " ] }, { - "r" : "741", + "r" : "738", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "725", + "r" : "722", "s" : [ { - "r" : "717", + "r" : "714", "value" : [ "DateTime", "(", "2012", ", ", "2", ", ", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "737", + "r" : "734", "s" : [ { - "r" : "729", + "r" : "726", "value" : [ "DateTime", "(", "2012", ", ", "2", ", ", "16", ")" ] } ] }, { @@ -190495,72 +190167,72 @@ module.exports['Ends'] = { } ], "expression" : { "type" : "Ends", - "localId" : "744", + "localId" : "741", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", "precision" : "Day", "annotation" : [ ], "signature" : [ { "type" : "IntervalTypeSpecifier", - "localId" : "745", + "localId" : "742", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "746", + "localId" : "743", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, { "type" : "IntervalTypeSpecifier", - "localId" : "747", + "localId" : "744", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "748", + "localId" : "745", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } ], "operand" : [ { "type" : "Interval", - "localId" : "714", + "localId" : "711", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "715", + "localId" : "712", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "716", + "localId" : "713", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "698", + "localId" : "695", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "699", + "localId" : "696", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "700", + "localId" : "697", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "701", + "localId" : "698", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "690", + "localId" : "687", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190568,7 +190240,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "691", + "localId" : "688", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190576,7 +190248,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "692", + "localId" : "689", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", @@ -190585,28 +190257,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "710", + "localId" : "707", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "711", + "localId" : "708", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "712", + "localId" : "709", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "713", + "localId" : "710", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "702", + "localId" : "699", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190614,7 +190286,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "703", + "localId" : "700", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -190622,7 +190294,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "704", + "localId" : "701", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "16", @@ -190631,45 +190303,45 @@ module.exports['Ends'] = { } }, { "type" : "Interval", - "localId" : "741", + "localId" : "738", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "742", + "localId" : "739", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "743", + "localId" : "740", "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { "type" : "DateTime", - "localId" : "725", + "localId" : "722", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "726", + "localId" : "723", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "727", + "localId" : "724", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "728", + "localId" : "725", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "717", + "localId" : "714", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190677,7 +190349,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "718", + "localId" : "715", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -190685,7 +190357,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "719", + "localId" : "716", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -190694,28 +190366,28 @@ module.exports['Ends'] = { }, "high" : { "type" : "DateTime", - "localId" : "737", + "localId" : "734", "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "738", + "localId" : "735", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "739", + "localId" : "736", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "740", + "localId" : "737", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "year" : { "type" : "Literal", - "localId" : "729", + "localId" : "726", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2012", @@ -190723,7 +190395,7 @@ module.exports['Ends'] = { }, "month" : { "type" : "Literal", - "localId" : "730", + "localId" : "727", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -190731,7 +190403,7 @@ module.exports['Ends'] = { }, "day" : { "type" : "Literal", - "localId" : "731", + "localId" : "728", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "16", @@ -226513,7 +226185,7 @@ define DateTimeNullStartCollapseNoOverlap: collapse { DateTime9_10Interval, Date define DateTimeNullStartCollapseNoOverlapExpected: { DateTimeNull_5Interval, DateTime9_10Interval } define DateTimeNullEndCollapseExpected: { Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), null] } define DateTimeNullStartEndCollapse: collapse { DateTimeNull_5Interval, DateTime1_10Interval, DateTime5_NullInterval } -define DateTimeNullStartEndCollapseExpected: { Interval[null, null] } +define DateTimeNullStartEndCollapseExpected: { Interval[null as DateTime, null as DateTime] } define QuantityMeterNullLowIntervalList: { Interval[null, ToQuantity('1.995 \'m\'')], Interval[ToQuantity('2 \'m\''), ToQuantity('3 \'m\'')] } define CollapseQuantityNullLowUnitsWithinPer: collapse QuantityMeterNullLowIntervalList per ToQuantity('1 \'cm\'') define CollapseQuantityNullLowUnitsWithinPerExpected : { Interval[null, ToQuantity('3 \'m\'')] } @@ -226522,7 +226194,7 @@ define CollapseQuantityNullHighUnitsWithinPer: collapse QuantityMeterNullHighInt define CollapseQuantityNullHighUnitsWithinPerExpected : { Interval[ToQuantity('1 \'m\''), null] } define QuantityIntervalListWithNulls: { Interval[ToQuantity(4), ToQuantity(8)], Interval[null, ToQuantity(2)], Interval[ToQuantity(1), ToQuantity(4)], Interval[ToQuantity(7), null] } define CollapseQuantityIntervalListWithNulls: collapse QuantityIntervalListWithNulls -define CollapseQuantityIntervalListWithNullsExpected: { Interval[null, null] } +define CollapseQuantityIntervalListWithNullsExpected: { Interval[null as Quantity, null as Quantity] } define QuantityIntervalListWithNullLowNoOverlap: { Interval[ToQuantity(4), ToQuantity(8)], Interval[null, ToQuantity(2)] } define CollapseQuantityIntervalListWithNullLowNoOverlap: collapse QuantityIntervalListWithNullLowNoOverlap define CollapseQuantityIntervalListWithNullLowNoOverlapExpected: { Interval[null, ToQuantity(2)], Interval[ToQuantity(4), ToQuantity(8)]} @@ -226543,7 +226215,7 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2724", + "r" : "2732", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -238205,10 +237877,35 @@ module.exports['Collapse'] = { "s" : [ { "value" : [ "{ " ] }, { - "r" : "2297", + "r" : "2301", "s" : [ { + "value" : [ "Interval[" ] + }, { "r" : "2295", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "s" : [ { + "r" : "2296", + "value" : [ "null", " as " ] + }, { + "r" : "2297", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "2298", + "s" : [ { + "r" : "2299", + "value" : [ "null", " as " ] + }, { + "r" : "2300", + "s" : [ { + "value" : [ "DateTime" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] }, { "value" : [ " }" ] @@ -238218,16 +237915,16 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2303", + "localId" : "2307", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2304", + "localId" : "2308", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2305", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2309", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } @@ -238238,53 +237935,83 @@ module.exports['Collapse'] = { "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2300", + "localId" : "2304", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2301", + "localId" : "2305", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2302", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2306", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } } }, "element" : [ { "type" : "Interval", - "localId" : "2297", + "localId" : "2301", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2298", + "localId" : "2302", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2299", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2303", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", "annotation" : [ ] } }, "low" : { - "type" : "Null", + "type" : "As", "localId" : "2295", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "2296", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "2297", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] + } }, "high" : { - "type" : "Null", - "localId" : "2296", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "type" : "As", + "localId" : "2298", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "2299", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "2300", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime", + "name" : "{urn:hl7-org:elm-types:r1}DateTime", + "annotation" : [ ] + } } } ] } }, { - "localId" : "2308", + "localId" : "2312", "name" : "QuantityMeterNullLowIntervalList", "context" : "Patient", "accessLevel" : "Public", @@ -238292,24 +238019,24 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2308", + "r" : "2312", "s" : [ { "value" : [ "", "define ", "QuantityMeterNullLowIntervalList", ": " ] }, { - "r" : "2309", + "r" : "2313", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2318", + "r" : "2322", "s" : [ { - "r" : "2310", + "r" : "2314", "value" : [ "Interval[", "null", ", " ] }, { - "r" : "2316", + "r" : "2320", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2311", + "r" : "2315", "s" : [ { "value" : [ "'1.995 \\'m\\''" ] } ] @@ -238322,15 +238049,15 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2336", + "r" : "2340", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2327", + "r" : "2331", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2322", + "r" : "2326", "s" : [ { "value" : [ "'2 \\'m\\''" ] } ] @@ -238340,11 +238067,11 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2334", + "r" : "2338", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2329", + "r" : "2333", "s" : [ { "value" : [ "'3 \\'m\\''" ] } ] @@ -238362,15 +238089,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2342", + "localId" : "2346", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2343", + "localId" : "2347", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2344", + "localId" : "2348", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238378,19 +238105,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2309", + "localId" : "2313", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2339", + "localId" : "2343", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2340", + "localId" : "2344", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2341", + "localId" : "2345", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238398,48 +238125,48 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2318", + "localId" : "2322", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2320", + "localId" : "2324", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2321", + "localId" : "2325", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "As", - "localId" : "2319", + "localId" : "2323", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2310", + "localId" : "2314", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, "high" : { "type" : "ToQuantity", - "localId" : "2316", + "localId" : "2320", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2317", + "localId" : "2321", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2311", + "localId" : "2315", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1.995 'm'", @@ -238448,35 +238175,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2336", + "localId" : "2340", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2337", + "localId" : "2341", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2338", + "localId" : "2342", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2327", + "localId" : "2331", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2328", + "localId" : "2332", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2322", + "localId" : "2326", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "2 'm'", @@ -238485,18 +238212,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2334", + "localId" : "2338", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2335", + "localId" : "2339", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2329", + "localId" : "2333", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "3 'm'", @@ -238506,7 +238233,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2347", + "localId" : "2351", "name" : "CollapseQuantityNullLowUnitsWithinPer", "context" : "Patient", "accessLevel" : "Public", @@ -238514,26 +238241,26 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2347", + "r" : "2351", "s" : [ { "value" : [ "", "define ", "CollapseQuantityNullLowUnitsWithinPer", ": " ] }, { - "r" : "2360", + "r" : "2364", "s" : [ { "value" : [ "collapse " ] }, { - "r" : "2348", + "r" : "2352", "s" : [ { "value" : [ "QuantityMeterNullLowIntervalList" ] } ] }, { "value" : [ " per " ] }, { - "r" : "2358", + "r" : "2362", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2353", + "r" : "2357", "s" : [ { "value" : [ "'1 \\'cm\\''" ] } ] @@ -238546,15 +238273,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2368", + "localId" : "2372", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2369", + "localId" : "2373", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2370", + "localId" : "2374", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238562,19 +238289,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "Collapse", - "localId" : "2360", + "localId" : "2364", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2365", + "localId" : "2369", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2366", + "localId" : "2370", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2367", + "localId" : "2371", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238582,41 +238309,41 @@ module.exports['Collapse'] = { }, "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "2361", + "localId" : "2365", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2362", + "localId" : "2366", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2363", + "localId" : "2367", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, { "type" : "NamedTypeSpecifier", - "localId" : "2364", + "localId" : "2368", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "2348", + "localId" : "2352", "name" : "QuantityMeterNullLowIntervalList", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2349", + "localId" : "2353", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2350", + "localId" : "2354", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2351", + "localId" : "2355", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238624,18 +238351,18 @@ module.exports['Collapse'] = { } }, { "type" : "ToQuantity", - "localId" : "2358", + "localId" : "2362", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2359", + "localId" : "2363", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2353", + "localId" : "2357", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1 'cm'", @@ -238644,7 +238371,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2373", + "localId" : "2377", "name" : "CollapseQuantityNullLowUnitsWithinPerExpected", "context" : "Patient", "accessLevel" : "Public", @@ -238652,24 +238379,24 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2373", + "r" : "2377", "s" : [ { "value" : [ "", "define ", "CollapseQuantityNullLowUnitsWithinPerExpected", " : " ] }, { - "r" : "2374", + "r" : "2378", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2383", + "r" : "2387", "s" : [ { - "r" : "2375", + "r" : "2379", "value" : [ "Interval[", "null", ", " ] }, { - "r" : "2381", + "r" : "2385", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2376", + "r" : "2380", "s" : [ { "value" : [ "'3 \\'m\\''" ] } ] @@ -238687,15 +238414,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2390", + "localId" : "2394", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2391", + "localId" : "2395", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2392", + "localId" : "2396", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238703,19 +238430,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2374", + "localId" : "2378", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2387", + "localId" : "2391", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2388", + "localId" : "2392", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2389", + "localId" : "2393", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238723,48 +238450,48 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2383", + "localId" : "2387", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2385", + "localId" : "2389", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2386", + "localId" : "2390", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "As", - "localId" : "2384", + "localId" : "2388", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2375", + "localId" : "2379", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, "high" : { "type" : "ToQuantity", - "localId" : "2381", + "localId" : "2385", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2382", + "localId" : "2386", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2376", + "localId" : "2380", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "3 'm'", @@ -238774,7 +238501,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2395", + "localId" : "2399", "name" : "QuantityMeterNullHighIntervalList", "context" : "Patient", "accessLevel" : "Public", @@ -238782,23 +238509,23 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2395", + "r" : "2399", "s" : [ { "value" : [ "", "define ", "QuantityMeterNullHighIntervalList", ": " ] }, { - "r" : "2396", + "r" : "2400", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2411", + "r" : "2415", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2402", + "r" : "2406", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2397", + "r" : "2401", "s" : [ { "value" : [ "'1 \\'m\\''" ] } ] @@ -238808,11 +238535,11 @@ module.exports['Collapse'] = { }, { "value" : [ "," ] }, { - "r" : "2409", + "r" : "2413", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2404", + "r" : "2408", "s" : [ { "value" : [ "'1.995 \\'m\\''" ] } ] @@ -238825,15 +238552,15 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2422", + "r" : "2426", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2419", + "r" : "2423", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2414", + "r" : "2418", "s" : [ { "value" : [ "'2 \\'m\\''" ] } ] @@ -238841,7 +238568,7 @@ module.exports['Collapse'] = { "value" : [ ")" ] } ] }, { - "r" : "2421", + "r" : "2425", "value" : [ ", ", "null", "]" ] } ] }, { @@ -238852,15 +238579,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2429", + "localId" : "2433", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2430", + "localId" : "2434", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2431", + "localId" : "2435", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238868,19 +238595,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2396", + "localId" : "2400", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2426", + "localId" : "2430", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2427", + "localId" : "2431", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2428", + "localId" : "2432", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -238888,35 +238615,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2411", + "localId" : "2415", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2412", + "localId" : "2416", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2413", + "localId" : "2417", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2402", + "localId" : "2406", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2403", + "localId" : "2407", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2397", + "localId" : "2401", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1 'm'", @@ -238925,18 +238652,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2409", + "localId" : "2413", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2410", + "localId" : "2414", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2404", + "localId" : "2408", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1.995 'm'", @@ -238945,35 +238672,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2422", + "localId" : "2426", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2424", + "localId" : "2428", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2425", + "localId" : "2429", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2419", + "localId" : "2423", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2420", + "localId" : "2424", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2414", + "localId" : "2418", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "2 'm'", @@ -238982,13 +238709,13 @@ module.exports['Collapse'] = { }, "high" : { "type" : "As", - "localId" : "2423", + "localId" : "2427", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2421", + "localId" : "2425", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } @@ -238996,7 +238723,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2434", + "localId" : "2438", "name" : "CollapseQuantityNullHighUnitsWithinPer", "context" : "Patient", "accessLevel" : "Public", @@ -239004,26 +238731,26 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2434", + "r" : "2438", "s" : [ { "value" : [ "", "define ", "CollapseQuantityNullHighUnitsWithinPer", ": " ] }, { - "r" : "2447", + "r" : "2451", "s" : [ { "value" : [ "collapse " ] }, { - "r" : "2435", + "r" : "2439", "s" : [ { "value" : [ "QuantityMeterNullHighIntervalList" ] } ] }, { "value" : [ " per " ] }, { - "r" : "2445", + "r" : "2449", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2440", + "r" : "2444", "s" : [ { "value" : [ "'1 \\'cm\\''" ] } ] @@ -239036,15 +238763,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2455", + "localId" : "2459", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2456", + "localId" : "2460", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2457", + "localId" : "2461", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239052,19 +238779,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "Collapse", - "localId" : "2447", + "localId" : "2451", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2452", + "localId" : "2456", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2453", + "localId" : "2457", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2454", + "localId" : "2458", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239072,41 +238799,41 @@ module.exports['Collapse'] = { }, "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "2448", + "localId" : "2452", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2449", + "localId" : "2453", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2450", + "localId" : "2454", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, { "type" : "NamedTypeSpecifier", - "localId" : "2451", + "localId" : "2455", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "2435", + "localId" : "2439", "name" : "QuantityMeterNullHighIntervalList", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2436", + "localId" : "2440", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2437", + "localId" : "2441", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2438", + "localId" : "2442", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239114,18 +238841,18 @@ module.exports['Collapse'] = { } }, { "type" : "ToQuantity", - "localId" : "2445", + "localId" : "2449", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2446", + "localId" : "2450", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2440", + "localId" : "2444", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1 'cm'", @@ -239134,7 +238861,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2460", + "localId" : "2464", "name" : "CollapseQuantityNullHighUnitsWithinPerExpected", "context" : "Patient", "accessLevel" : "Public", @@ -239142,23 +238869,23 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2460", + "r" : "2464", "s" : [ { "value" : [ "", "define ", "CollapseQuantityNullHighUnitsWithinPerExpected", " : " ] }, { - "r" : "2461", + "r" : "2465", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2470", + "r" : "2474", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2467", + "r" : "2471", "s" : [ { "value" : [ "ToQuantity", "(" ] }, { - "r" : "2462", + "r" : "2466", "s" : [ { "value" : [ "'1 \\'m\\''" ] } ] @@ -239166,7 +238893,7 @@ module.exports['Collapse'] = { "value" : [ ")" ] } ] }, { - "r" : "2469", + "r" : "2473", "value" : [ ", ", "null", "]" ] } ] }, { @@ -239177,15 +238904,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2477", + "localId" : "2481", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2478", + "localId" : "2482", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2479", + "localId" : "2483", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239193,19 +238920,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2461", + "localId" : "2465", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2474", + "localId" : "2478", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2475", + "localId" : "2479", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2476", + "localId" : "2480", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239213,35 +238940,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2470", + "localId" : "2474", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2472", + "localId" : "2476", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2473", + "localId" : "2477", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2467", + "localId" : "2471", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2468", + "localId" : "2472", "name" : "{urn:hl7-org:elm-types:r1}String", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2462", + "localId" : "2466", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "1 'm'", @@ -239250,13 +238977,13 @@ module.exports['Collapse'] = { }, "high" : { "type" : "As", - "localId" : "2471", + "localId" : "2475", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2469", + "localId" : "2473", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } @@ -239264,7 +238991,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2482", + "localId" : "2486", "name" : "QuantityIntervalListWithNulls", "context" : "Patient", "accessLevel" : "Public", @@ -239272,29 +238999,29 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2482", + "r" : "2486", "s" : [ { "value" : [ "", "define ", "QuantityIntervalListWithNulls", ": " ] }, { - "r" : "2483", + "r" : "2487", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2496", + "r" : "2500", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2488", + "r" : "2492", "s" : [ { - "r" : "2484", + "r" : "2488", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2494", + "r" : "2498", "s" : [ { - "r" : "2490", + "r" : "2494", "value" : [ "ToQuantity", "(", "8", ")" ] } ] }, { @@ -239303,14 +239030,14 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2506", + "r" : "2510", "s" : [ { - "r" : "2499", + "r" : "2503", "value" : [ "Interval[", "null", ", " ] }, { - "r" : "2504", + "r" : "2508", "s" : [ { - "r" : "2500", + "r" : "2504", "value" : [ "ToQuantity", "(", "2", ")" ] } ] }, { @@ -239319,21 +239046,21 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2522", + "r" : "2526", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2514", + "r" : "2518", "s" : [ { - "r" : "2510", + "r" : "2514", "value" : [ "ToQuantity", "(", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2520", + "r" : "2524", "s" : [ { - "r" : "2516", + "r" : "2520", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { @@ -239342,17 +239069,17 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2532", + "r" : "2536", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2529", + "r" : "2533", "s" : [ { - "r" : "2525", + "r" : "2529", "value" : [ "ToQuantity", "(", "7", ")" ] } ] }, { - "r" : "2531", + "r" : "2535", "value" : [ ", ", "null", "]" ] } ] }, { @@ -239363,15 +239090,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2539", + "localId" : "2543", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2540", + "localId" : "2544", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2541", + "localId" : "2545", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239379,19 +239106,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2483", + "localId" : "2487", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2536", + "localId" : "2540", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2537", + "localId" : "2541", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2538", + "localId" : "2542", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239399,35 +239126,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2496", + "localId" : "2500", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2497", + "localId" : "2501", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2498", + "localId" : "2502", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2488", + "localId" : "2492", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2489", + "localId" : "2493", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2484", + "localId" : "2488", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -239436,18 +239163,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2494", + "localId" : "2498", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2495", + "localId" : "2499", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2490", + "localId" : "2494", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "8", @@ -239456,48 +239183,48 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2506", + "localId" : "2510", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2508", + "localId" : "2512", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2509", + "localId" : "2513", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "As", - "localId" : "2507", + "localId" : "2511", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2499", + "localId" : "2503", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, "high" : { "type" : "ToQuantity", - "localId" : "2504", + "localId" : "2508", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2505", + "localId" : "2509", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2500", + "localId" : "2504", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -239506,35 +239233,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2522", + "localId" : "2526", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2523", + "localId" : "2527", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2524", + "localId" : "2528", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2514", + "localId" : "2518", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2515", + "localId" : "2519", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2510", + "localId" : "2514", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -239543,18 +239270,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2520", + "localId" : "2524", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2521", + "localId" : "2525", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2516", + "localId" : "2520", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -239563,35 +239290,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2532", + "localId" : "2536", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2534", + "localId" : "2538", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2535", + "localId" : "2539", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2529", + "localId" : "2533", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2530", + "localId" : "2534", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2525", + "localId" : "2529", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "7", @@ -239600,13 +239327,13 @@ module.exports['Collapse'] = { }, "high" : { "type" : "As", - "localId" : "2533", + "localId" : "2537", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2531", + "localId" : "2535", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } @@ -239614,7 +239341,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2544", + "localId" : "2548", "name" : "CollapseQuantityIntervalListWithNulls", "context" : "Patient", "accessLevel" : "Public", @@ -239622,15 +239349,15 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2544", + "r" : "2548", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNulls", ": " ] }, { - "r" : "2550", + "r" : "2554", "s" : [ { "value" : [ "collapse " ] }, { - "r" : "2545", + "r" : "2549", "s" : [ { "value" : [ "QuantityIntervalListWithNulls" ] } ] @@ -239640,15 +239367,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2558", + "localId" : "2562", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2559", + "localId" : "2563", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2560", + "localId" : "2564", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239656,19 +239383,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "Collapse", - "localId" : "2550", + "localId" : "2554", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2555", + "localId" : "2559", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2556", + "localId" : "2560", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2557", + "localId" : "2561", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239676,41 +239403,41 @@ module.exports['Collapse'] = { }, "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "2551", + "localId" : "2555", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2552", + "localId" : "2556", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2553", + "localId" : "2557", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, { "type" : "NamedTypeSpecifier", - "localId" : "2554", + "localId" : "2558", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "2545", + "localId" : "2549", "name" : "QuantityIntervalListWithNulls", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2546", + "localId" : "2550", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2547", + "localId" : "2551", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2548", + "localId" : "2552", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239718,13 +239445,13 @@ module.exports['Collapse'] = { } }, { "type" : "Null", - "localId" : "2549", + "localId" : "2553", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ] } }, { - "localId" : "2563", + "localId" : "2567", "name" : "CollapseQuantityIntervalListWithNullsExpected", "context" : "Patient", "accessLevel" : "Public", @@ -239732,18 +239459,43 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2563", + "r" : "2567", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNullsExpected", ": " ] }, { - "r" : "2564", + "r" : "2568", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2567", + "r" : "2575", "s" : [ { - "r" : "2565", - "value" : [ "Interval[", "null", ", ", "null", "]" ] + "value" : [ "Interval[" ] + }, { + "r" : "2569", + "s" : [ { + "r" : "2570", + "value" : [ "null", " as " ] + }, { + "r" : "2571", + "s" : [ { + "value" : [ "Quantity" ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "2572", + "s" : [ { + "r" : "2573", + "value" : [ "null", " as " ] + }, { + "r" : "2574", + "s" : [ { + "value" : [ "Quantity" ] + } ] + } ] + }, { + "value" : [ "]" ] } ] }, { "value" : [ " }" ] @@ -239753,73 +239505,103 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2573", + "localId" : "2581", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2574", + "localId" : "2582", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2575", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2583", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, "expression" : { "type" : "List", - "localId" : "2564", + "localId" : "2568", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2570", + "localId" : "2578", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2571", + "localId" : "2579", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2572", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2580", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, "element" : [ { "type" : "Interval", - "localId" : "2567", + "localId" : "2575", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2568", + "localId" : "2576", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2569", - "name" : "{urn:hl7-org:elm-types:r1}Any", + "localId" : "2577", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { - "type" : "Null", - "localId" : "2565", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "type" : "As", + "localId" : "2569", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "2570", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "2571", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } }, "high" : { - "type" : "Null", - "localId" : "2566", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", - "annotation" : [ ] + "type" : "As", + "localId" : "2572", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "2573", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "2574", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } } } ] } }, { - "localId" : "2578", + "localId" : "2586", "name" : "QuantityIntervalListWithNullLowNoOverlap", "context" : "Patient", "accessLevel" : "Public", @@ -239827,29 +239609,29 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2578", + "r" : "2586", "s" : [ { "value" : [ "", "define ", "QuantityIntervalListWithNullLowNoOverlap", ": " ] }, { - "r" : "2579", + "r" : "2587", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2592", + "r" : "2600", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2584", + "r" : "2592", "s" : [ { - "r" : "2580", + "r" : "2588", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2590", + "r" : "2598", "s" : [ { - "r" : "2586", + "r" : "2594", "value" : [ "ToQuantity", "(", "8", ")" ] } ] }, { @@ -239858,14 +239640,14 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2602", + "r" : "2610", "s" : [ { - "r" : "2595", + "r" : "2603", "value" : [ "Interval[", "null", ", " ] }, { - "r" : "2600", + "r" : "2608", "s" : [ { - "r" : "2596", + "r" : "2604", "value" : [ "ToQuantity", "(", "2", ")" ] } ] }, { @@ -239879,15 +239661,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2609", + "localId" : "2617", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2610", + "localId" : "2618", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2611", + "localId" : "2619", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239895,19 +239677,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2579", + "localId" : "2587", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2606", + "localId" : "2614", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2607", + "localId" : "2615", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2608", + "localId" : "2616", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -239915,35 +239697,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2592", + "localId" : "2600", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2593", + "localId" : "2601", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2594", + "localId" : "2602", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2584", + "localId" : "2592", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2585", + "localId" : "2593", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2580", + "localId" : "2588", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -239952,18 +239734,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2590", + "localId" : "2598", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2591", + "localId" : "2599", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2586", + "localId" : "2594", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "8", @@ -239972,48 +239754,48 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2602", + "localId" : "2610", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2604", + "localId" : "2612", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2605", + "localId" : "2613", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "As", - "localId" : "2603", + "localId" : "2611", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2595", + "localId" : "2603", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, "high" : { "type" : "ToQuantity", - "localId" : "2600", + "localId" : "2608", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2601", + "localId" : "2609", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2596", + "localId" : "2604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -240023,7 +239805,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2614", + "localId" : "2622", "name" : "CollapseQuantityIntervalListWithNullLowNoOverlap", "context" : "Patient", "accessLevel" : "Public", @@ -240031,15 +239813,15 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2614", + "r" : "2622", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNullLowNoOverlap", ": " ] }, { - "r" : "2620", + "r" : "2628", "s" : [ { "value" : [ "collapse " ] }, { - "r" : "2615", + "r" : "2623", "s" : [ { "value" : [ "QuantityIntervalListWithNullLowNoOverlap" ] } ] @@ -240049,15 +239831,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2628", + "localId" : "2636", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2629", + "localId" : "2637", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2630", + "localId" : "2638", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240065,19 +239847,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "Collapse", - "localId" : "2620", + "localId" : "2628", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2625", + "localId" : "2633", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2626", + "localId" : "2634", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2627", + "localId" : "2635", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240085,41 +239867,41 @@ module.exports['Collapse'] = { }, "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "2621", + "localId" : "2629", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2622", + "localId" : "2630", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2623", + "localId" : "2631", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, { "type" : "NamedTypeSpecifier", - "localId" : "2624", + "localId" : "2632", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "2615", + "localId" : "2623", "name" : "QuantityIntervalListWithNullLowNoOverlap", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2616", + "localId" : "2624", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2617", + "localId" : "2625", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2618", + "localId" : "2626", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240127,13 +239909,13 @@ module.exports['Collapse'] = { } }, { "type" : "Null", - "localId" : "2619", + "localId" : "2627", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ] } }, { - "localId" : "2633", + "localId" : "2641", "name" : "CollapseQuantityIntervalListWithNullLowNoOverlapExpected", "context" : "Patient", "accessLevel" : "Public", @@ -240141,22 +239923,22 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2633", + "r" : "2641", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNullLowNoOverlapExpected", ": " ] }, { - "r" : "2634", + "r" : "2642", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2642", + "r" : "2650", "s" : [ { - "r" : "2635", + "r" : "2643", "value" : [ "Interval[", "null", ", " ] }, { - "r" : "2640", + "r" : "2648", "s" : [ { - "r" : "2636", + "r" : "2644", "value" : [ "ToQuantity", "(", "2", ")" ] } ] }, { @@ -240165,21 +239947,21 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2658", + "r" : "2666", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2650", + "r" : "2658", "s" : [ { - "r" : "2646", + "r" : "2654", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2656", + "r" : "2664", "s" : [ { - "r" : "2652", + "r" : "2660", "value" : [ "ToQuantity", "(", "8", ")" ] } ] }, { @@ -240193,15 +239975,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2664", + "localId" : "2672", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2665", + "localId" : "2673", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2666", + "localId" : "2674", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240209,19 +239991,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2634", + "localId" : "2642", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2661", + "localId" : "2669", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2662", + "localId" : "2670", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2663", + "localId" : "2671", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240229,48 +240011,48 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2642", + "localId" : "2650", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2644", + "localId" : "2652", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2645", + "localId" : "2653", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "As", - "localId" : "2643", + "localId" : "2651", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2635", + "localId" : "2643", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, "high" : { "type" : "ToQuantity", - "localId" : "2640", + "localId" : "2648", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2641", + "localId" : "2649", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2636", + "localId" : "2644", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -240279,35 +240061,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2658", + "localId" : "2666", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2659", + "localId" : "2667", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2660", + "localId" : "2668", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2650", + "localId" : "2658", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2651", + "localId" : "2659", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2646", + "localId" : "2654", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -240316,18 +240098,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2656", + "localId" : "2664", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2657", + "localId" : "2665", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2652", + "localId" : "2660", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "8", @@ -240337,7 +240119,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2669", + "localId" : "2677", "name" : "QuantityIntervalListWithNullHighNoOverlap", "context" : "Patient", "accessLevel" : "Public", @@ -240345,45 +240127,45 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2669", + "r" : "2677", "s" : [ { "value" : [ "", "define ", "QuantityIntervalListWithNullHighNoOverlap", ": " ] }, { - "r" : "2670", + "r" : "2678", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2678", + "r" : "2686", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2675", + "r" : "2683", "s" : [ { - "r" : "2671", + "r" : "2679", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { - "r" : "2677", + "r" : "2685", "value" : [ ", ", "null", "]" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2694", + "r" : "2702", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2686", + "r" : "2694", "s" : [ { - "r" : "2682", + "r" : "2690", "value" : [ "ToQuantity", "(", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2692", + "r" : "2700", "s" : [ { - "r" : "2688", + "r" : "2696", "value" : [ "ToQuantity", "(", "2", ")" ] } ] }, { @@ -240397,15 +240179,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2700", + "localId" : "2708", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2701", + "localId" : "2709", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2702", + "localId" : "2710", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240413,19 +240195,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2670", + "localId" : "2678", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2697", + "localId" : "2705", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2698", + "localId" : "2706", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2699", + "localId" : "2707", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240433,35 +240215,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2678", + "localId" : "2686", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2680", + "localId" : "2688", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2681", + "localId" : "2689", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2675", + "localId" : "2683", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2676", + "localId" : "2684", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2671", + "localId" : "2679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -240470,48 +240252,48 @@ module.exports['Collapse'] = { }, "high" : { "type" : "As", - "localId" : "2679", + "localId" : "2687", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2677", + "localId" : "2685", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } } }, { "type" : "Interval", - "localId" : "2694", + "localId" : "2702", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2695", + "localId" : "2703", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2696", + "localId" : "2704", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2686", + "localId" : "2694", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2687", + "localId" : "2695", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2682", + "localId" : "2690", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -240520,18 +240302,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2692", + "localId" : "2700", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2693", + "localId" : "2701", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2688", + "localId" : "2696", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -240541,7 +240323,7 @@ module.exports['Collapse'] = { } ] } }, { - "localId" : "2705", + "localId" : "2713", "name" : "CollapseQuantityIntervalListWithNullHighNoOverlap", "context" : "Patient", "accessLevel" : "Public", @@ -240549,15 +240331,15 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2705", + "r" : "2713", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNullHighNoOverlap", ": " ] }, { - "r" : "2711", + "r" : "2719", "s" : [ { "value" : [ "collapse " ] }, { - "r" : "2706", + "r" : "2714", "s" : [ { "value" : [ "QuantityIntervalListWithNullHighNoOverlap" ] } ] @@ -240567,15 +240349,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2719", + "localId" : "2727", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2720", + "localId" : "2728", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2721", + "localId" : "2729", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240583,19 +240365,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "Collapse", - "localId" : "2711", + "localId" : "2719", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2716", + "localId" : "2724", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2717", + "localId" : "2725", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2718", + "localId" : "2726", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240603,41 +240385,41 @@ module.exports['Collapse'] = { }, "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "2712", + "localId" : "2720", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2713", + "localId" : "2721", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2714", + "localId" : "2722", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } }, { "type" : "NamedTypeSpecifier", - "localId" : "2715", + "localId" : "2723", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ], "operand" : [ { "type" : "ExpressionRef", - "localId" : "2706", + "localId" : "2714", "name" : "QuantityIntervalListWithNullHighNoOverlap", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2707", + "localId" : "2715", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2708", + "localId" : "2716", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2709", + "localId" : "2717", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240645,13 +240427,13 @@ module.exports['Collapse'] = { } }, { "type" : "Null", - "localId" : "2710", + "localId" : "2718", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } ] } }, { - "localId" : "2724", + "localId" : "2732", "name" : "CollapseQuantityIntervalListWithNullHighNoOverlapExpected", "context" : "Patient", "accessLevel" : "Public", @@ -240659,29 +240441,29 @@ module.exports['Collapse'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "2724", + "r" : "2732", "s" : [ { "value" : [ "", "define ", "CollapseQuantityIntervalListWithNullHighNoOverlapExpected", ": " ] }, { - "r" : "2725", + "r" : "2733", "s" : [ { "value" : [ "{ " ] }, { - "r" : "2738", + "r" : "2746", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2730", + "r" : "2738", "s" : [ { - "r" : "2726", + "r" : "2734", "value" : [ "ToQuantity", "(", "1", ")" ] } ] }, { "value" : [ ", " ] }, { - "r" : "2736", + "r" : "2744", "s" : [ { - "r" : "2732", + "r" : "2740", "value" : [ "ToQuantity", "(", "2", ")" ] } ] }, { @@ -240690,17 +240472,17 @@ module.exports['Collapse'] = { }, { "value" : [ ", " ] }, { - "r" : "2748", + "r" : "2756", "s" : [ { "value" : [ "Interval[" ] }, { - "r" : "2745", + "r" : "2753", "s" : [ { - "r" : "2741", + "r" : "2749", "value" : [ "ToQuantity", "(", "4", ")" ] } ] }, { - "r" : "2747", + "r" : "2755", "value" : [ ", ", "null", "]" ] } ] }, { @@ -240711,15 +240493,15 @@ module.exports['Collapse'] = { } ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2755", + "localId" : "2763", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2756", + "localId" : "2764", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2757", + "localId" : "2765", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240727,19 +240509,19 @@ module.exports['Collapse'] = { }, "expression" : { "type" : "List", - "localId" : "2725", + "localId" : "2733", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "2752", + "localId" : "2760", "annotation" : [ ], "elementType" : { "type" : "IntervalTypeSpecifier", - "localId" : "2753", + "localId" : "2761", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2754", + "localId" : "2762", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -240747,35 +240529,35 @@ module.exports['Collapse'] = { }, "element" : [ { "type" : "Interval", - "localId" : "2738", + "localId" : "2746", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2739", + "localId" : "2747", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2740", + "localId" : "2748", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2730", + "localId" : "2738", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2731", + "localId" : "2739", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2726", + "localId" : "2734", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -240784,18 +240566,18 @@ module.exports['Collapse'] = { }, "high" : { "type" : "ToQuantity", - "localId" : "2736", + "localId" : "2744", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2737", + "localId" : "2745", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2732", + "localId" : "2740", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -240804,35 +240586,35 @@ module.exports['Collapse'] = { } }, { "type" : "Interval", - "localId" : "2748", + "localId" : "2756", "lowClosed" : true, "highClosed" : true, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "IntervalTypeSpecifier", - "localId" : "2750", + "localId" : "2758", "annotation" : [ ], "pointType" : { "type" : "NamedTypeSpecifier", - "localId" : "2751", + "localId" : "2759", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "low" : { "type" : "ToQuantity", - "localId" : "2745", + "localId" : "2753", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "2746", + "localId" : "2754", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "2741", + "localId" : "2749", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", @@ -240841,13 +240623,13 @@ module.exports['Collapse'] = { }, "high" : { "type" : "As", - "localId" : "2749", + "localId" : "2757", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "2747", + "localId" : "2755", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 47ee113c..3f4427f8 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -3,6 +3,7 @@ import setup from '../../setup'; const data = require('./data'); import { Interval } from '../../../src/datatypes/interval'; import { DateTime } from '../../../src/datatypes/datetime'; +import { Uncertainty } from '../../../src/datatypes/uncertainty'; import { MIN_INT_VALUE, MAX_INT_VALUE, @@ -249,12 +250,12 @@ describe('Contains', () => { it('should correctly compare using the requested precision', async function () { (await this.containsDayOfDateLowEdge.exec(this.ctx)).should.be.true(); - (await this.notContainsDayOfDateHighEdgeOpen.exec(this.ctx)).should.be.false(); + (await this.containsDayOfDateHighEdgeOpen.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateHighEdgeClosed.exec(this.ctx)).should.be.true(); (await this.notContainsDayOfDateLowEdge.exec(this.ctx)).should.be.false(); (await this.notContainsDayOfDateBeyondHighEdge.exec(this.ctx)).should.be.false(); (await this.containsDayOfDateImpreciseLowEdge.exec(this.ctx)).should.be.true(); - (await this.notContainsDayOfDateImpreciseHighEdgeOpen.exec(this.ctx)).should.be.false(); + (await this.containsDayOfDateImpreciseHighEdgeOpen.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateImpreciseHighEdgeClosed.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateVeryImpreciseMiddle.exec(this.ctx)).should.be.true(); (await this.notContainsDayOfDateVeryImpreciseLow.exec(this.ctx)).should.be.false(); @@ -338,12 +339,12 @@ describe('In', () => { it('should correctly compare using the requested precision', async function () { (await this.containsDayOfDateLowEdge.exec(this.ctx)).should.be.true(); - (await this.notContainsDayOfDateHighEdgeOpen.exec(this.ctx)).should.be.false(); + (await this.containsDayOfDateHighEdgeOpen.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateHighEdgeClosed.exec(this.ctx)).should.be.true(); (await this.notContainsDayOfDateLowEdge.exec(this.ctx)).should.be.false(); (await this.notContainsDayOfDateBeyondHighEdge.exec(this.ctx)).should.be.false(); (await this.containsDayOfDateImpreciseLowEdge.exec(this.ctx)).should.be.true(); - (await this.notContainsDayOfDateImpreciseHighEdgeOpen.exec(this.ctx)).should.be.false(); + (await this.containsDayOfDateImpreciseHighEdgeOpen.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateImpreciseHighEdgeClosed.exec(this.ctx)).should.be.true(); (await this.containsDayOfDateVeryImpreciseMiddle.exec(this.ctx)).should.be.true(); (await this.notContainsDayOfDateVeryImpreciseLow.exec(this.ctx)).should.be.false(); @@ -797,12 +798,12 @@ describe('BeforeOrOn', () => { (await this.beforeNullEndIvl.exec(this.ctx)).should.be.true(); (await this.afterStartNullEndIvl.exec(this.ctx)).should.be.false(); should(await this.nullEndStartBeforeIvl.exec(this.ctx)).be.null(); - should(await this.nullEndStartAfterIvl.exec(this.ctx)).be.null(); + (await this.nullEndStartAfterIvl.exec(this.ctx)).should.be.false(); }); it('should handle intervals with null start', async function () { should(await this.endsBeforeNullStartIvlEnds.exec(this.ctx)).be.null(); - should(await this.afterEndOfNullStartIvl.exec(this.ctx)).be.null(); + (await this.afterEndOfNullStartIvl.exec(this.ctx)).should.be.false(); (await this.nullStartStartBeforeIvl.exec(this.ctx)).should.be.true(); (await this.nullStartStartAfterIvl.exec(this.ctx)).should.be.false(); }); @@ -863,7 +864,7 @@ describe('AfterOrOn', () => { }); it('should handle intervals with null end', async function () { - should(await this.beforeNullEndIvl.exec(this.ctx)).be.null(); + (await this.beforeNullEndIvl.exec(this.ctx)).should.be.false(); should(await this.afterStartNullEndIvl.exec(this.ctx)).be.null(); (await this.nullEndStartBeforeIvl.exec(this.ctx)).should.be.false(); (await this.nullEndStartAfterIvl.exec(this.ctx)).should.be.true(); @@ -872,7 +873,7 @@ describe('AfterOrOn', () => { it('should handle intervals with null start', async function () { (await this.endsBeforeNullStartIvlEnds.exec(this.ctx)).should.be.false(); (await this.afterEndOfNullStartIvl.exec(this.ctx)).should.be.true(); - should(await this.nullStartStartBeforeIvl.exec(this.ctx)).be.null(); + (await this.nullStartStartBeforeIvl.exec(this.ctx)).should.be.false(); should(await this.nullStartStartAfterIvl.exec(this.ctx)).be.null(); }); @@ -1651,8 +1652,10 @@ describe('Start', () => { (await this.openLongNotNull.exec(this.ctx)).should.eql(2n); }); - it('should return null for open interval with null high value', async function () { - should(await this.openNull.exec(this.ctx)).be.null(); + it('should return uncertainty for open interval with null low value', async function () { + (await this.openNull.exec(this.ctx)).should.eql( + new Uncertainty(MIN_DATETIME_VALUE, new DateTime(2012, 12, 31)) + ); }); }); @@ -1699,8 +1702,10 @@ describe('End', () => { (await this.openLongNotNull.exec(this.ctx)).should.eql(2n); }); - it('should return null for open interval with null low value', async function () { - should(await this.openNull.exec(this.ctx)).be.null(); + it('should return uncertainty for open interval with null high value', async function () { + (await this.openNull.exec(this.ctx)).should.eql( + new Uncertainty(new DateTime(2013, 1, 2), MAX_DATETIME_VALUE) + ); }); }); @@ -1709,8 +1714,8 @@ describe('Starts', () => { setup(this, data); }); - it('should calculate to null', async function () { - should(await this.testStartsNull.exec(this.ctx)).be.null(); + it('should calculate to false for boundless interval starts bounded interval', async function () { + should(await this.testStartsNull.exec(this.ctx)).be.false(); }); it('should calculate integer intervals properly', async function () { @@ -1750,8 +1755,8 @@ describe('Ends', () => { setup(this, data); }); - it('should calculate to null', async function () { - should(await this.testEndsNull.exec(this.ctx)).be.null(); + it('should calculate to false for boundless interval ends bounded interval', async function () { + should(await this.testEndsNull.exec(this.ctx)).be.false(); }); it('should calculate integer intervals properly', async function () { diff --git a/test/should-extensions.ts b/test/should-extensions.ts new file mode 100644 index 00000000..92be6486 --- /dev/null +++ b/test/should-extensions.ts @@ -0,0 +1,16 @@ +import should from 'should'; +import { Interval } from '../src/datatypes/interval'; + +declare module 'should' { + interface Assertion { + equalInterval(expected: Interval): this; + } +} + +(should as any).Assertion.add('equalInterval', function (this: any, expected: Interval) { + this.params = { operator: 'to equal interval', expected }; + + should(this.obj?.isInterval).be.ok(); + should(expected?.isInterval).be.ok(); + this.obj.toClosed().should.eql(expected.toClosed()); +}); diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql index 5a9d02bc..55848780 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql @@ -1555,9 +1555,11 @@ define "ProperlyIncludes": Tuple{ define "ProperlyIncludedIn": Tuple{ "IntegerIntervalProperlyIncludedInNullBoundaries": Tuple{ + skipped: 'Wrong output: Interval properly included in Interval[null, null] is indeterminate' + /* expression: Interval[1, 10] properly included in Interval[null, null], output: true - }, + */ }, "IntegerIntervalProperlyIncludedInTrue": Tuple{ expression: Interval[4, 10] properly included in Interval[1, 10], output: true @@ -1625,9 +1627,11 @@ define "Start": Tuple{ define "Starts": Tuple{ "TestStartsNull": Tuple{ + skipped: 'Wrong answer (Interval[null, null] can only start Interval[null, null])' + /* expression: Interval[null, null] starts Interval[1, 10], output: null - }, + */ }, "IntegerIntervalStartsTrue": Tuple{ expression: Interval[4, 10] starts Interval[4, 15], output: true diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.json b/test/spec-tests/cql/CqlIntervalOperatorsTest.json index 1fcc2789..047cab16 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.json +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.json @@ -71474,20 +71474,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -71791,20 +71782,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -72104,20 +72086,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -72125,188 +72098,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "ProperIncludedIn", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - "low": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "high": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Interval", - "annotation": [], - "low": { - "type": "As", - "asType": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Property", - "path": "low", - "annotation": [], - "source": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - "low": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "high": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - } - }, - "lowClosedExpression": { - "type": "Property", - "path": "lowClosed", - "annotation": [], - "source": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - "low": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "high": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - }, - "high": { - "type": "As", - "asType": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Property", - "path": "high", - "annotation": [], - "source": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - "low": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "high": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - } - }, - "highClosedExpression": { - "type": "Property", - "path": "highClosed", - "annotation": [], - "source": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - "low": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "high": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - } - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: Interval properly included in Interval[null, null] is indeterminate", "annotation": [] } } @@ -74698,20 +74495,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -75015,20 +74803,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -75328,20 +75107,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -75349,75 +75119,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Starts", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - "low": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "high": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - }, - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - "low": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "high": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer (Interval[null, null] can only start Interval[null, null])", "annotation": [] } } @@ -79950,11 +79657,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "14851", + "localId": "14800", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "14852", + "localId": "14801", "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index 1eab0378..89281f1f 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -11,6 +11,7 @@ CqlListOperatorsTest.Includes.IncludesNullRight Treats null as point overl # Incorrect Expected Output CqlIntervalOperatorsTest.In.TestInNullBoundaries Wrong output: According to spec, comparison against null closed boundaries should result in true +CqlIntervalOperatorsTest.ProperlyIncludedIn.IntegerIntervalProperlyIncludedInNullBoundaries Wrong output: Interval properly included in Interval[null, null] is indeterminate CqlListOperatorsTest.Equal.EqualNullNull Wrong output: According to spec, if either list contains a null, the result is null CqlListOperatorsTest.Sort.simpleSortAsc Wrong output: Queries return distinct lists by default; need to use "all" to retain duplicates CqlListOperatorsTest.Sort.simpleSortDesc Wrong output: Queries return distinct lists by default; need to use "all" to retain duplicates @@ -42,6 +43,7 @@ CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong answer (In CqlIntervalOperatorsTest.Overlaps.TestOverlapsNull Wrong answer (Interval[null, null] should overlap everything) CqlIntervalOperatorsTest.OverlapsBefore.TestOverlapsBeforeNull Wrong answer (Interval[null, null] should overlap before anything but another interval w/ null low closed boundary) CqlIntervalOperatorsTest.OverlapsAfter.TestOverlapsAfterNull Wrong answer (Interval[null, null] should overlap after anything but another interval w/ null high closed boundary) +CqlIntervalOperatorsTest.Starts.TestStartsNull Wrong answer (Interval[null, null] can only start Interval[null, null]) CqlIntervalOperatorsTest.Union.TestUnionNull Wrong answer (Interval[null, null] union any valid interval of the same point type is Interval[null, null]) CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime1 Wrong answer (different offsets) diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index e1e2e01a..210381c4 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -52,42 +52,59 @@ describe('CQL Spec Tests (from XML)', () => { const ctx = new PatientContext(library); ctx.getExecutionDateTime().timezoneOffset = 0; const actualExp = build(testCaseMap.get('expression')) as any; - let actual = await actualExp.execute(ctx); + const actual = await actualExp.execute(ctx); const expectedExp = build(testCaseMap.get('output')) as any; - let expected = await expectedExp.execute(ctx); - if (expectedExp.json && expectedExp.json.type === 'Null') { - should(actual).be.null(); - } else if (actual && actual.isInterval && expected && expected.isInterval) { - // Since intervals can be semantically equal w/ different representations, fall back on Interval.equal function. - // E.g., Interval[1,3] == Interval[1,4) - if (!actual.equals(expected)) { - should.fail(actual, expected, 'Intervals are not equal'); + const expected = await expectedExp.execute(ctx); + assertEqual(actual, expected, expectedExp); + } + }); + + function assertEqual(actual: any, expected: any, expectedExp?: any) { + if (expectedExp?.json?.type === 'Null') { + should(actual).be.null(); + } else if (actual && actual.isInterval && expected && expected.isInterval) { + // Since intervals can be semantically equal w/ different representations, fall back on Interval.equal function. + // E.g., Interval[1,3] == Interval[1,4) + if (!actual.equals(expected)) { + should.fail(actual, expected, 'Intervals are not equal'); + } + } else if ( + actual && + actual.isUncertainty && + expected && + expected.isInterval && + expected.highClosed && + expected.lowClosed + ) { + // Since there is no literal representation of Uncertainty, the test framework used Interval. + // Switch it back to an uncertainty. + expected = new Uncertainty(expected.low, expected.high); + actual.should.eql(expected); + } else if ( + Array.isArray(actual) && + Array.isArray(expected) && + actual.length === expected.length + ) { + try { + for (let i = 0; i++; i < actual.length) { + assertEqual(actual[i], expected[i]); } - } else if ( - actual && - actual.isUncertainty && - expected && - expected.isInterval && - expected.highClosed && - expected.lowClosed - ) { - // Since there is no literal representation of Uncertainty, the test framework used Interval. - // Switch it back to an uncertainty. - expected = new Uncertainty(expected.low, expected.high); - actual.should.eql(expected); + } catch { + should.fail(actual, expected, 'Lists are not equal'); + } + } else { + // The tests are somewhat inconsistent w/ number of decimal places used. + // To get consistency (and avoid false negatives), always round to 8 places. + actual = roundDecimalsWhenApplicable(actual); + expected = roundDecimalsWhenApplicable(expected); + if (actual == null) { + should.deepEqual(actual, expected); } else { - // The tests are somewhat inconsistent w/ number of decimal places used. - // To get consistency (and avoid false negatives), always round to 8 places. - actual = roundDecimalsWhenApplicable(actual); - expected = roundDecimalsWhenApplicable(expected); - if (actual == null) { - should.deepEqual(actual, expected); - } else { - actual.should.eql(expected); - } + actual.should.eql(expected); } } - }); + return { actual, expected }; + } }); }); });