From 4916f2b90778acece59cf9f0420ceea934736541 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 12 Aug 2026 14:43:15 -0400 Subject: [PATCH 01/62] WIP of improved CQL Decimal --- src/datatypes/datatypes.ts | 1 + src/datatypes/decimal.ts | 216 ++++++++++++++++++++++++ src/datatypes/interval.ts | 16 +- src/datatypes/quantity.ts | 41 +++-- src/datatypes/uncertainty.ts | 2 + src/elm/aggregate.ts | 95 ++++++++--- src/elm/arithmetic.ts | 148 +++++++++++++---- src/elm/interval.ts | 218 ++++++++++++++----------- src/elm/literal.ts | 3 +- src/elm/quantity.ts | 4 +- src/elm/type.ts | 38 +++-- src/runtime/context.ts | 8 +- src/util/comparison.ts | 14 +- src/util/math.ts | 100 ++++++------ src/util/units.ts | 11 +- test/datatypes/decimal-test.ts | 41 +++++ test/datatypes/interval-data.ts | 3 +- test/datatypes/interval-test.ts | 79 ++++----- test/elm/aggregate/aggregate-test.ts | 49 +++--- test/elm/arithmetic/arithmetic-test.ts | 123 +++++++------- test/elm/convert/convert-test.ts | 35 ++-- test/elm/datetime/datetime-test.ts | 7 +- test/elm/instance/instance-test.ts | 6 +- test/elm/interval/interval-test.ts | 25 +-- test/elm/literal/literal-test.ts | 7 +- test/elm/message/message-test.ts | 5 +- test/elm/parameters/parameters-test.ts | 15 +- test/elm/quantity/quantity-test.ts | 3 +- test/elm/query/query-test.ts | 5 +- test/spec-tests/spec-test.ts | 3 + test/util/math-test.ts | 21 +-- test/util/units-test.ts | 31 ++-- 32 files changed, 926 insertions(+), 447 deletions(-) create mode 100644 src/datatypes/decimal.ts create mode 100644 test/datatypes/decimal-test.ts diff --git a/src/datatypes/datatypes.ts b/src/datatypes/datatypes.ts index ec689cc88..e36a6000c 100644 --- a/src/datatypes/datatypes.ts +++ b/src/datatypes/datatypes.ts @@ -1,4 +1,5 @@ export * from './bigint'; +export * from './decimal'; export * from './logic'; export * from './clinical'; export * from './uncertainty'; diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts new file mode 100644 index 000000000..815b9fb5a --- /dev/null +++ b/src/datatypes/decimal.ts @@ -0,0 +1,216 @@ + + +export type DecimalInput = Decimal | string | number | bigint; + +export type DecimalRoundingMode = 'down' | 'half-up' | 'half-even' | 'half-ceil' | 'ceil' | 'floor'; + +const MIN_FLOAT_PRECISION_VALUE = Math.pow(10, -8); + +export class Decimal { + public readonly value: number; + + private constructor(value: DecimalInput) { + const numericValue = toNumber(value); + if (!Number.isFinite(numericValue)) { + throw new Error('Cannot create a decimal with a non-finite value'); + } + this.value = numericValue; + } + + static from(value: DecimalInput) { + return value instanceof Decimal ? value : new Decimal(value); + } + + get isDecimal() { + return true; + } + + add(other: DecimalInput) { + return new Decimal(this.value + toNumber(other)); + } + + subtract(other: DecimalInput) { + return new Decimal(this.value - toNumber(other)); + } + + multiplyBy(other: DecimalInput) { + return new Decimal(this.value * toNumber(other)); + } + + divideBy(other: DecimalInput) { + const divisor = toNumber(other); + if (divisor === 0) { + throw new RangeError('Cannot divide a decimal by zero'); + } + return new Decimal(this.value / divisor); + } + + modulo(other: DecimalInput) { + const divisor = toNumber(other); + if (divisor === 0) { + throw new RangeError('Cannot calculate decimal modulo by zero'); + } + return new Decimal(this.value % divisor); + } + + compareTo(other: DecimalInput) { + const otherValue = toNumber(other); + return this.value - otherValue; + } + + greaterThan(other: DecimalInput) { + return this.compareTo(other) > 0; + } + + greaterThanOrEquals(other: DecimalInput) { + return this.compareTo(other) >= 0; + } + + lessThan(other: DecimalInput) { + return this.compareTo(other) < 0; + } + + lessThanOrEquals(other: DecimalInput) { + return this.compareTo(other) <= 0; + } + + equals(other: DecimalInput) { + return this.compareTo(other) === 0; + } + + successor() { + return new Decimal(this.value + MIN_FLOAT_PRECISION_VALUE); + } + + predecessor() { + return new Decimal(this.value - MIN_FLOAT_PRECISION_VALUE); + } + + negate() { + return new Decimal(-this.value); + } + + abs() { + return new Decimal(Math.abs(this.value)); + } + + truncate() { + return Math.trunc(this.value); + } + + ceil() { + return Math.ceil(this.value); + } + + floor() { + return Math.floor(this.value); + } + + isInteger() { + return Number.isInteger(this.value); + } + + round(scale = 0) { + return this.setScale(scale, 'half-ceil'); + } + + power(exponent: DecimalInput) { + return new Decimal(Math.pow(this.value, toNumber(exponent))); + } + + sqrt() { + return new Decimal(Math.sqrt(this.value)); + } + + ln() { + return new Decimal(Math.log(this.value)); + } + + exp() { + return new Decimal(Math.exp(this.value)); + } + + log(base: DecimalInput) { + return this.ln().divideBy(Decimal.from(base).ln()); + } + + /** + * Return a value at the requested number of digits after the decimal point. + * `down` truncates toward zero, matching the current ToDecimal behavior. + */ + setScale(scale: number, roundingMode: DecimalRoundingMode = 'down') { + if (!Number.isInteger(scale) || scale < 0) { + throw new RangeError('Decimal scale must be a non-negative integer'); + } + + const factor = Math.pow(10, scale); + return new Decimal(round(this.value * factor, roundingMode) / factor); + } + + toInteger() { + return this.truncate(); + } + + toNumber() { + return this.value; + } + + toLong() { + // TODO: this is wrong + return BigInt(this.toNumber()); + } + + toString() { + return this.value.toString(); + } + + toJSON() { + return this.toString(); + } +} + +export const MAX_DECIMAL_STRING = "99999999999999999999.99999999"; +export const MIN_DECIMAL_STRING = "-99999999999999999999.99999999"; + +export const MAX_DECIMAL_VALUE = Decimal.from(MAX_DECIMAL_STRING); +export const MIN_DECIMAL_VALUE = Decimal.from(MIN_DECIMAL_STRING); + +function toNumber(value: DecimalInput) { + if (value instanceof Decimal) { + return value.value; + } + if (typeof value === 'string' && value.trim() === '') { + // Number() and Number('') return 0 instead of NaN, so catch that case + return NaN; + } + return Number(value); +} + +function round(value: number, mode: DecimalRoundingMode) { + switch (mode) { + case 'down': + return Math.trunc(value); + case 'half-up': + return value < 0 ? -Math.round(-value) : Math.round(value); + case 'half-even': + return roundHalfEven(value); + case 'half-ceil': + return Math.round(value); + case 'ceil': + return Math.ceil(value); + case 'floor': + return Math.floor(value); + } +} + +function roundHalfEven(value: number) { + const lower = Math.floor(value); + const fraction = value - lower; + if (fraction < 0.5) { + return lower; + } + if (fraction > 0.5) { + return lower + 1; + } + return lower % 2 === 0 ? lower : lower + 1; +} diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index c4e3fa45f..064e3460f 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -22,6 +22,7 @@ import { } from '../util/elmTypes'; import { MIN_FLOAT_VALUE } from '../util/limits'; import { Quantity } from './quantity'; +import { Decimal, MIN_DECIMAL_VALUE } from './decimal'; export class Interval { constructor( @@ -40,9 +41,11 @@ export class Interval { } if (point != null) { if (typeof point === 'number') { - this.pointType = Number.isInteger(point) ? ELM_INTEGER_TYPE : ELM_DECIMAL_TYPE; + this.pointType = ELM_INTEGER_TYPE; } else if (typeof point === 'bigint') { this.pointType = ELM_LONG_TYPE; + } else if (point.isDecimal) { + this.pointType = ELM_DECIMAL_TYPE; } else if (point.isTime && point.isTime()) { this.pointType = ELM_TIME_TYPE; } else if (point.isDate) { @@ -704,10 +707,11 @@ export class Interval { let minValue = minValueForType(this.pointType, getQuantityInstanceForMinMax(this)); // due to floating point issues in JS, we must use 0.0 for Decimal/Quantity instead of min - if (minValue === MIN_FLOAT_VALUE) { - minValue = 0.0; + // TODO: remove this when changing to decimal.js + if (minValue === MIN_DECIMAL_VALUE) { + minValue = Decimal.from(0.0); } else if ((minValue as any)?.isQuantity) { - (minValue as Quantity).value = 0.0; + minValue = new Quantity(0.0, (minValue as Quantity)?.unit); } if (minValue != null) { @@ -776,7 +780,9 @@ export class Interval { toString() { const start = this.lowClosed ? '[' : '('; const end = this.highClosed ? ']' : ')'; - return start + this.low.toString() + ', ' + this.high.toString() + end; + const lowString = this.low == null ? "null" : this.low.toString(); + const highString = this.high == null ? "null" : this.high.toString(); + return start + lowString + ', ' + highString + end; } } diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index b865d2147..ec98aba2b 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -1,5 +1,6 @@ import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; import { decimalAdjust, add, subtract, isValidDecimal, overflowsOrUnderflows } from '../util/math'; +import { Decimal } from './decimal'; import { checkUnit, convertUnit, @@ -9,13 +10,17 @@ import { } from '../util/units'; export class Quantity { + public readonly value: Decimal; + constructor( - public value: any, + value: Decimal | string | number | bigint, public unit?: any ) { - if (this.value == null || isNaN(this.value)) { + if (value == null || typeof value === 'number' && isNaN(value)) { throw new Error('Cannot create a quantity with an undefined value'); - } else if (!isValidDecimal(this.value)) { + } + this.value = Decimal.from(value); + if (!isValidDecimal(this.value)) { throw new Error('Cannot create a quantity with an invalid decimal value'); } @@ -46,7 +51,7 @@ export class Quantity { if (otherVal == null) { return null; } else { - return this.value <= otherVal; + return this.value.lessThanOrEquals(otherVal); } } } @@ -57,7 +62,7 @@ export class Quantity { if (otherVal == null) { return null; } else { - return this.value >= otherVal; + return this.value.greaterThanOrEquals(otherVal); } } } @@ -68,7 +73,7 @@ export class Quantity { if (otherVal == null) { return null; } else { - return this.value > otherVal; + return this.value.greaterThan(otherVal); } } } @@ -79,7 +84,7 @@ export class Quantity { if (otherVal == null) { return null; } else { - return this.value < otherVal; + return this.value.lessThan(otherVal); } } } @@ -95,7 +100,7 @@ export class Quantity { if (otherVal == null) { return null; } else { - return decimalAdjust('round', this.value, -8) === otherVal; + return this.value.round(8).equals(Decimal.from(otherVal)); } } } @@ -108,7 +113,7 @@ export class Quantity { } dividedBy(other: any) { - if (other == null || other === 0 || other.value === 0) { + if (other == null || other === 0 || (other.value != null && Decimal.from(other.value).equals(0))) { return null; } else if (!other.isQuantity) { // convert it to a quantity w/ unit 1 @@ -116,19 +121,19 @@ export class Quantity { } const [val1, unit1, val2, unit2] = normalizeUnitsWhenPossible( - this.value, + this.value.toNumber(), this.unit, - other.value, + Decimal.from(other.value).toNumber(), other.unit ); - const resultValue = val1 / val2; + const resultValue = Decimal.from(val1 / val2); const resultUnit = getQuotientOfUnits(unit1, unit2); // Check for invalid unit or value if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { return null; } - return new Quantity(decimalAdjust('round', resultValue, -8), resultUnit); + return new Quantity(resultValue.round(8), resultUnit); } multiplyBy(other: any) { @@ -140,26 +145,26 @@ export class Quantity { } const [val1, unit1, val2, unit2] = normalizeUnitsWhenPossible( - this.value, + this.value.toNumber(), this.unit, - other.value, + Decimal.from(other.value).toNumber(), other.unit ); - const resultValue = val1 * val2; + const resultValue = Decimal.from(val1 * val2); const resultUnit = getProductOfUnits(unit1, unit2); // Check for invalid unit or value if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { return null; } - return new Quantity(decimalAdjust('round', resultValue, -8), resultUnit); + return new Quantity(resultValue.round(8), resultUnit); } } export function parseQuantity(str: string) { const components = /([+|-]?\d+\.?\d*)\s*('(.+)')?/.exec(str); if (components != null && components[1] != null) { - const value = parseFloat(components[1]); + const value = Decimal.from(components[1]); if (!isValidDecimal(value)) { return null; } diff --git a/src/datatypes/uncertainty.ts b/src/datatypes/uncertainty.ts index 44de60b3d..e986a581f 100644 --- a/src/datatypes/uncertainty.ts +++ b/src/datatypes/uncertainty.ts @@ -143,6 +143,8 @@ export class Uncertainty { if (typeof a.before === 'function') { return a.before(b, precision); + } else if (a.isDecimal) { + return a.lessThan(b); } else { return a < b; } diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 72aa736a0..08cd7dbdc 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -1,6 +1,7 @@ import { Expression } from './expression'; import { typeIsArray, allTrue, anyTrue, removeNulls, numerical_sort } from '../util/util'; import { Quantity } from '../datatypes/datatypes'; +import { Decimal } from '../datatypes/decimal'; import { Context } from '../runtime/context'; import { Exception } from '../datatypes/exception'; import { greaterThan, lessThan } from '../util/comparison'; @@ -17,6 +18,32 @@ class AggregateExpression extends Expression { } } +function hasDecimals(values: any[]) { + return values.some(value => value && value.isDecimal); +} + +function isDecimal(value: any): value is Decimal { + return value != null && value.isDecimal; +} + +function numberValue(value: any) { + return value && value.isDecimal ? value.toNumber() : value; +} + +function sumDecimals(values: Decimal[]) { + return values.reduce((sum, value) => sum.add(value)).setScale(8, 'half-up'); +} + +function productDecimals(values: Decimal[]) { + return values.reduce((product, value) => product.multiplyBy(value)).setScale(8, 'half-up'); +} + +function decimalResult(value: number, values: any[], resultTypeName?: string) { + return hasDecimals(values) || resultTypeName === ELM_DECIMAL_TYPE + ? Decimal.from(value).setScale(8, 'half-up') + : value; +} + export class Count extends AggregateExpression { constructor(json: any) { super(json); @@ -53,11 +80,12 @@ export class Sum extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); - const sum = values.reduce((x, y) => x + y); + const sum = sumDecimals(getValuesFromQuantities(items)); return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : new Quantity(sum, items[0].unit); } else { - const sum = items.reduce((x: any, y: any) => x + y); + const sum = hasDecimals(items) + ? sumDecimals(items.map(Decimal.from)) + : items.reduce((x: any, y: any) => x + y); return overflowsOrUnderflows(sum, this.resultTypeName) ? null : sum; } } @@ -153,12 +181,14 @@ export class Avg extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); - const sum = values.reduce((x, y) => x + y); - return new Quantity(sum / values.length, items[0].unit); + const sum = sumDecimals(getValuesFromQuantities(items)); + return new Quantity(sum.divideBy(items.length).setScale(8, 'half-up'), items[0].unit); } else { + if (hasDecimals(items)) { + return sumDecimals(items.map(Decimal.from)).divideBy(items.length).setScale(8, 'half-up'); + } const sum = items.reduce((x: number, y: number) => x + y); - return sum / items.length; + return decimalResult(sum / items.length, items, this.resultTypeName); } } } @@ -184,11 +214,12 @@ export class Median extends AggregateExpression { } if (!hasOnlyQuantities(items)) { - return medianOfNumbers(items); + return hasDecimals(items) + ? medianOfDecimals(items.map(Decimal.from)) + : decimalResult(medianOfNumbers(items), items, this.resultTypeName); } - const values = getValuesFromQuantities(items); - const median = medianOfNumbers(values); + const median = medianOfDecimals(getValuesFromQuantities(items)); return new Quantity(median, items[0].unit); } } @@ -218,9 +249,10 @@ export class Mode extends AggregateExpression { const values = getValuesFromQuantities(filtered); let mode = this.mode(values); if (mode.length === 1) { - mode = mode[0]; + return new Quantity(mode[0], items[0].unit); + } else { + return mode.map(m => new Quantity(m, items[0].unit)); } - return new Quantity(mode, items[0].unit); } else { const mode = this.mode(filtered); if (mode.length === 1) { @@ -278,11 +310,14 @@ export class StdDev extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); + const values = getValuesFromQuantities(items).map(numberValue); const stdDev = this.standardDeviation(values); return new Quantity(stdDev, items[0].unit); } else { - return this.standardDeviation(items); + const standardDeviation = this.standardDeviation(items.map(numberValue)); + return standardDeviation == null + ? null + : decimalResult(standardDeviation, items, this.resultTypeName); } } @@ -336,15 +371,17 @@ export class Product extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); - const product = values.reduce((x, y) => x * y); + const product = productDecimals(getValuesFromQuantities(items)); // Units are not multiplied for the geometric product return overflowsOrUnderflows(product, ELM_DECIMAL_TYPE) ? null : new Quantity(product, items[0].unit); } else { - const product = items.reduce((x: any, y: any) => x * y); - return overflowsOrUnderflows(product, this.resultTypeName) ? null : product; + const product = hasDecimals(items) + ? productDecimals(items.map(Decimal.from)) + : items.reduce((x: number, y: number) => x * y); + const result = isDecimal(product) ? product : decimalResult(product, items, this.resultTypeName); + return overflowsOrUnderflows(result, this.resultTypeName) ? null : result; } } } @@ -371,13 +408,17 @@ export class GeometricMean extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); - const product = values.reduce((x, y) => x * y); - const geoMean = Math.pow(product, 1.0 / items.length); + const product = productDecimals(getValuesFromQuantities(items)); + const geoMean = product.power(1.0 / items.length).setScale(8, 'half-up'); return new Quantity(geoMean, items[0].unit); } else { + if (hasDecimals(items)) { + return productDecimals(items.map(Decimal.from)) + .power(1.0 / items.length) + .setScale(8, 'half-up'); + } const product = items.reduce((x: number, y: number) => x * y); - return Math.pow(product, 1.0 / items.length); + return decimalResult(Math.pow(product, 1.0 / items.length), items, this.resultTypeName); } } } @@ -444,7 +485,7 @@ function processQuantities(values: any[]) { } } -function getValuesFromQuantities(quantities: Quantity[]): number[] { +function getValuesFromQuantities(quantities: Quantity[]): Decimal[] { return quantities.map(quantity => quantity.value); } @@ -471,3 +512,11 @@ function medianOfNumbers(numbers: number[]) { return (items[items.length / 2 - 1] + items[items.length / 2]) / 2; } } + +function medianOfDecimals(decimals: Decimal[]) { + const items = [...decimals].sort((a, b) => a.compareTo(b)); + const middle = Math.floor(items.length / 2); + return items.length % 2 === 1 + ? items[middle] + : items[middle - 1].add(items[middle]).divideBy(2).setScale(8, 'half-up'); +} diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index d777121e0..c63fa18f0 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -13,6 +13,7 @@ import { MIN_DATETIME_VALUE, MIN_TIME_VALUE } from '../datatypes/datetime'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../datatypes/decimal'; import { ELM_DECIMAL_TYPE, ELM_DATETIME_TYPE, @@ -22,14 +23,47 @@ import { ELM_TIME_TYPE } from '../util/elmTypes'; import { - MAX_FLOAT_VALUE, MAX_INT_VALUE, MAX_LONG_VALUE, - MIN_FLOAT_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from '../util/limits'; +function isDecimal(value: any): boolean { + return value != null && value.isDecimal; +} + +function decimalResult(value: any, resultTypeName?: string): any { + if (isDecimal(value) || (typeof value === 'number' && !Number.isFinite(value))) { + return value; + } + return resultTypeName === ELM_DECIMAL_TYPE || (typeof value === 'number' && !Number.isInteger(value)) + ? Decimal.from(value).setScale(8, 'half-up') + : value; +} + +function add(x: any, y: any) { + return isDecimal(x) || isDecimal(y) ? Decimal.from(x).add(y).setScale(8, 'half-up') : x + y; +} + +function subtract(x: any, y: any) { + return isDecimal(x) || isDecimal(y) + ? Decimal.from(x).subtract(y).setScale(8, 'half-up') + : x - y; +} + +function multiply(x: any, y: any) { + return isDecimal(x) || isDecimal(y) + ? Decimal.from(x).multiplyBy(y).setScale(8, 'half-up') + : x * y; +} + +function divide(x: any, y: any) { + return isDecimal(x) || isDecimal(y) + ? Decimal.from(x).divideBy(y).setScale(8, 'half-up') + : x / y; +} + export class Add extends Expression { constructor(json: any) { super(json); @@ -84,10 +118,10 @@ export class Multiply extends Expression { if (x.low.isQuantity) { return new Uncertainty(doMultiplication(x.low, y.low), doMultiplication(x.high, y.high)); } else { - return new Uncertainty(x.low * y.low, x.high * y.high); + return new Uncertainty(multiply(x.low, y.low), multiply(x.high, y.high)); } } else { - return x * y; + return multiply(x, y); } }); @@ -109,7 +143,9 @@ export class Divide extends Expression { return null; } - const quotient = args.reduce((x: any, y: any) => { + let quotient; + let [x, y] = args; + try { if (x.isUncertainty && !y.isUncertainty) { y = new Uncertainty(y, y); } else if (y.isUncertainty && !x.isUncertainty) { @@ -117,17 +153,20 @@ export class Divide extends Expression { } if (x.isQuantity) { - return doDivision(x, y); + quotient = doDivision(x, y); } else if (x.isUncertainty && y.isUncertainty) { if (x.low.isQuantity) { - return new Uncertainty(doDivision(x.low, y.high), doDivision(x.high, y.low)); + quotient = new Uncertainty(doDivision(x.low, y.high), doDivision(x.high, y.low)); } else { - return new Uncertainty(x.low / y.high, x.high / y.low); + quotient = new Uncertainty(divide(x.low, y.high), divide(x.high, y.low)); } } else { - return x / y; + quotient = divide(x, y); } - }); + } catch { + // Decimal division by zero throws; CQL defines the result as null. + return null; + } // Note, anything divided by 0 is Infinity in Javascript, which will be // considered as overflow by this check. @@ -149,7 +188,7 @@ export class TruncatedDivide extends Expression { return null; } - let truncatedQuotient: number | bigint; + let truncatedQuotient: number | bigint | Decimal; if (typeof args[0] === 'bigint') { // bigint division always truncates try { @@ -159,8 +198,17 @@ export class TruncatedDivide extends Expression { return null; } } else { - const quotient = args.reduce((x: number, y: number) => x / y); - truncatedQuotient = quotient >= 0 ? Math.floor(quotient) : Math.ceil(quotient); + try { + const quotient = args.reduce((x: any, y: any) => divide(x, y)); + const truncated = isDecimal(quotient) + ? quotient.truncate() + : quotient >= 0 + ? Math.floor(quotient) + : Math.ceil(quotient); + truncatedQuotient = decimalResult(truncated, this.resultTypeName); + } catch { + return null; + } } if (MathUtil.overflowsOrUnderflows(truncatedQuotient, this.resultTypeName)) { @@ -181,15 +229,17 @@ export class Modulo extends Expression { return null; } - let modulo: number | bigint; + let modulo: number | bigint | Decimal; try { - modulo = args.reduce((x: any, y: any) => x % y); + modulo = args.reduce((x: any, y: any) => + isDecimal(x) || isDecimal(y) ? Decimal.from(x).modulo(y) : x % y + ); } catch { // modulo divide by zero results in null according to specification return null; } - return MathUtil.decimalLongOrNull(modulo); + return MathUtil.decimalLongOrNull(decimalResult(modulo, this.resultTypeName)); } } @@ -204,7 +254,7 @@ export class Ceiling extends Expression { return null; } - return Math.ceil(arg); + return isDecimal(arg) ? arg.ceil() : Math.ceil(arg); } } @@ -219,7 +269,7 @@ export class Floor extends Expression { return null; } - return Math.floor(arg); + return isDecimal(arg) ? arg.floor() : Math.floor(arg); } } @@ -234,7 +284,7 @@ export class Truncate extends Expression { return null; } - return arg >= 0 ? Math.floor(arg) : Math.ceil(arg); + return isDecimal(arg) ? arg.truncate() : arg >= 0 ? Math.floor(arg) : Math.ceil(arg); } } export class Abs extends Expression { @@ -247,12 +297,17 @@ export class Abs extends Expression { if (arg == null) { return null; } else if (arg.isQuantity) { - return new Quantity(Math.abs(arg.value), arg.unit); + return new Quantity(arg.value.abs(), arg.unit); } else if (typeof arg === 'bigint') { const absoluteValue = arg < 0n ? -arg : arg; return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) ? null : absoluteValue; + } else if (isDecimal(arg)) { + const absoluteValue = arg.abs(); + return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) + ? null + : absoluteValue; } else { const absoluteValue = Math.abs(arg); return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) @@ -272,12 +327,17 @@ export class Negate extends Expression { if (arg == null) { return null; } else if (arg.isQuantity) { - return new Quantity(arg.value * -1, arg.unit); + return new Quantity(arg.value.negate(), arg.unit); } else if (typeof arg === 'bigint') { const negatedValue = arg * -1n; return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) ? null : negatedValue; + } else if (isDecimal(arg)) { + const negatedValue = arg.negate(); + return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) + ? null + : negatedValue; } else { const negatedValue = arg * -1; return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) @@ -302,7 +362,10 @@ export class Round extends Expression { } const dec = this.precision != null ? await this.precision.execute(ctx) : 0; - return Math.round(arg * Math.pow(10, dec)) / Math.pow(10, dec); + if (isDecimal(arg)) { + return arg.round(dec); + } + return decimalResult(Math.round(arg * Math.pow(10, dec)) / Math.pow(10, dec), this.resultTypeName); } } @@ -317,9 +380,13 @@ export class Ln extends Expression { return null; } - const ln = Math.log(arg); - - return MathUtil.decimalOrNull(ln); + try { + return isDecimal(arg) + ? arg.ln() + : MathUtil.decimalOrNull(decimalResult(Math.log(arg), ELM_DECIMAL_TYPE)); + } catch { + return null; + } } } @@ -334,7 +401,14 @@ export class Exp extends Expression { return null; } - const power = Math.exp(arg); + let power; + try { + power = isDecimal(arg) + ? arg.exp() + : decimalResult(Math.exp(arg), ELM_DECIMAL_TYPE); + } catch { + return null; + } if (MathUtil.overflowsOrUnderflows(power, this.resultTypeName)) { return null; @@ -354,9 +428,16 @@ export class Log extends Expression { return null; } - const log = args.reduce((x: number, y: number) => Math.log(x) / Math.log(y)); - - return MathUtil.decimalOrNull(log); + try { + const log = args.reduce((x: any, y: any) => + isDecimal(x) || isDecimal(y) + ? Decimal.from(x).log(y) + : Math.log(x) / Math.log(y) + ); + return isDecimal(log) ? log : MathUtil.decimalOrNull(decimalResult(log, ELM_DECIMAL_TYPE)); + } catch { + return null; + } } } @@ -371,7 +452,7 @@ export class Power extends Expression { return null; } - const power = args.reduce((x: any, y: any) => doPower(x, y)); + const power = decimalResult(args.reduce((x: any, y: any) => doPower(x, y)), this.resultTypeName); // Note: The resultTypeName may be wrong if the exponent is a negative number. Math.overflowsOrUnderflows // already accounts for this possibility by only considering it an integer if Number.isInteger(value). @@ -384,6 +465,9 @@ export class Power extends Expression { } function doPower(x: any, y: any) { + if (isDecimal(x) || isDecimal(y)) { + return Decimal.from(x).power(y); + } if (typeof x === 'bigint' && typeof y === 'bigint' && y < 0n) { // x ** y does not support negative exponents for bigint, so downgrade to number if possible, otherwise return null if ( @@ -409,7 +493,7 @@ export class MinValue extends Expression { static readonly MIN_VALUES = { [ELM_INTEGER_TYPE]: MIN_INT_VALUE, [ELM_LONG_TYPE]: MIN_LONG_VALUE, - [ELM_DECIMAL_TYPE]: MIN_FLOAT_VALUE, + [ELM_DECIMAL_TYPE]: MIN_DECIMAL_VALUE, [ELM_DATETIME_TYPE]: MIN_DATETIME_VALUE, [ELM_DATE_TYPE]: MIN_DATE_VALUE, [ELM_TIME_TYPE]: MIN_TIME_VALUE @@ -441,7 +525,7 @@ export class MaxValue extends Expression { static readonly MAX_VALUES = { [ELM_INTEGER_TYPE]: MAX_INT_VALUE, [ELM_LONG_TYPE]: MAX_LONG_VALUE, - [ELM_DECIMAL_TYPE]: MAX_FLOAT_VALUE, + [ELM_DECIMAL_TYPE]: MAX_DECIMAL_VALUE, [ELM_DATETIME_TYPE]: MAX_DATETIME_VALUE, [ELM_DATE_TYPE]: MAX_DATE_VALUE, [ELM_TIME_TYPE]: MAX_TIME_VALUE diff --git a/src/elm/interval.ts b/src/elm/interval.ts index 236a814b1..5ef38af84 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -1,13 +1,15 @@ import { Expression } from './expression'; import { MAX_DATETIME_VALUE, MIN_DATETIME_VALUE } from '../datatypes/datetime'; import { Quantity } from '../datatypes/quantity'; -import { add, successor, predecessor } from '../util/math'; +import { add, successor, predecessor, subtract } from '../util/math'; +import { greaterThan, lessThan, lessThanOrEquals } from '../util/comparison'; import { convertUnit, compareUnits, convertToCQLDateUnit } from '../util/units'; import * as dtivl from '../datatypes/interval'; import { Context } from '../runtime/context'; import { build } from './builder'; import { IntervalTypeSpecifier, NamedTypeSpecifier } from '../types/type-specifiers.interfaces'; import { ELM_ANY_TYPE, ELM_NAMED_TYPE_SPECIFIER } from '../util/elmTypes'; +import { Decimal } from '../datatypes/decimal'; export class Interval extends Expression { lowClosed: boolean; @@ -409,16 +411,16 @@ function intervalListType(intervals: any) { } else { return 'mismatch'; } - } else if (Number.isInteger(low) && Number.isInteger(high)) { + } else if (typeof low === 'number' && typeof high === 'number') { if (type == null) { type = 'integer'; - } else if (type === 'integer' || type === 'decimal') { + } else if (type === 'integer') { continue; } else { return 'mismatch'; } - } else if (typeof low === 'number' && typeof high === 'number') { - if (type == null || type === 'integer') { + } else if (low.isDecimal && high.isDecimal) { + if (type == null) { type = 'decimal'; } else if (type === 'decimal') { continue; @@ -445,7 +447,7 @@ export class Expand extends Expression { let defaultPer, expandFunction; let [intervals, per] = await this.execArgs(ctx); - if (per?.value === 0) { + if (per?.value.equals(0)) { // a per of 0 is basically like a divide-by-zero; since spec says divide-by-zero returns null, we'll return null here too return null; } @@ -471,11 +473,17 @@ export class Expand extends Expression { if (['time', 'date', 'datetime'].includes(type)) { expandFunction = this.expandDTishInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.getPrecision()); - } else if (['quantity'].includes(type)) { + } else if (type === 'quantity') { expandFunction = this.expandQuantityInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.unit); - } else if (['long', 'integer', 'decimal'].includes(type)) { - expandFunction = this.expandNumericInterval; + } else if (type === 'integer') { + expandFunction = this.expandIntegerInterval; + defaultPer = (_interval: any) => new Quantity(1, '1'); + } else if (type === 'long') { + expandFunction = this.expandLongInterval; + defaultPer = (_interval: any) => new Quantity(1, '1'); + } else if (type === 'decimal') { + expandFunction = this.expandDecimalInterval; defaultPer = (_interval: any) => new Quantity(1, '1'); } else { throw new Error('Interval list type not yet supported.'); @@ -587,8 +595,28 @@ export class Expand extends Expression { } else { result_units = interval.low.unit; } - const low_value = convertUnit(interval.low.value, interval.low.unit, result_units); - const high_value = convertUnit(interval.high.value, interval.high.unit, result_units); + let low_value = interval.low.value; + let high_value = interval.high.value; + + // Quantity values are always Decimal, but successor is expected to know if the value is an integer + // this needs to happen before converting units + if (!interval.lowClosed) { + if (low_value.isInteger()) { + low_value = low_value.add(1); + } else { + low_value = successor(low_value); + } + } + if (!interval.highClosed) { + if (high_value.isInteger()) { + high_value = high_value.subtract(1); + } else { + high_value = predecessor(high_value); + } + } + + low_value = convertUnit(low_value, interval.low.unit, result_units); + high_value = convertUnit(high_value, interval.high.unit, result_units); const per_value = convertUnit(per.value, per.unit, result_units); // return null if unit conversion failed, must have mismatched units @@ -596,11 +624,9 @@ export class Expand extends Expression { return null; } - const results = this.makeNumericIntervalList( + const results = this.makeDecimalIntervalList( low_value, high_value, - interval.lowClosed, - interval.highClosed, per_value ); @@ -611,103 +637,111 @@ export class Expand extends Expression { return results; } - expandNumericInterval(interval: any, per: any) { + expandIntegerInterval(interval: any, per: any) { if (per.unit !== '1' && per.unit !== '') { return null; } - return this.makeNumericIntervalList( - interval.low, - interval.high, - interval.lowClosed, - interval.highClosed, - per.value + const low = interval.lowClosed ? interval.low : successor(interval.low); + const high = interval.highClosed ? interval.high : predecessor(interval.high); + + return this.makeDecimalIntervalList( + low, high, per.value ); } - makeNumericIntervalList( + expandDecimalInterval(interval: any, per: any) { + if (per.unit !== '1' && per.unit !== '') { + return null; + } + const low = interval.lowClosed ? interval.low : successor(interval.low); + const high = interval.highClosed ? interval.high : predecessor(interval.high); + + return this.makeDecimalIntervalList( + low, high, per.value + ); + } + + expandLongInterval(interval: any, per: any) { + if (per.unit !== '1' && per.unit !== '') { + return null; + } + + const low = interval.lowClosed ? interval.low : successor(interval.low); + const high = interval.highClosed ? interval.high : predecessor(interval.high); + + return this.makeDecimalIntervalList( + low, high, per.value + ); + } + + makeDecimalIntervalList( low: any, high: any, - lowClosed: boolean, - highClosed: boolean, perValue: any ) { // If the per value is a Decimal (has a .), 8 decimal places are appropriate // Integers should have 0 Decimal places - const perIsDecimal = perValue.toString().includes('.'); - const decimalPrecision = perIsDecimal ? 8 : 0; - const hasLongBoundaries = typeof low === 'bigint' || typeof high === 'bigint'; - - low = lowClosed ? low : successor(low); - high = highClosed ? high : predecessor(high); - - if (hasLongBoundaries && !perIsDecimal) { - const longLow = low as bigint; - const longHigh = high as bigint; - - if (longLow > longHigh) { - return []; - } - if (longLow == null || longHigh == null) { - return []; - } - - const perBigInt = BigInt(perValue); - if (perBigInt > longHigh - longLow + 1n) { - return []; - } - - let current_low = longLow; - let current_high = current_low + perBigInt - 1n; - const results = []; - while (current_high <= longHigh) { - results.push(new dtivl.Interval(current_low, current_high, true, true)); - current_low += perBigInt; - current_high = current_low + perBigInt - 1n; - } - - return results; - } else if (hasLongBoundaries) { - low = Number(low); - high = Number(high); + const perIsIntegral = !perValue.toString().includes('.'); + const decimalPrecision = perIsIntegral ? 0 : 8; + + // For the purposes of this function, we'll perform all the arithmetic using Decimals, + // then convert the results back to the required type if necessary + let makeInterval: Function; + if (!perIsIntegral) { + // If per is not an integer value, then regardless of the original point types, the values will be Decimals + makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l, h, true, true); + } else if (typeof low === 'bigint' || typeof high === 'bigint') { + makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toLong(), h.toLong(), true, true); + } else if (typeof low === 'number' || typeof high === 'number') { + makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); + } else { + // per is an integer but the original bounds of the interval were Decimal. + // TODO: for now just make them integers + makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); } + // treat everything as a Decimal, convert back later if needed + low = Decimal.from(low); + high = Decimal.from(high); + // If the interval boundaries are more precise than the per quantity, the // more precise values will be truncated to the precision specified by the // per quantity. low = truncateDecimal(low, decimalPrecision); high = truncateDecimal(high, decimalPrecision); - if (low > high) { + if (low == null || high == null) { return []; } - if (low == null || high == null) { + if (low.greaterThan(high)) { return []; } - const perUnitSize = perIsDecimal ? 0.00000001 : 1; + const perUnitSize = perIsIntegral ? 1 : 0.00000001; - if ( - low === high && - Number.isInteger(low) && - Number.isInteger(high) && - !Number.isInteger(perValue) - ) { - high = parseFloat((high + 1).toFixed(decimalPrecision)); - } + // TODO: this supports one test case but it's not clear if the test case is correct + // if ( + // low === high && + // Number.isInteger(low) && + // Number.isInteger(high) && + // !Number.isInteger(perValue) + // ) { + // high = parseFloat((high + 1).toFixed(decimalPrecision)); + // } let current_low = low; const results = []; - if (perValue > high - low + perUnitSize) { + if (perValue.greaterThan(high.subtract(low).add(perUnitSize))) { return []; } - let current_high = parseFloat((current_low + perValue - perUnitSize).toFixed(decimalPrecision)); - let intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); - while (intervalToAdd.high <= high) { + let current_high = current_low.add(perValue).subtract(perUnitSize); + let intervalToAdd = makeInterval(current_low, current_high); + while (current_high.lessThanOrEquals(high)) { results.push(intervalToAdd); - current_low = parseFloat((current_low + perValue).toFixed(decimalPrecision)); - current_high = parseFloat((current_low + perValue - perUnitSize).toFixed(decimalPrecision)); - intervalToAdd = new dtivl.Interval(current_low, current_high, true, true); + current_low = current_low.add(perValue); + current_high = current_low.add(perValue).subtract(perUnitSize); + intervalToAdd = makeInterval(current_low, current_high); } return results; @@ -762,10 +796,10 @@ function collapseIntervals(intervals: any, perWidth: any) { return 1; } } else if (a.low != null && b.low != null) { - if (a.low < b.low) { + if (lessThan(a.low, b.low)) { return -1; } - if (a.low > b.low) { + if (greaterThan(a.low, b.low)) { return 1; } } else if (a.low != null && b.low == null) { @@ -782,10 +816,10 @@ function collapseIntervals(intervals: any, perWidth: any) { return 1; } } else if (a.high != null && b.high != null) { - if (a.high < b.high) { + if (lessThan(a.high, b.high)) { return -1; } - if (a.high > b.high) { + if (greaterThan(a.high, b.high)) { return 1; } } else if (a.high != null && b.high == null) { @@ -828,17 +862,15 @@ function collapseIntervals(intervals: any, perWidth: any) { a = b; } } else { - const distance = b.low - a.high; - const comparablePerWidth = - typeof distance === 'bigint' && Number.isInteger(perWidth.value) - ? BigInt(perWidth.value) - : perWidth.value; - const withinPerWidth = - typeof distance === 'bigint' && typeof comparablePerWidth !== 'bigint' - ? Number(distance) <= comparablePerWidth - : distance <= comparablePerWidth; + + const distance = subtract(b.low, a.high); + // TODO: perWidth.value is a Decimal, but distance could be anything + // lessThanOrEquals requires that its args be the same type + // so I guess for now, make distance a Decimal + const distanceDecimal = Decimal.from(distance); + const withinPerWidth = lessThanOrEquals(distanceDecimal, perWidth.value); if (withinPerWidth) { - if (b.high > a.high || b.high == null) { + if (greaterThan(b.high, a.high) || b.high == null) { a.high = b.high; } } else { @@ -857,5 +889,5 @@ function truncateDecimal(decimal: any, decimalPlaces: number) { // like parseFloat().toFixed() but floor rather than round // Needed for when per precision is less than the interval input precision const re = new RegExp('^-?\\d+(?:.\\d{0,' + (decimalPlaces || -1) + '})?'); - return parseFloat(decimal.toString().match(re)[0]); + return Decimal.from(decimal.toString().match(re)[0]); } diff --git a/src/elm/literal.ts b/src/elm/literal.ts index 40d17b393..dea41feb3 100644 --- a/src/elm/literal.ts +++ b/src/elm/literal.ts @@ -7,6 +7,7 @@ import { ELM_STRING_TYPE } from '../util/elmTypes'; import { Expression } from './expression'; +import { Decimal } from '../datatypes/decimal'; export class Literal extends Expression { valueType: string; @@ -96,7 +97,7 @@ export class LongLiteral extends Literal { export class DecimalLiteral extends Literal { constructor(json: any) { super(json); - this.value = parseFloat(this.value); + this.value = Decimal.from(this.value); } // Define a simple getter to allow type-checking of this class without instanceof diff --git a/src/elm/quantity.ts b/src/elm/quantity.ts index cc9b89335..6bd9ec2c5 100644 --- a/src/elm/quantity.ts +++ b/src/elm/quantity.ts @@ -5,12 +5,12 @@ import { Context } from '../runtime/context'; // Unit conversation is currently implemented on for time duration comparison operations // TODO: Implement unit conversation for time duration mathematical operations export class Quantity extends Expression { - value: number; + value: DT.Decimal; unit: any; constructor(json: any) { super(json); - this.value = parseFloat(json.value); + this.value = DT.Decimal.from(json.value); this.unit = json.unit; } diff --git a/src/elm/type.ts b/src/elm/type.ts index 6625b7e84..073a12e59 100644 --- a/src/elm/type.ts +++ b/src/elm/type.ts @@ -5,6 +5,7 @@ import { DateTime, Date } from '../datatypes/datetime'; import { Concept } from '../datatypes/clinical'; import { Interval as dtInterval } from '../datatypes/interval'; import { Quantity, parseQuantity } from '../datatypes/quantity'; +import { Decimal } from '../datatypes/decimal'; import { isValidDecimal, isValidInteger, isValidLong, limitDecimalPrecision } from '../util/math'; import { normalizeMillisecondsField } from '../util/util'; import { Ratio } from '../datatypes/ratio'; @@ -165,13 +166,17 @@ export class ToDecimal extends Expression { const arg = await this.execArgs(ctx); if (arg != null) { if (arg.isUncertainty) { - const low = limitDecimalPrecision(parseFloat(arg.low.toString())); - const high = limitDecimalPrecision(parseFloat(arg.high.toString())); + const low = Decimal.from(arg.low); + const high = Decimal.from(arg.high); return new Uncertainty(low, high); } else { - const decimal = limitDecimalPrecision(parseFloat(arg.toString())); - if (isValidDecimal(decimal)) { - return decimal; + try { + const decimal = Decimal.from(arg.toString()); + if (isValidDecimal(decimal)) { + return decimal; + } + } catch (_e) { + return null; } } } @@ -195,6 +200,11 @@ export class ToInteger extends Expression { if (isValidInteger(integer)) { return integer; } + } else if (arg && arg.isDecimal) { + const integer = (arg as Decimal).toInteger(); + if (isValidInteger(integer)) { + return integer; + } } else if (typeof arg === 'string') { // check for blank string because Number('') and Number(' ') evaluate to 0. if (arg.trim().length === 0) { @@ -232,6 +242,11 @@ export class ToLong extends Expression { } catch { return null; } + } else if (arg && arg.isDecimal) { + const long = (arg as Decimal).toLong(); + if (isValidLong(long)) { + return long; + } } else if (typeof arg === 'string') { // check string format because BigInt throws for invalid strings if (!/^[+-]?\d+$/.test(arg)) { @@ -260,14 +275,8 @@ export class ToQuantity extends Expression { convertValue(val: any): any { if (val == null) { return null; - } else if (typeof val === 'number') { + } else if (typeof val === 'number' || typeof val === 'bigint' || val.isDecimal) { return new Quantity(val, '1'); - } else if (typeof val === 'bigint') { - // By definition, Quantity value is a Decimal in CQL, so we need to convert bigint to number. - // While this isn't perfect, in practice it is probably OK since the range of safer integers - // in JS number is pretty big: -(2^53 - 1) to 2^53 - 1, which is plus/minus 9 quadrillion. - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger#description - return new Quantity(Number(val), '1'); } else if (val.isRatio) { // numerator and denominator are guaranteed non-null return val.numerator.dividedBy(val.denominator); @@ -734,10 +743,9 @@ function guessSpecifierType(val: any): any { return typeHierarchy[0]; } else if (typeof val === 'boolean') { return { type: ELM_NAMED_TYPE_SPECIFIER, name: ELM_BOOLEAN_TYPE }; - } else if (typeof val === 'number' && Math.floor(val) === val) { - // it could still be a decimal, but we have to just take our best guess! - return { type: ELM_NAMED_TYPE_SPECIFIER, name: ELM_INTEGER_TYPE }; } else if (typeof val === 'number') { + return { type: ELM_NAMED_TYPE_SPECIFIER, name: ELM_INTEGER_TYPE }; + } else if (val.isDecimal) { return { type: ELM_NAMED_TYPE_SPECIFIER, name: ELM_DECIMAL_TYPE }; } else if (typeof val === 'bigint') { return { type: ELM_NAMED_TYPE_SPECIFIER, name: ELM_LONG_TYPE }; diff --git a/src/runtime/context.ts b/src/runtime/context.ts index e28e5ad68..106a53639 100644 --- a/src/runtime/context.ts +++ b/src/runtime/context.ts @@ -341,9 +341,9 @@ export class Context { case ELM_BOOLEAN_TYPE: return typeof val === 'boolean'; case ELM_DECIMAL_TYPE: - return typeof val === 'number'; + return val && val.isDecimal; case ELM_INTEGER_TYPE: - return typeof val === 'number' && Math.floor(val) === val; + return typeof val === 'number'; case ELM_LONG_TYPE: return typeof val === 'bigint'; case ELM_STRING_TYPE: @@ -388,9 +388,9 @@ export class Context { if (inst.isBooleanLiteral) { return typeof val === 'boolean'; } else if (inst.isDecimalLiteral) { - return typeof val === 'number'; + return val && val.isDecimal; } else if (inst.isIntegerLiteral) { - return typeof val === 'number' && Math.floor(val) === val; + return typeof val === 'number'; } else if (inst.isLongLiteral) { return typeof val === 'bigint'; } else if (inst.isStringLiteral) { diff --git a/src/util/comparison.ts b/src/util/comparison.ts index 17d45e240..467bb2e82 100644 --- a/src/util/comparison.ts +++ b/src/util/comparison.ts @@ -12,6 +12,10 @@ function areStrings(a: any, b: any) { return typeof a === 'string' && typeof b === 'string'; } +function areDecimals(a: any, b: any) { + return a && a.isDecimal && b && b.isDecimal; +} + function areDateTimesOrQuantities(a: any, b: any) { return ( (a && a.isDateTime && b && b.isDateTime) || @@ -27,6 +31,8 @@ function isUncertainty(x: any) { export function lessThan(a: any, b: any, precision?: any) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { return a < b; + } else if (areDecimals(a, b)) { + return a.lessThan(b); } else if (areDateTimesOrQuantities(a, b)) { return a.before(b, precision); } else if (isUncertainty(a)) { @@ -41,7 +47,9 @@ export function lessThan(a: any, b: any, precision?: any) { export function lessThanOrEquals(a: any, b: any, precision?: any) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { return a <= b; - } else if (areDateTimesOrQuantities(a, b)) { + }else if (areDecimals(a, b)) { + return a.lessThanOrEquals(b); + } else if (areDateTimesOrQuantities(a, b)) { return a.sameOrBefore(b, precision); } else if (isUncertainty(a)) { return a.lessThanOrEquals(b, precision); @@ -55,6 +63,8 @@ export function lessThanOrEquals(a: any, b: any, precision?: any) { export function greaterThan(a: any, b: any, precision?: any) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { return a > b; + } else if (areDecimals(a, b)) { + return a.greaterThan(b); } else if (areDateTimesOrQuantities(a, b)) { return a.after(b, precision); } else if (isUncertainty(a)) { @@ -69,6 +79,8 @@ export function greaterThan(a: any, b: any, precision?: any) { export function greaterThanOrEquals(a: any, b: any, precision?: any) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { return a >= b; + } else if (areDecimals(a, b)) { + return a.greaterThanOrEquals(b); } else if (areDateTimesOrQuantities(a, b)) { return a.sameOrAfter(b, precision); } else if (isUncertainty(a)) { diff --git a/src/util/math.ts b/src/util/math.ts index 1f5f508fd..b0fb84436 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -8,6 +8,13 @@ import { MIN_TIME_VALUE, MAX_TIME_VALUE } from '../datatypes/datetime'; + +import { + Decimal, + MAX_DECIMAL_VALUE, + MIN_DECIMAL_VALUE +} from '../datatypes/decimal'; + import { Uncertainty } from '../datatypes/uncertainty'; import { ELM_INTEGER_TYPE, @@ -19,11 +26,8 @@ import { ELM_QUANTITY_TYPE } from './elmTypes'; import { - MAX_FLOAT_VALUE, MAX_INT_VALUE, MAX_LONG_VALUE, - MIN_FLOAT_PRECISION_VALUE, - MIN_FLOAT_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from './limits'; @@ -63,15 +67,11 @@ export function overflowsOrUnderflows(value: any, type?: string): boolean { return true; } } else if (typeof value === 'number') { - // Only consider it an integer if it looks like an integer (even if the type says it's an integer). - // We need to do this because the CQL-to-ELM Translator's implementation of Power may incorrectly tag - // a result as an Integer when it really is a decimal (e.g., when the exponent is a negative number). - const isInteger = Number.isInteger(value) && (type === ELM_INTEGER_TYPE || type == null); - if (isInteger) { if (!isValidInteger(value)) { return true; } - } else if (!isValidDecimal(value)) { + } else if (value.isDecimal) { + if (!isValidDecimal(value)) { return true; } } else if (value.isUncertainty) { @@ -107,16 +107,13 @@ export function isValidLong(long: any) { } export function isValidDecimal(decimal: any) { - if (isNaN(decimal)) { + if (!decimal.isDecimal) { return false; } - if (typeof decimal !== 'number') { + if (decimal.greaterThan(MAX_DECIMAL_VALUE)) { return false; } - if (decimal > MAX_FLOAT_VALUE) { - return false; - } - if (decimal < MIN_FLOAT_VALUE) { + if (decimal.lessThan(MIN_DECIMAL_VALUE)) { return false; } return true; @@ -146,9 +143,11 @@ export function add(a: any, b: any, type?: string): any { } if (typeof a === 'number' && typeof b === 'number') { const sum = a + b; - const numberType = - type ?? (Number.isInteger(a) && Number.isInteger(b) ? ELM_INTEGER_TYPE : ELM_DECIMAL_TYPE); - return overflowsOrUnderflows(sum, numberType) ? null : sum; + return overflowsOrUnderflows(sum, ELM_INTEGER_TYPE) ? null : sum; + } + if (a?.isDecimal && b?.isDecimal) { + const sum = a.add(b); + return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : sum; } if (a?.isQuantity && b?.isQuantity) { const [aValue, aUnit, bValue, bUnit] = normalizeUnitsWhenPossible( @@ -160,7 +159,7 @@ export function add(a: any, b: any, type?: string): any { if (aUnit !== bUnit) { return null; } - const sum = aValue + bValue; + const sum = aValue.add(bValue); return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : new Quantity(sum, aUnit); } if (b?.isQuantity && (a?.isDate || a?.isDateTime || (a?.isTime && a.isTime()))) { @@ -188,14 +187,18 @@ export function subtract(a: any, b: any, type?: string): any { if (typeof b === 'number' || typeof b === 'bigint') { return add(a, -b, type); } + if (a?.isDecimal && b?.isDecimal) { + const difference = a.subtract(b); + return overflowsOrUnderflows(difference, ELM_DECIMAL_TYPE) ? null : difference; + } if (b?.isQuantity) { - return add(a, { isQuantity: true, value: -b.value, unit: b.unit }, type); + return add(a, { isQuantity: true, value: b.value.negate(), unit: b.unit }, type); } throw new Error('Unsupported argument types.'); } -export function limitDecimalPrecision( +export function limitDecimalPrecision( val?: T ): T | undefined { if (val == null) { @@ -204,7 +207,7 @@ export function limitDecimalPrecision= MAX_INT_VALUE) { - throw new OverFlowException(); - } else { - return val + 1; - } + if (val >= MAX_INT_VALUE) { + throw new OverFlowException(); } else { - if (val >= MAX_FLOAT_VALUE) { - throw new OverFlowException(); - } else { - return val + MIN_FLOAT_PRECISION_VALUE; - } + return val + 1; } } else if (typeof val === 'bigint') { if (val >= MAX_LONG_VALUE) { @@ -240,6 +234,12 @@ export function successor(val: any, type?: string, precision?: string): any { } else { return val + 1n; } + } else if (val && val.isDecimal) { + if (val.greaterThanOrEquals(MAX_DECIMAL_VALUE)) { + throw new OverFlowException(); + } else { + return val.successor(); + } } else if (val && val.isTime && val.isTime()) { if (val.sameAs(MAX_TIME_VALUE)) { throw new OverFlowException(); @@ -279,19 +279,10 @@ export function successor(val: any, type?: string, precision?: string): any { export function predecessor(val: any, type?: string, precision?: string): any { if (typeof val === 'number') { - const isInteger = type === ELM_INTEGER_TYPE || (type == null && Number.isInteger(val)); - if (isInteger) { - if (val <= MIN_INT_VALUE) { - throw new OverFlowException(); - } else { - return val - 1; - } + if (val <= MIN_INT_VALUE) { + throw new OverFlowException(); } else { - if (val <= MIN_FLOAT_VALUE) { - throw new OverFlowException(); - } else { - return val - MIN_FLOAT_PRECISION_VALUE; - } + return val - 1; } } else if (typeof val === 'bigint') { if (val <= MIN_LONG_VALUE) { @@ -299,6 +290,12 @@ export function predecessor(val: any, type?: string, precision?: string): any { } else { return val - 1n; } + } else if (val && val.isDecimal) { + if (val.lessThanOrEquals(MIN_DECIMAL_VALUE)) { + throw new OverFlowException(); + } else { + return val.predecessor(); + } } else if (val && val.isTime && val.isTime()) { if (val.sameAs(MIN_TIME_VALUE)) { throw new OverFlowException(); @@ -343,7 +340,7 @@ export function maxValueForType(type: string, quantityInstance?: Quantity) { case ELM_LONG_TYPE: return MAX_LONG_VALUE; case ELM_DECIMAL_TYPE: - return MAX_FLOAT_VALUE; + return MAX_DECIMAL_VALUE; case ELM_DATETIME_TYPE: return MAX_DATETIME_VALUE?.copy(); case ELM_DATE_TYPE: @@ -355,7 +352,7 @@ export function maxValueForType(type: string, quantityInstance?: Quantity) { // 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. // See: https://jira.hl7.org/browse/FHIR-57935 - return new Quantity(MAX_FLOAT_VALUE, quantityInstance?.unit || '1'); + return new Quantity(MAX_DECIMAL_VALUE, quantityInstance?.unit || '1'); } } return null; @@ -368,7 +365,7 @@ export function minValueForType(type: string, quantityInstance?: Quantity) { case ELM_LONG_TYPE: return MIN_LONG_VALUE; case ELM_DECIMAL_TYPE: - return MIN_FLOAT_VALUE; + return MIN_DECIMAL_VALUE; case ELM_DATETIME_TYPE: return MIN_DATETIME_VALUE?.copy(); case ELM_DATE_TYPE: @@ -380,7 +377,7 @@ export function minValueForType(type: string, quantityInstance?: Quantity) { // 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. // See: https://jira.hl7.org/browse/FHIR-57935 - return new Quantity(MIN_FLOAT_VALUE, quantityInstance?.unit || '1'); + return new Quantity(MIN_DECIMAL_VALUE, quantityInstance?.unit || '1'); } } return null; @@ -414,7 +411,8 @@ export function decimalOrNull(value: any) { } export function decimalLongOrNull(value: any) { - return (typeof value === 'number' && isValidDecimal(value)) || + return (typeof value === 'number' && Number.isFinite(value)) || + ((value && value.isDecimal) && isValidDecimal(value)) || (typeof value === 'bigint' && isValidLong(value)) ? value : null; diff --git a/src/util/units.ts b/src/util/units.ts index 31f513d6a..553720f42 100644 --- a/src/util/units.ts +++ b/src/util/units.ts @@ -1,5 +1,6 @@ import * as ucum from '@lhncbc/ucum-lhc'; import { decimalAdjust } from './math'; +import { Decimal } from '../datatypes/decimal'; const utils = ucum.UcumLhcUtils.getInstance(); // The CQL specification says that dates are based on the Gregorian calendar, so CQL-based year and month @@ -69,12 +70,16 @@ export function checkUnit(unit: any, allowEmptyUnits = true, allowCQLDateUnits = export function convertUnit(fromVal: any, fromUnit: any, toUnit: any, adjustPrecision = true) { [fromUnit, toUnit] = [fromUnit, toUnit].map(fixUnit); - const result = utils.convertUnitTo(fixUnit(fromUnit), fromVal, fixUnit(toUnit)); + // IMPORTANT: the UCUM library operates on raw JS numbers, not our Decimal + const rawFromVal = fromVal.isDecimal ? fromVal.value : fromVal; + + const result = utils.convertUnitTo(fixUnit(fromUnit), rawFromVal, fixUnit(toUnit)); if (result.status !== 'succeeded') { return; } // note: convert result.toVal to number (by prefixing +) to keep typescript happy - return adjustPrecision ? decimalAdjust('round', result.toVal, -8) : +result.toVal; + const rawRetVal = adjustPrecision ? decimalAdjust('round', result.toVal, -8) : +result.toVal; + return fromVal.isDecimal ? Decimal.from(rawRetVal) : rawRetVal; } export function normalizeUnitsWhenPossible(val1: any, unit1: any, val2: any, unit2: any) { @@ -121,7 +126,7 @@ export function convertToCQLDateUnit(unit: any) { export function compareUnits(unit1: any, unit2: any) { try { - const c = convertUnit(1, unit1, unit2); + const c = convertUnit(1, unit1, unit2) as number; if (c && c > 1) { // unit1 is bigger (less precise) return 1; diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts new file mode 100644 index 000000000..780b1ad21 --- /dev/null +++ b/test/datatypes/decimal-test.ts @@ -0,0 +1,41 @@ +import { Decimal } from '../../src/datatypes/decimal'; + +describe('Decimal', () => { + it('should retain Decimal runtime identity for a whole-number value', () => { + const decimal = Decimal.from('2.0'); + + decimal.isDecimal.should.equal(true); + (typeof decimal).should.equal('object'); + decimal.toNumber().should.equal(2); + }); + + it('should expose arithmetic and comparison operations', () => { + const value = Decimal.from('1.5').subtract('0.5'); + + value.compareTo('1').should.equal(0); + value.add(2).toString().should.equal('3'); + value.multiplyBy(2).toString().should.equal('2'); + value.divideBy(2).toString().should.equal('0.5'); + Decimal.from(3).modulo(2).toString().should.equal('1'); + }); + + it('should provide an explicit scale and JSON representation', () => { + Decimal.from('0.444444444').setScale(8).toString().should.equal('0.44444444'); + JSON.stringify({ value: Decimal.from('1.25') }).should.equal('{"value":"1.25"}'); + }); + + it('should provide CQL arithmetic helpers without exposing a number', () => { + Decimal.from('-1.9').truncate().should.equal(-1); + Decimal.from('1.1').ceil().should.equal(2); + Decimal.from('1.9').floor().should.equal(1); + Decimal.from('-0.5').round().should.eql(Decimal.from(0)); + Decimal.from('2').power(3).should.eql(Decimal.from(8)); + Decimal.from('9').sqrt().should.eql(Decimal.from(3)); + Decimal.from('8').log(2).should.eql(Decimal.from(3)); + }); + + it('should reject non-finite and divide-by-zero values', () => { + (() => Decimal.from('not a number')).should.throw(); + (() => Decimal.from(1).divideBy(0)).should.throw(); + }); +}); diff --git a/test/datatypes/interval-data.ts b/test/datatypes/interval-data.ts index f551726ca..4ce09e61c 100644 --- a/test/datatypes/interval-data.ts +++ b/test/datatypes/interval-data.ts @@ -1,6 +1,7 @@ import { Interval } from '../../src/datatypes/interval'; import { DateTime, Date } from '../../src/datatypes/datetime'; import { Quantity } from '../../src/datatypes/quantity'; +import { Decimal } from '../../src/datatypes/decimal'; class TestDateTime { static parse(string: string) { @@ -296,7 +297,7 @@ export default () => { y: new TestInterval(0n, 100n) } }; - data['zeroPointFiveToNinePointFive'] = new TestInterval(0.5, 9.5); + data['zeroPointFiveToNinePointFive'] = new TestInterval(Decimal.from(0.5), Decimal.from(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 adef8b2f0..29d4ff072 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -11,6 +11,7 @@ import { } from '../../src/datatypes/datetime'; import { Interval } from '../../src/datatypes/interval'; import { Quantity } from '../../src/datatypes/quantity'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../src/datatypes/decimal'; import { Uncertainty } from '../../src/datatypes/uncertainty'; import { ELM_DATE_TYPE, @@ -133,7 +134,7 @@ describe('Interval', () => { }); it('should return the point size for Decimal intervals', () => { - new Interval(0.5, 9.5).getPointSize().should.equal(0.00000001); + new Interval(Decimal.from(0.5), Decimal.from(9.5)).getPointSize().should.eql(Decimal.from(0.00000001)); }); it('should return the point size for Quantity intervals', () => { @@ -155,7 +156,7 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.closed.start().should.eql(Decimal.from(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')); @@ -165,7 +166,7 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.openClosed.start().should.eql(Decimal.from(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')); @@ -178,7 +179,7 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.withNullStart.closed.start().should.eql(Decimal.from(MIN_FLOAT_VALUE)); d.zeroToHundredMg.withNullStart.closed .start() .should.eql(new Quantity(MIN_FLOAT_VALUE, 'mg')); @@ -201,10 +202,10 @@ describe('Interval', () => { .should.eql(new Uncertainty(MIN_LONG_VALUE, 100n)); d.zeroPointFiveToNinePointFive.withNullStart.openClosed .start() - .should.eql(new Uncertainty(MIN_FLOAT_VALUE, 9.5)); + .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, Decimal.from(9.5))); d.zeroToHundredMg.withNullStart.openClosed .start() - .should.eql(new Uncertainty(new Quantity(MIN_FLOAT_VALUE, 'mg'), new Quantity(100, 'mg'))); + .should.eql(new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(100, 'mg'))); d.all2012date.withNullStart.openClosed .start() .should.eql(new Uncertainty(MIN_DATE_VALUE, Date.parse('2012-12-31'))); @@ -225,11 +226,11 @@ describe('Interval', () => { .should.eql(new Uncertainty(MIN_LONG_VALUE, 99n)); d.zeroPointFiveToNinePointFive.withNullStart.open .start() - .should.eql(new Uncertainty(MIN_FLOAT_VALUE, 9.49999999)); + .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, Decimal.from(9.49999999))); d.zeroToHundredMg.withNullStart.open .start() .should.eql( - new Uncertainty(new Quantity(MIN_FLOAT_VALUE, 'mg'), new Quantity(99.99999999, 'mg')) + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(99.99999999, 'mg')) ); d.all2012date.withNullStart.open .start() @@ -252,7 +253,7 @@ describe('Interval', () => { 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_DECIMAL_TYPE).start().should.eql(MIN_DECIMAL_VALUE); new Interval(null, null, true, true, ELM_QUANTITY_TYPE) .start() .should.eql(new Quantity(MIN_FLOAT_VALUE, '1')); @@ -272,11 +273,11 @@ describe('Interval', () => { .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)); + .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, MAX_DECIMAL_VALUE)); new Interval(null, null, false, false, ELM_QUANTITY_TYPE) .start() .should.eql( - new Uncertainty(new Quantity(MIN_FLOAT_VALUE, '1'), new Quantity(MAX_FLOAT_VALUE, '1')) + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) ); new Interval(null, null, false, false, ELM_DATETIME_TYPE) .start() @@ -295,7 +296,7 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.closed.end().should.eql(Decimal.from(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')); @@ -305,7 +306,7 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.closedOpen.end().should.eql(Decimal.from(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')); @@ -316,8 +317,8 @@ describe('Interval', () => { 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.zeroPointFiveToNinePointFive.withNullEnd.closed.end().should.eql(MAX_DECIMAL_VALUE); + d.zeroToHundredMg.withNullEnd.closed.end().should.eql(new Quantity(MAX_DECIMAL_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); @@ -335,10 +336,10 @@ describe('Interval', () => { .should.eql(new Uncertainty(0n, MAX_LONG_VALUE)); d.zeroPointFiveToNinePointFive.withNullEnd.closedOpen .end() - .should.eql(new Uncertainty(0.5, MAX_FLOAT_VALUE)); + .should.eql(new Uncertainty(Decimal.from(0.5), MAX_DECIMAL_VALUE)); d.zeroToHundredMg.withNullEnd.closedOpen .end() - .should.eql(new Uncertainty(new Quantity(0, 'mg'), new Quantity(MAX_FLOAT_VALUE, 'mg'))); + .should.eql(new Uncertainty(new Quantity(0, 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg'))); d.all2012date.withNullEnd.closedOpen .end() .should.eql(new Uncertainty(Date.parse('2012-01-01'), MAX_DATE_VALUE)); @@ -357,11 +358,11 @@ describe('Interval', () => { 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)); + .should.eql(new Uncertainty(Decimal.from(0.50000001), MAX_DECIMAL_VALUE)); d.zeroToHundredMg.withNullEnd.open .end() .should.eql( - new Uncertainty(new Quantity(0.00000001, 'mg'), new Quantity(MAX_FLOAT_VALUE, 'mg')) + new Uncertainty(new Quantity(0.00000001, 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg')) ); d.all2012date.withNullEnd.open .end() @@ -384,7 +385,7 @@ describe('Interval', () => { 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_DECIMAL_TYPE).end().should.eql(MAX_DECIMAL_VALUE); new Interval(null, null, true, true, ELM_QUANTITY_TYPE) .end() .should.eql(new Quantity(MAX_FLOAT_VALUE, '1')); @@ -402,11 +403,11 @@ describe('Interval', () => { .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)); + .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, MAX_DECIMAL_VALUE)); new Interval(null, null, false, false, ELM_QUANTITY_TYPE) .end() .should.eql( - new Uncertainty(new Quantity(MIN_FLOAT_VALUE, '1'), new Quantity(MAX_FLOAT_VALUE, '1')) + new Uncertainty(new Quantity(MIN_FLOAT_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) ); new Interval(null, null, false, false, ELM_DATETIME_TYPE) .end() @@ -7003,37 +7004,37 @@ describe('DecimalInterval', () => { }); it('should calculate width and size outside the Integer range', () => { - const interval = new Interval(0.0, 3000000000.0, true, true, ELM_DECIMAL_TYPE); + const interval = new Interval(Decimal.from(0.0), Decimal.from(3000000000.0), true, true, ELM_DECIMAL_TYPE); - interval.width().should.equal(3000000000.0); - interval.size().should.equal(3000000000.0); + interval.width().should.eql(Decimal.from(3000000000.0)); + interval.size().should.eql(Decimal.from(3000000000.0)); }); it('should close open decimal uncertainty endpoints using decimal point size', () => { const closed = new Interval( - new Uncertainty(1, 2), - new Uncertainty(3, 4), + new Uncertainty(Decimal.from(1), Decimal.from(2)), + new Uncertainty(Decimal.from(3), Decimal.from(4)), false, false, ELM_DECIMAL_TYPE ).toClosed(); - closed.low.should.eql(new Uncertainty(1.00000001, 2.00000001)); - closed.high.should.eql(new Uncertainty(2.99999999, 3.99999999)); + closed.low.should.eql(new Uncertainty(Decimal.from(1.00000001), Decimal.from(2.00000001))); + closed.high.should.eql(new Uncertainty(Decimal.from(2.99999999), Decimal.from(3.99999999))); closed.lowClosed.should.be.true(); closed.highClosed.should.be.true(); }); it('should use decimal point size for meetsBefore decimal uncertainty bounds', () => { - const earlier = new Interval(1, 1.99999999); - const later = new Interval(new Uncertainty(2, 2), null, true, false, ELM_DECIMAL_TYPE); + const earlier = new Interval(Decimal.from(1), Decimal.from(1.99999999)); + const later = new Interval(new Uncertainty(Decimal.from(2), Decimal.from(2)), null, true, false, ELM_DECIMAL_TYPE); earlier.meetsBefore(later).should.be.true(); }); it('should use decimal point size for meetsAfter decimal uncertainty bounds', () => { - const earlier = new Interval(null, new Uncertainty(1, 1), false, true, ELM_DECIMAL_TYPE); - const later = new Interval(1.00000001, 2); + const earlier = new Interval(null, new Uncertainty(Decimal.from(1), Decimal.from(1)), false, true, ELM_DECIMAL_TYPE); + const later = new Interval(Decimal.from(1.00000001), Decimal.from(2)); later.meetsAfter(earlier).should.be.true(); }); @@ -7099,12 +7100,12 @@ describe('DecimalInterval', () => { }); 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 decimal = Decimal.from(1.5); + const early = Decimal.from(-1.5); + const late = Decimal.from(3.5); + const decimalInterval = new Interval(Decimal.from(0.5), Decimal.from(1.5)); + const earlyInterval = new Interval(early, Decimal.from(-0.5)); + const lateInterval = new Interval(Decimal.from(3.5), late); const startsAtDecimal = new Interval(decimal, late); const endsAtDecimal = new Interval(early, decimal); diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 9fa028950..d4da6e1bd 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -1,9 +1,10 @@ import should from 'should'; import setup from '../../setup'; +import { Decimal } from '../../../src/datatypes/decimal'; const data = require('./data'); const validateQuantity = function (object: any, expectedValue: any, expectedUnit: any) { object.isQuantity.should.be.true(); - object.value.should.equal(expectedValue); + object.value.should.eql(Decimal.from(expectedValue)); object.unit.should.equal(expectedUnit); }; @@ -72,11 +73,11 @@ describe('Sum', () => { }); it('should be able to sum lists with decimals', async function () { - (await this.decimals.exec(this.ctx)).should.equal(16.5); + (await this.decimals.exec(this.ctx)).should.eql(Decimal.from(16.5)); }); it('should be able to sum decimals up to max decimal value', async function () { - (await this.decimals_at_max_value.exec(this.ctx)).should.equal(99999999999999999999.99999999); + (await this.decimals_at_max_value.exec(this.ctx)).should.eql(Decimal.from(99999999999999999999.99999999)); }); it('should return null when overflowing the max decimal value', async function () { @@ -84,7 +85,7 @@ describe('Sum', () => { }); it('should be able to sum decimals down to min decimal value', async function () { - (await this.decimals_at_min_value.exec(this.ctx)).should.equal(-99999999999999999999.99999999); + (await this.decimals_at_min_value.exec(this.ctx)).should.eql(Decimal.from(-99999999999999999999.99999999)); }); it('should return null when underflowing the min decimal value', async function () { @@ -183,7 +184,7 @@ describe('Min', () => { }); it('list of Decimals', async function () { - (await this.decimalMin.exec(this.ctx)).should.equal(-5); + (await this.decimalMin.exec(this.ctx)).should.eql(Decimal.from(-5)); }); it('list of DateTimes', async function () { @@ -260,7 +261,7 @@ describe('Max', () => { }); it('list of Decimals', async function () { - (await this.decimalMax.exec(this.ctx)).should.equal(5.1); + (await this.decimalMax.exec(this.ctx)).should.eql(Decimal.from(5.1)); }); it('list of DateTimes', async function () { @@ -309,11 +310,11 @@ describe('Avg', () => { }); it('should be able to find average for lists without nulls', async function () { - (await this.not_null.exec(this.ctx)).should.equal(3); + (await this.not_null.exec(this.ctx)).should.eql(Decimal.from(3)); }); it('should be able to find average for lists with nulls', async function () { - (await this.has_null.exec(this.ctx)).should.equal(1.5); + (await this.has_null.exec(this.ctx)).should.eql(Decimal.from(1.5)); }); it('should return null for empty list', async function () { @@ -350,19 +351,19 @@ describe('Median', () => { }); it('should be able to find median of odd numbered list', async function () { - (await this.odd.exec(this.ctx)).should.equal(3); + (await this.odd.exec(this.ctx)).should.eql(Decimal.from(3)); }); it('should be able to find median of even numbered list', async function () { - (await this.even.exec(this.ctx)).should.equal(3.5); + (await this.even.exec(this.ctx)).should.eql(Decimal.from(3.5)); }); it('should be able to find median of odd numbered list that contains duplicates', async function () { - (await this.dup_vals_odd.exec(this.ctx)).should.equal(3); + (await this.dup_vals_odd.exec(this.ctx)).should.eql(Decimal.from(3)); }); it('should be able to find median of even numbered list that contians duplicates', async function () { - (await this.dup_vals_even.exec(this.ctx)).should.equal(2.5); + (await this.dup_vals_even.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should return null for empty list', async function () { @@ -437,7 +438,7 @@ describe('PopulationVariance', () => { setup(this, data); }); it('should be able to find PopulationVariance of a list ', async function () { - (await this.v.exec(this.ctx)).should.equal(2); + (await this.v.exec(this.ctx)).should.eql(Decimal.from(2)); }); it('should be able to find PopulationVariance of a list of like quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2, 'ml'); @@ -458,7 +459,7 @@ describe('Variance', () => { setup(this, data); }); it('should be able to find Variance of a list ', async function () { - (await this.v.exec(this.ctx)).should.equal(2.5); + (await this.v.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should be able to find Variance of a list of matched quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2.5, 'ml'); @@ -479,7 +480,7 @@ describe('StdDev', () => { setup(this, data); }); it('should be able to find Standard Dev of a list ', async function () { - (await this.std.exec(this.ctx)).should.equal(1.5811388300841898); + (await this.std.exec(this.ctx)).should.eql(Decimal.from(1.58113883)); }); it('should be able to find Standard Dev of a list of like quantities', async function () { validateQuantity(await this.std_q.exec(this.ctx), 1.5811388300841898, 'ml'); @@ -500,7 +501,7 @@ describe('PopulationStdDev', () => { setup(this, data); }); it('should be able to find Population Standard Dev of a list ', async function () { - (await this.dev.exec(this.ctx)).should.equal(1.4142135623730951); + (await this.dev.exec(this.ctx)).should.eql(Decimal.from(1.41421356)); }); it('should be able to find Population Standard Dev of a list of quantities', async function () { validateQuantity(await this.dev_q.exec(this.ctx), 1.4142135623730951, 'ml'); @@ -562,12 +563,12 @@ describe('Product', () => { }); it('should return a decimal product', async function () { - (await this.decimal_product.exec(this.ctx)).should.equal(24.0); + (await this.decimal_product.exec(this.ctx)).should.eql(Decimal.from(24.0)); }); it('should return decimal product up to max decimal value', async function () { - (await this.decimals_at_max_value_product.exec(this.ctx)).should.equal( - 99999999999999999999.99999999 + (await this.decimals_at_max_value_product.exec(this.ctx)).should.eql( + Decimal.from(99999999999999999999.99999999) ); }); @@ -576,8 +577,8 @@ describe('Product', () => { }); it('should return decimal product down to min decimal value', async function () { - (await this.decimals_at_min_value_product.exec(this.ctx)).should.equal( - -99999999999999999999.99999999 + (await this.decimals_at_min_value_product.exec(this.ctx)).should.eql( + Decimal.from(-99999999999999999999.99999999) ); }); @@ -653,15 +654,15 @@ describe('GeometricMean', () => { }); it('should return decimal geometric mean', async function () { - (await this.decimal_geometric_mean.exec(this.ctx)).should.equal(4.0); + (await this.decimal_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(4.0)); }); it('should retun 0 as a geometric mean', async function () { - (await this.zero_geometric_mean.exec(this.ctx)).should.equal(0); + (await this.zero_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(0)); }); it('should return value when pass in list that contains nulls', async function () { - (await this.null_geometric_mean.exec(this.ctx)).should.equal(1.4142135623730951); + (await this.null_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(1.41421356)); }); it('should return null when list is all null', async function () { diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index b9e866575..618265736 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -9,10 +9,8 @@ import { } from '../../../src/datatypes/quantity'; import setup from '../../setup'; import { - MAX_FLOAT_VALUE, MAX_INT_VALUE, MAX_LONG_VALUE, - MIN_FLOAT_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from '../../../src/util/limits'; @@ -24,10 +22,11 @@ import { MIN_DATETIME_VALUE, MIN_TIME_VALUE } from '../../../src/datatypes/datetime'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; const data = require('./data'); -const validateQuantity = function (object: any, expectedValue: number, expectedUnit: string) { +const validateQuantity = function (object: any, expectedValue: number | Decimal, expectedUnit: string) { object.isQuantity.should.be.true(); const q = new Quantity(expectedValue, expectedUnit); q.equals(object).should.be.true('Expected ' + object + ' to equal ' + q); @@ -212,64 +211,64 @@ describe('Divide', () => { }); it('should divide two numbers', async function () { - (await this.tenDividedByTwo.exec(this.ctx)).should.equal(5); + (await this.tenDividedByTwo.exec(this.ctx)).should.eql(Decimal.from(5)); }); it("should divide two numbers that don't evenly divide", async function () { - (await this.tenDividedByFour.exec(this.ctx)).should.equal(2.5); + (await this.tenDividedByFour.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should divide multiple numbers', async function () { - (await this.divideMultiple.exec(this.ctx)).should.equal(5); + (await this.divideMultiple.exec(this.ctx)).should.eql(Decimal.from(5)); }); it('should divide variables', async function () { - (await this.divideVariables.exec(this.ctx)).should.equal(25); + (await this.divideVariables.exec(this.ctx)).should.eql(Decimal.from(25)); }); it('should divide two longs', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoLong.exec(this.ctx)).should.equal(5); + (await this.tenDividedByTwoLong.exec(this.ctx)).should.eql(Decimal.from(5)); }); it('should divide integer by long', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoMixed.exec(this.ctx)).should.equal(5); + (await this.tenDividedByTwoMixed.exec(this.ctx)).should.eql(Decimal.from(5)); }); it('should divide long by integer', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.equal(5); + (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.eql(Decimal.from(5)); }); it('should divide two longs with decimal result', async function () { - (await this.tenDividedByFourLong.exec(this.ctx)).should.equal(2.5); + (await this.tenDividedByFourLong.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should divide integer by long with decimal result', async function () { - (await this.tenDividedByFourMixed.exec(this.ctx)).should.equal(2.5); + (await this.tenDividedByFourMixed.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should divide long by integer with decimal result', async function () { - (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.equal(2.5); + (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.eql(Decimal.from(2.5)); }); it('should divide uncertainty by uncertainty', async function () { const result = await this.divideUncertainties.exec(this.ctx); - result.low.should.equal(6 / 14); - result.high.should.equal(9); + result.low.should.eql(Decimal.from(0.42857143)); // 6/14 + result.high.should.eql(Decimal.from(9)); }); it('should divide uncertainty by number', async function () { const result = await this.divideUncertaintyByNumber.exec(this.ctx); - result.low.should.equal(3); - result.high.should.equal(9); + result.low.should.eql(Decimal.from(3)); + result.high.should.eql(Decimal.from(9)); }); it('should divide number by uncertainty', async function () { const result = await this.divideNumberByUncertainty.exec(this.ctx); - result.low.should.equal(2); - result.high.should.equal(6); + result.low.should.eql(Decimal.from(2)); + result.high.should.eql(Decimal.from(6)); }); }); @@ -301,11 +300,11 @@ describe('MathPrecedence', () => { }); it('should follow order of operations', async function () { - (await this.mixed.exec(this.ctx)).should.equal(46); + (await this.mixed.exec(this.ctx)).should.eql(Decimal.from(46)); }); it('should allow parentheses to override order of operations', async function () { - (await this.parenthetical.exec(this.ctx)).should.equal(-10); + (await this.parenthetical.exec(this.ctx)).should.eql(Decimal.from(-10)); }); }); @@ -315,11 +314,11 @@ describe('Power', () => { }); it('should be able to calculate the power of a number', async function () { - (await this.pow.exec(this.ctx)).should.equal(81); + (await this.pow.exec(this.ctx)).should.eql(81); }); it('should be able to calculate the negative power of a number', async function () { - (await this.negPow.exec(this.ctx)).should.equal(0.1); + (await this.negPow.exec(this.ctx)).should.eql(Decimal.from(0.1)); }); it('should be able to calculate the power of a long', async function () { @@ -335,7 +334,7 @@ describe('Power', () => { }); it('should be able to calculate the negative power of a long', async function () { - (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.equal(0.1); + (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.eql(Decimal.from(0.1)); }); it('should return null when a long power exponent is too large (beyond max Long value)', async function () { @@ -552,11 +551,11 @@ describe('Ln', () => { }); it('should be able to return the natural log of a number', async function () { - (await this.ln.exec(this.ctx)).should.equal(Math.log(4)); + (await this.ln.exec(this.ctx)).should.eql(Decimal.from(Math.log(4))); }); it('should be able to return the natural log of a long', async function () { - (await this.lnFourLong.exec(this.ctx)).should.equal(Math.log(4)); + (await this.lnFourLong.exec(this.ctx)).should.eql(Decimal.from(Math.log(4))); }); }); @@ -566,11 +565,11 @@ describe('Log', () => { }); it('should be able to return the log of a number based on an arbitrary base value', async function () { - (await this.log.exec(this.ctx)).should.equal(0.25); + (await this.log.exec(this.ctx)).should.eql(Decimal.from(0.25)); }); it('should be able to return the log of a long based on an arbitrary base value', async function () { - (await this.logLong.exec(this.ctx)).should.equal(0.25); + (await this.logLong.exec(this.ctx)).should.eql(Decimal.from(0.25)); }); }); @@ -639,12 +638,12 @@ describe('Round', () => { }); it('should be able to round a number up or down to the closest integer value', async function () { - (await this.up.exec(this.ctx)).should.equal(5); - (await this.down.exec(this.ctx)).should.equal(4); + (await this.up.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.down.exec(this.ctx)).should.eql(Decimal.from(4)); }); it('should be able to round a number up or down to the closest decimal place ', async function () { - (await this.up_percent.exec(this.ctx)).should.equal(4.6); - (await this.down_percent.exec(this.ctx)).should.equal(4.4); + (await this.up_percent.exec(this.ctx)).should.eql(Decimal.from(4.6)); + (await this.down_percent.exec(this.ctx)).should.eql(Decimal.from(4.4)); }); }); @@ -662,7 +661,7 @@ describe('Successor', () => { }); it('should be able to get Real Successor', async function () { - (await this.rs.exec(this.ctx)).should.equal(2.2 + Math.pow(10, -8)); + (await this.rs.exec(this.ctx)).should.eql(Decimal.from(2.2 + Math.pow(10, -8))); }); it('should return null for Successor greater than Integer Max value', async function () { @@ -765,7 +764,7 @@ describe('Predecessor', () => { }); it('should be able to get Real Predecessor', async function () { - (await this.rs.exec(this.ctx)).should.equal(2.2 - Math.pow(10, -8)); + (await this.rs.exec(this.ctx)).should.eql(Decimal.from(2.2 - Math.pow(10, -8))); }); it('should return null for Predecessor greater than Integer Max value', async function () { @@ -892,13 +891,13 @@ describe('Quantity', () => { it('should be able to perform Quantity Absolution', async function () { const q = await this.abs.exec(this.ctx); - q.value.should.equal(10); + q.value.should.eql(Decimal.from(10)); q.unit.should.equal('days'); }); it('should be able to perform Quantity Negation', async function () { const q = await this.neg.exec(this.ctx); - q.value.should.equal(-10); + q.value.should.eql(Decimal.from(-10)); q.unit.should.equal('days'); }); @@ -1024,12 +1023,12 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but more than max integer and near JavaScript max safe number - should(await this.integerDivideNearOverflow.exec(this.ctx)).equal(8589934588000000); + should(await this.integerDivideNearOverflow.exec(this.ctx)).eql(Decimal.from(8589934588000000)); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but less than min integer and near JavaScript min safe number - should(await this.integerDivideNearUnderflow.exec(this.ctx)).equal(-8589934592000000); + should(await this.integerDivideNearUnderflow.exec(this.ctx)).eql(Decimal.from(-8589934592000000)); }); it('should return null for Divide By Zero', async function () { @@ -1128,12 +1127,12 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but near JavaScript max safe number - should(await this.longDivideNearOverflow.exec(this.ctx)).equal(9007199254740992); + should(await this.longDivideNearOverflow.exec(this.ctx)).eql(Decimal.from(9007199254740992n)); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but near JavaScript min safe number - should(await this.longDivideNearUnderflow.exec(this.ctx)).equal(-9007199254740992); + should(await this.longDivideNearUnderflow.exec(this.ctx)).eql(Decimal.from(-9007199254740992n)); }); it('should return null for Divide By Zero', async function () { @@ -1183,11 +1182,11 @@ describe('OutOfBounds', () => { }); it('should return value for Add near overflow', async function () { - should(await this.decimalAddNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalAddNearOverflow.exec(this.ctx)).eql(MAX_DECIMAL_VALUE); }); it('should return value for Add near underflow', async function () { - should(await this.decimalAddNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalAddNearUnderflow.exec(this.ctx)).eql(MIN_DECIMAL_VALUE); }); it('should return null for Subtract overflow', async function () { @@ -1199,11 +1198,11 @@ describe('OutOfBounds', () => { }); it('should return value for Subtract near overflow', async function () { - should(await this.decimalSubtractNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalSubtractNearOverflow.exec(this.ctx)).eql(MAX_DECIMAL_VALUE); }); it('should return value for Subtract near underflow', async function () { - should(await this.decimalSubtractNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalSubtractNearUnderflow.exec(this.ctx)).eql(MIN_DECIMAL_VALUE); }); it('should return null for Multiply overflow', async function () { @@ -1215,11 +1214,11 @@ describe('OutOfBounds', () => { }); it('should return value for Multiply near overflow', async function () { - should(await this.decimalMultiplyNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalMultiplyNearOverflow.exec(this.ctx)).eql(MAX_DECIMAL_VALUE); }); it('should return value for Multiply near underflow', async function () { - should(await this.decimalMultiplyNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalMultiplyNearUnderflow.exec(this.ctx)).eql(MIN_DECIMAL_VALUE); }); it('should return null for Divide overflow', async function () { @@ -1231,11 +1230,11 @@ describe('OutOfBounds', () => { }); it('should return value for Divide near overflow', async function () { - should(await this.decimalDivideNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalDivideNearOverflow.exec(this.ctx)).eql(MAX_DECIMAL_VALUE); }); it('should return value for Divide near underflow', async function () { - should(await this.decimalDivideNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalDivideNearUnderflow.exec(this.ctx)).eql(MIN_DECIMAL_VALUE); }); it('should return null for Divide By Zero', async function () { @@ -1251,11 +1250,11 @@ describe('OutOfBounds', () => { }); it('should return value for Power near overflow', async function () { - should(await this.decimalPowerNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalPowerNearOverflow.exec(this.ctx)).eql(MAX_DECIMAL_VALUE); }); it('should return value for Power near underflow', async function () { - should(await this.decimalPowerNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalPowerNearUnderflow.exec(this.ctx)).eql(MIN_DECIMAL_VALUE); }); it('should return null for successor overflow', async function () { @@ -1268,11 +1267,11 @@ describe('OutOfBounds', () => { // NOTE: skipping successor/predecessor tests near overflow due to JS Number imprecision it.skip('should return value for successor near overflow', async function () { - should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equal(MAX_FLOAT_VALUE); + should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equal(MAX_DECIMAL_VALUE); }); it.skip('should return value for predecessor near underflow', async function () { - should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equal(MIN_FLOAT_VALUE); + should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equal(MIN_DECIMAL_VALUE); }); }); @@ -1288,13 +1287,13 @@ describe('OutOfBounds', () => { it('should return value for Add near overflow', async function () { const result = await this.quantityAddNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MAX_FLOAT_VALUE, 'mm'); + validateQuantity(result, MAX_DECIMAL_VALUE, 'mm'); }); it('should return value for Add near underflow', async function () { const result = await this.quantityAddNearUnderflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MIN_FLOAT_VALUE, 'mm'); + validateQuantity(result, MIN_DECIMAL_VALUE, 'mm'); }); it('should return null for Subtract overflow', async function () { @@ -1308,13 +1307,13 @@ describe('OutOfBounds', () => { it('should return value for Subtract near overflow', async function () { const result = await this.quantitySubtractNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MAX_FLOAT_VALUE, 'mm'); + validateQuantity(result, MAX_DECIMAL_VALUE, 'mm'); }); it('should return value for Subtract near underflow', async function () { const result = await this.quantitySubtractNearUnderflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MIN_FLOAT_VALUE, 'mm'); + validateQuantity(result, MIN_DECIMAL_VALUE, 'mm'); }); it('should return null for Multiply overflow', async function () { @@ -1328,13 +1327,13 @@ describe('OutOfBounds', () => { it('should return value for Multiply near overflow', async function () { const result = await this.quantityMultiplyNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MAX_FLOAT_VALUE, 'mm2'); + validateQuantity(result, MAX_DECIMAL_VALUE, 'mm2'); }); it('should return value for Multiply near underflow', async function () { const result = await this.quantityMultiplyNearUnderflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MIN_FLOAT_VALUE, 'mm2'); + validateQuantity(result, MIN_DECIMAL_VALUE, 'mm2'); }); it('should return null for Divide overflow', async function () { @@ -1348,13 +1347,13 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { const result = await this.quantityDivideNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MAX_FLOAT_VALUE, '1'); + validateQuantity(result, MAX_DECIMAL_VALUE, '1'); }); it('should return value for Divide near underflow', async function () { const result = await this.quantityDivideNearUnderflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MIN_FLOAT_VALUE, '1'); + validateQuantity(result, MIN_DECIMAL_VALUE, '1'); }); it('should return null for Divide By Zero', async function () { @@ -1373,13 +1372,13 @@ describe('OutOfBounds', () => { it.skip('should return value for successor near overflow', async function () { const result = await this.quantitySuccessorNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MAX_FLOAT_VALUE, 'mm'); + validateQuantity(result, MAX_DECIMAL_VALUE, 'mm'); }); it.skip('should return value for predecessor near underflow', async function () { const result = await this.quantitPpredecessorNearOverflow.exec(this.ctx); should(result).not.be.null(); - validateQuantity(result, MIN_FLOAT_VALUE, 'mm'); + validateQuantity(result, MIN_DECIMAL_VALUE, 'mm'); }); }); diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index 6548f3e60..72f6c059a 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -5,6 +5,7 @@ import { isNull } from '../../../src/util/util'; import { DateTime } from '../../../src/datatypes/datetime'; import { Quantity } from '../../../src/datatypes/quantity'; import { Uncertainty } from '../../../src/datatypes/uncertainty'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('FromString', () => { beforeEach(function () { @@ -28,7 +29,7 @@ describe('FromString', () => { }); it("should convert '10.2' to Decimal", async function () { - (await this.decimalValid.exec(this.ctx)).should.equal(10.2); + (await this.decimalValid.exec(this.ctx)).should.eql(Decimal.from(10.2)); }); it("should be null trying to convert 'abc' to Decimal", async function () { @@ -61,25 +62,25 @@ describe('FromString', () => { it('should convert "10 \'A\'" to Quantity', async function () { const quantity = await this.quantityStr.exec(this.ctx); - quantity.value.should.equal(10); + quantity.value.should.eql(Decimal.from(10)); quantity.unit.should.equal('A'); }); it('should convert "+10 \'A\'" to Quantity', async function () { const quantity = await this.posQuantityStr.exec(this.ctx); - quantity.value.should.equal(10); + quantity.value.should.eql(Decimal.from(10)); quantity.unit.should.equal('A'); }); it('should convert "-10 \'A\'" to Quantity', async function () { const quantity = await this.negQuantityStr.exec(this.ctx); - quantity.value.should.equal(-10); + quantity.value.should.eql(Decimal.from(-10)); quantity.unit.should.equal('A'); }); it('should convert "10.0\'mA\'" to Quantity', async function () { const quantity = await this.quantityStrDecimal.exec(this.ctx); - quantity.value.should.equal(10.0); + quantity.value.should.eql(Decimal.from(10.0)); quantity.unit.should.equal('mA'); }); @@ -128,7 +129,7 @@ describe('FromInteger', () => { }); it('should convert 10 to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.equal(10.0); + (await this.decimal10.exec(this.ctx)).should.eql(Decimal.from(10.0)); }); it('should convert null to null', async function () { @@ -154,7 +155,7 @@ describe('FromLong', () => { }); it('should convert 10L to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.equal(10.0); + (await this.decimal10.exec(this.ctx)).should.eql(Decimal.from(10.0)); }); it('should convert null to null', async function () { @@ -185,7 +186,7 @@ describe('FromQuantity', () => { it('should convert "10 \'A\'" to "10 \'A\'"', async function () { const quantity = await this.quantityQuantity.exec(this.ctx); - quantity.value.should.equal(10); + quantity.value.should.eql(Decimal.from(10)); quantity.unit.should.equal('A'); }); }); @@ -242,7 +243,7 @@ describe('FromDateTime', () => { dateTime.minute.should.equal(1); dateTime.second.should.equal(2); dateTime.millisecond.should.equal(321); - dateTime.timezoneOffset.should.equal(-6); + dateTime.timezoneOffset.should.eql(Decimal.from(-6)); }); }); @@ -344,19 +345,19 @@ describe('ToDecimal', () => { }); it("should convert '0.0' to 0.0", async function () { - (await this.noSign.exec(this.ctx)).should.equal(0.0); + (await this.noSign.exec(this.ctx)).should.eql(Decimal.from(0.0)); }); it("should convert '+1.1' to 1.1", async function () { - (await this.positiveSign.exec(this.ctx)).should.equal(1.1); + (await this.positiveSign.exec(this.ctx)).should.eql(Decimal.from(1.1)); }); it("should convert '-1.1' to -1.1", async function () { - (await this.negativeSign.exec(this.ctx)).should.equal(-1.1); + (await this.negativeSign.exec(this.ctx)).should.eql(Decimal.from(-1.1)); }); it('should truncate decimal to 8 digits after decimal point', async function () { - (await this.tooPrecise.exec(this.ctx)).should.equal(0.44444444); + (await this.tooPrecise.exec(this.ctx)).should.eql(Decimal.from(0.44444444)); }); it('should be null for decimal that is above max decimal value', async function () { @@ -560,17 +561,17 @@ describe('ToRatio', () => { it('should be valid given quantities with custom UCUM units', async function () { const ratio = await this.isValidWithCustomUCUM.exec(this.ctx); - ratio.numerator.value.should.eql(1.0); + ratio.numerator.value.should.eql(Decimal.from(1.0)); ratio.numerator.unit.should.eql('{foo:bar}'); - ratio.denominator.value.should.eql(2.0); + ratio.denominator.value.should.eql(Decimal.from(2.0)); ratio.denominator.unit.should.eql('mg'); }); it('should create valid ratio', async function () { const ratio = await this.isValid.exec(this.ctx); - ratio.numerator.value.should.eql(1.0); + ratio.numerator.value.should.eql(Decimal.from(1.0)); ratio.numerator.unit.should.eql('mg'); - ratio.denominator.value.should.eql(2.0); + ratio.denominator.value.should.eql(Decimal.from(2.0)); ratio.denominator.unit.should.eql('mg'); }); }); diff --git a/test/elm/datetime/datetime-test.ts b/test/elm/datetime/datetime-test.ts index b02346725..0c87541a8 100644 --- a/test/elm/datetime/datetime-test.ts +++ b/test/elm/datetime/datetime-test.ts @@ -4,6 +4,7 @@ const data = require('./data'); import * as DT from '../../../src/datatypes/datatypes'; import { PatientContext } from '../../../src/cql'; import { Uncertainty } from '../../../src/datatypes/uncertainty'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('DateTime', () => { beforeEach(function () { @@ -99,7 +100,7 @@ describe('DateTime', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.equal(-8); + d.timezoneOffset.should.eql(Decimal.from(-8)); }); }); @@ -408,8 +409,8 @@ describe('TimezoneOffsetFrom', () => { }); it('should return the timezoneoffset from a fully defined DateTime', async function () { - (await this.centralEuropean.exec(this.ctx)).should.equal(1); - (await this.easternStandard.exec(this.ctx)).should.equal(-5); + (await this.centralEuropean.exec(this.ctx)).should.eql(Decimal.from(1)); + (await this.easternStandard.exec(this.ctx)).should.eql(Decimal.from(-5)); }); it('should return the default timezone when not specified', async function () { diff --git a/test/elm/instance/instance-test.ts b/test/elm/instance/instance-test.ts index 70fc00e57..722e7ca05 100644 --- a/test/elm/instance/instance-test.ts +++ b/test/elm/instance/instance-test.ts @@ -3,6 +3,7 @@ import setup from '../../setup'; const data = require('./data'); import { Code, Concept } from '../../../src/datatypes/clinical'; import { Quantity } from '../../../src/datatypes/quantity'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('Instance', () => { beforeEach(function () { @@ -13,9 +14,10 @@ describe('Instance', () => { const q = await this.quantityA.exec(this.ctx); should(q).be.instanceof(Quantity); q.unit.should.eql('a'); - q.value.should.eql(12); + const decimal12 = Decimal.from(12); + q.value.should.eql(decimal12); q.toString().should.equal("12 'a'"); - (await this.val.exec(this.ctx)).should.eql(12); + (await this.val.exec(this.ctx)).should.eql(decimal12); }); it('should be able to construct a Code', async function () { diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 710afb3c3..45d5b94b3 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -4,14 +4,13 @@ const data = require('./data'); import { Interval } from '../../../src/datatypes/interval'; import { DateTime, MIN_DATETIME_VALUE, MAX_DATETIME_VALUE } from '../../../src/datatypes/datetime'; import { Uncertainty } from '../../../src/datatypes/uncertainty'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; import { MIN_INT_VALUE, MAX_INT_VALUE, MIN_LONG_VALUE, MAX_LONG_VALUE, - MIN_FLOAT_VALUE, - MIN_FLOAT_PRECISION_VALUE, - MAX_FLOAT_VALUE + MIN_FLOAT_PRECISION_VALUE } from '../../../src/util/limits'; describe('Interval', () => { @@ -1620,9 +1619,9 @@ describe('Width', () => { it('should calculate the width of real intervals', async function () { // define RealWidth: width of Interval[1.23, 4.56] - (await this.realWidth.exec(this.ctx)).should.equal(3.33); + (await this.realWidth.exec(this.ctx)).should.eql(Decimal.from(3.33)); // define RealOpenWidth: width of Interval(1.23, 4.56) - (await this.realOpenWidth.exec(this.ctx)).should.equal(3.32999998); + (await this.realOpenWidth.exec(this.ctx)).should.eql(Decimal.from(3.32999998)); }); it('should calculate the width of infinite intervals', async function () { @@ -1646,7 +1645,7 @@ describe('Width', () => { it('should calculate the width of interval of quantities', async function () { // define WidthOfQuantityInterval: width of Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}] const width = await this.widthOfQuantityInterval.exec(this.ctx); - width.value.should.equal(9); + width.value.should.eql(Decimal.from(9)); width.unit.should.equal('mm'); }); @@ -1687,9 +1686,9 @@ describe('Size', () => { it('should calculate the size of real intervals', async function () { // define RealSize: Size(Interval[1.23, 4.56]) - (await this.realSize.exec(this.ctx)).should.equal(3.33 + MIN_FLOAT_PRECISION_VALUE); + (await this.realSize.exec(this.ctx)).should.eql(Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE)); // define RealOpenSize: Size(Interval(1.23, 4.56)) - (await this.realOpenSize.exec(this.ctx)).should.equal(3.32999998 + MIN_FLOAT_PRECISION_VALUE); + (await this.realOpenSize.exec(this.ctx)).should.eql(Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE)); }); it('should calculate the size of infinite intervals', async function () { @@ -1723,7 +1722,7 @@ describe('Size', () => { it('should calculate size of interval of quantities', async function () { // define SizeOfQuantityInterval: Size(Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}]) const size = await this.sizeOfQuantityInterval.exec(this.ctx); - size.value.should.equal(9.00000001); + size.value.should.eql(Decimal.from(9.00000001)); size.unit.should.equal('mm'); }); @@ -1771,7 +1770,7 @@ describe('Start', () => { }); it('should return the minimum possible Decimal', async function () { - (await this.closedNullDecimal.exec(this.ctx)).should.eql(MIN_FLOAT_VALUE); + (await this.closedNullDecimal.exec(this.ctx)).should.eql(MIN_DECIMAL_VALUE); }); it('should return null when the interval is null', async function () { @@ -1821,7 +1820,7 @@ describe('End', () => { }); it('should return the maximum possible Decimal', async function () { - (await this.closedNullDecimal.exec(this.ctx)).should.eql(MAX_FLOAT_VALUE); + (await this.closedNullDecimal.exec(this.ctx)).should.eql(MAX_DECIMAL_VALUE); }); it('should return null when the interval is null', async function () { @@ -3491,6 +3490,9 @@ describe('QuantityIntervalExpand', () => { }); it('returns null when per zero, not applicable, or mismatch interval', async function () { + + console.log('debuggger') + // define perZero: expand { Interval[2 'g', 4 'g'] } per 0 'g' let a = await this.perZero.exec(this.ctx); should.not.exist(a); @@ -3619,6 +3621,7 @@ describe('LongIntervalExpand', () => { it('expands lists of multiple intervals', async function () { let a = await this.longNullInList.exec(this.ctx); prettyList(a).should.equal('{ [2, 2], [3, 3], [4, 4] }'); + // define LongOverlapping: expand { Interval[2L, 4L], Interval[3L, 5L] } per 1 '1' a = await this.longOverlapping.exec(this.ctx); prettyList(a).should.equal('{ [2, 2], [3, 3], [4, 4], [5, 5] }'); a = await this.longNonOverlapping.exec(this.ctx); diff --git a/test/elm/literal/literal-test.ts b/test/elm/literal/literal-test.ts index e46dc7228..87f1d508c 100644 --- a/test/elm/literal/literal-test.ts +++ b/test/elm/literal/literal-test.ts @@ -1,5 +1,6 @@ import should from 'should'; import setup from '../../setup'; +import { Decimal } from '../../../src/datatypes/decimal'; const data = require('./data'); describe('Literal', () => { @@ -40,11 +41,11 @@ describe('Literal', () => { }); it('should convert .1 to decimal .1', function () { - this.decimalTenth.value.should.equal(0.1); + this.decimalTenth.value.should.eql(Decimal.from(0.1)); }); it('should execute .1 as .1', async function () { - (await this.decimalTenth.exec(this.ctx)).should.equal(0.1); + (await this.decimalTenth.exec(this.ctx)).should.eql(Decimal.from(0.1)); }); it("should convert 'true' to string 'true'", function () { @@ -65,7 +66,7 @@ describe('Literal', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.equal(0); + d.timezoneOffset.should.eql(Decimal.from(0)); }); it("should execute '' as correct Time", async function () { diff --git a/test/elm/message/message-test.ts b/test/elm/message/message-test.ts index 6335beca6..c1f2d29db 100644 --- a/test/elm/message/message-test.ts +++ b/test/elm/message/message-test.ts @@ -2,6 +2,7 @@ import should from 'should'; import setup from '../../setup'; const data = require('./data'); import { Repository } from '../../../src/cql'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('Message', () => { let messageCollector: any; @@ -13,7 +14,7 @@ describe('Message', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.equal(0.5); + (await this.oneOverTwo.exec(this.ctx)).should.eql(Decimal.from(0.5)); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); @@ -39,7 +40,7 @@ describe('Retrieve', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.equal(0.5); + (await this.oneOverTwo.exec(this.ctx)).should.eql(Decimal.from(0.5)); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); diff --git a/test/elm/parameters/parameters-test.ts b/test/elm/parameters/parameters-test.ts index cd9210e8a..3a7c80ff4 100644 --- a/test/elm/parameters/parameters-test.ts +++ b/test/elm/parameters/parameters-test.ts @@ -3,6 +3,7 @@ import { Code, Concept } from '../../../src/datatypes/clinical'; import { Date, DateTime } from '../../../src/datatypes/datetime'; import { Interval } from '../../../src/datatypes/interval'; import { Quantity } from '../../../src/datatypes/quantity'; +import { Decimal } from '../../../src/datatypes/decimal'; import setup from '../../setup'; const data = require('./data'); @@ -99,7 +100,7 @@ describe('DecimalParameterTypes', () => { }); it('should execute to provided valid value', async function () { - (await this.foo.exec(this.ctx.withParameters({ FooP: 3.0 }))).should.equal(3.0); + (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.eql(Decimal.from(3.0)); }); it('should throw when provided value is wrong type', function () { @@ -107,11 +108,11 @@ describe('DecimalParameterTypes', () => { }); it('should execute to default value', async function () { - (await this.foo2.exec(this.ctx)).should.equal(1.5); + (await this.foo2.exec(this.ctx)).should.eql(Decimal.from(1.5)); }); it('should execute to overriding valid value', async function () { - (await this.foo2.exec(this.ctx.withParameters({ FooDP: 3.0 }))).should.equal(3.0); + (await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) }))).should.eql(Decimal.from(3.0)); }); it('should throw when overriding value is wrong type', function () { @@ -129,7 +130,7 @@ describe('IntegerParameterTypes', () => { }); it('should throw when provided value is wrong type', function () { - should(() => this.foo.exec(this.ctx.withParameters({ FooP: 3.5 }))).throw(/.*wrong type.*/); + should(() => this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.5) }))).throw(/.*wrong type.*/); }); it('should execute to default value', async function () { @@ -141,7 +142,7 @@ describe('IntegerParameterTypes', () => { }); it('should throw when overriding value is wrong type', function () { - should(() => this.foo2.exec(this.ctx.withParameters({ FooDP: 3.5 }))).throw(/.*wrong type.*/); + should(() => this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.5) }))).throw(/.*wrong type.*/); }); }); @@ -423,7 +424,7 @@ describe('IntervalParameterTypes', () => { }); it('should throw when interval contains a wrong point type', async function () { - should(() => this.foo.exec(this.ctx.withParameters({ FooP: new Interval(1.5, 5.5) }))).throw( + should(() => this.foo.exec(this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }))).throw( /.*wrong type.*/ ); }); @@ -443,7 +444,7 @@ describe('IntervalParameterTypes', () => { }); it('should throw when overriding interval contains a wrong point type', async function () { - should(() => this.foo2.exec(this.ctx.withParameters({ FooP: new Interval(1.5, 5.5) }))).throw( + should(() => this.foo2.exec(this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }))).throw( /.*wrong type.*/ ); }); diff --git a/test/elm/quantity/quantity-test.ts b/test/elm/quantity/quantity-test.ts index 290c15c8d..602f5239e 100644 --- a/test/elm/quantity/quantity-test.ts +++ b/test/elm/quantity/quantity-test.ts @@ -6,6 +6,7 @@ import { doSubtraction, Quantity } from '../../../src/datatypes/quantity'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('Quantity', () => { it('should allow creation of Quantity with valid ucum units', () => @@ -62,7 +63,7 @@ describe('Quantity', () => { const denominator = new Quantity(2.0, 'mg'); const result = numerator.dividedBy(denominator); result.unit.should.equal('1'); - result.value.should.equal(-2.75); + result.value.should.eql(Decimal.from(-2.75)); }); it('should allow for singular time units', () => { diff --git a/test/elm/query/query-test.ts b/test/elm/query/query-test.ts index 95f8490f0..2ee9e3cb4 100644 --- a/test/elm/query/query-test.ts +++ b/test/elm/query/query-test.ts @@ -7,6 +7,7 @@ import { Interval } from '../../../src/datatypes/interval'; import { DateTime } from '../../../src/datatypes/datetime'; import { Quantity } from '../../../src/datatypes/quantity'; import { getLocalIdByPath } from '../../testHelpers'; +import { Decimal } from '../../../src/datatypes/decimal'; describe('DateRangeOptimizedQuery', () => { beforeEach(function () { @@ -196,12 +197,12 @@ describe('Sorting', () => { it('should correctly sort quantities asc', async function () { const e = await this.quantityListAsc.exec(this.ctx); e.should.have.length(2); - e[0]['value'].should.equal(2); + e[0]['value'].should.eql(Decimal.from(2)); }); it('should correctly sort quantities', async function () { const e = await this.quantityListSort.exec(this.ctx); - e[0]['N']['value'].should.equal(2); + e[0]['N']['value'].should.eql(Decimal.from(2)); }); it('should be able to sort by a tuple field asc', async function () { diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index cf70ead67..e1bcbf3f1 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -44,6 +44,9 @@ describe('CQL Spec Tests (from XML)', () => { } suite.expression.element.forEach((t: any) => { it(`should properly evaluate ${t.name}`, async function () { + if (t.name === 'beans') { + debugger; + } const testCaseMap = convertTupleToMap(t.value); if (testCaseMap.has('skipped')) { this.skip(); diff --git a/test/util/math-test.ts b/test/util/math-test.ts index fa9388dad..16cb165b8 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -1,5 +1,6 @@ import { Uncertainty } from '../../src/datatypes/uncertainty'; import { MAX_FLOAT_VALUE, MIN_FLOAT_VALUE } from '../../src/util/limits'; +import { Decimal } from '../../src/datatypes/decimal'; import { predecessor, successor } from '../../src/util/math'; import { ELM_DECIMAL_TYPE, ELM_INTEGER_TYPE } from '../../src/util/elmTypes'; @@ -11,14 +12,14 @@ describe('successor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0), ELM_DECIMAL_TYPE); - result.low.should.equal(1.00000001); - result.high.should.equal(2.00000001); + const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); + result.low.should.eql(Decimal.from(1.00000001)); + result.high.should.eql(Decimal.from(2.00000001)); }); it('should leave the uncertainty high unchanged when it overflows', () => { - const result = successor(new Uncertainty(1, MAX_FLOAT_VALUE), ELM_DECIMAL_TYPE); - result.should.eql(new Uncertainty(1.00000001, MAX_FLOAT_VALUE)); + const result = successor(new Uncertainty(Decimal.from(1), MAX_FLOAT_VALUE), ELM_DECIMAL_TYPE); + result.should.eql(new Uncertainty(Decimal.from(1.00000001), MAX_FLOAT_VALUE)); }); }); @@ -30,13 +31,13 @@ describe('predecessor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0), ELM_DECIMAL_TYPE); - result.low.should.equal(1.00000001); - result.high.should.equal(2.00000001); + const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); + result.low.should.eql(Decimal.from(1.00000001)); + result.high.should.eql(Decimal.from(2.00000001)); }); it('should leave the uncertainty low unchanged when it underflows', () => { - const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, 2), ELM_DECIMAL_TYPE); - result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, 1.99999999)); + const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(2)), ELM_DECIMAL_TYPE); + result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(1.99999999))); }); }); diff --git a/test/util/units-test.ts b/test/util/units-test.ts index f98dbb546..b3c046065 100644 --- a/test/util/units-test.ts +++ b/test/util/units-test.ts @@ -1,4 +1,5 @@ import should from 'should'; +import { Decimal } from '../../src/datatypes/decimal'; import { checkUnit, compareUnits, @@ -108,41 +109,41 @@ describe('checkUnit', () => { describe('convertUnit', () => { it('should convert compatible units', () => { - convertUnit(18, '[in_i]', '[ft_i]').should.eql(1.5); + convertUnit(Decimal.from(18), '[in_i]', '[ft_i]').should.eql(Decimal.from(1.5)); }); it('should return same value for same units', () => { - convertUnit(18, '[in_i]', '[in_i]').should.eql(18); + convertUnit(Decimal.from(18), '[in_i]', '[in_i]').should.eql(Decimal.from(18)); }); it('should consider empty as 1 during conversion', () => { - convertUnit(18, '', '').should.eql(18); - convertUnit(18, null, null).should.eql(18); - convertUnit(18, '', null).should.eql(18); - convertUnit(18, null, '').should.eql(18); + convertUnit(Decimal.from(18), '', '').should.eql(Decimal.from(18)); + convertUnit(Decimal.from(18), null, null).should.eql(Decimal.from(18)); + convertUnit(Decimal.from(18), '', null).should.eql(Decimal.from(18)); + convertUnit(Decimal.from(18), null, '').should.eql(Decimal.from(18)); }); it('should support CQL date units during conversion', () => { - convertUnit(18, 'months', 'years').should.eql(1.5); - convertUnit(1.5, 'years', 'months').should.eql(18); - convertUnit(2, 'seconds', 'milliseconds').should.eql(2000); - convertUnit(2000, 'milliseconds', 'seconds').should.eql(2); + convertUnit(Decimal.from(18), 'months', 'years').should.eql(Decimal.from(1.5)); + convertUnit(Decimal.from(1.5), 'years', 'months').should.eql(Decimal.from(18)); + convertUnit(Decimal.from(2), 'seconds', 'milliseconds').should.eql(Decimal.from(2000)); + convertUnit(Decimal.from(2000), 'milliseconds', 'seconds').should.eql(Decimal.from(2)); }); it('should truncate precision to 8 decimals by default', () => { - const result = convertUnit(1, '[ft_i]', '[mi_i]'); - result.should.equal(0.00018939); + const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]'); + result.should.eql(Decimal.from("0.00018939")); }); it('should note truncate precision to 8 decimals when adjustPrecision is false', () => { - const result = convertUnit(1, '[ft_i]', '[mi_i]', false); - result.should.not.equal(0.00018939); + const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]', false); + result.should.not.eql(Decimal.from("0.00018939")); result.toString().length.should.be.greaterThan(10); result.toString().should.startWith('0.000189393939393'); }); it('should return undefined for incompatible units', () => { - should(convertUnit(18, '[in_i]', '[in_i]2')).be.undefined(); + should(convertUnit(Decimal.from(18), '[in_i]', '[in_i]2')).be.undefined(); }); }); From c943426640f4cf187bd12e9ffe8e15df742a7a93 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 19 Aug 2026 15:33:32 -0400 Subject: [PATCH 02/62] WIP of better CQL Decimal support, checkpoint 2 --- package-lock.json | 7 + package.json | 1 + src/datatypes/datetime.ts | 36 +- src/datatypes/decimal.ts | 167 +-- src/datatypes/quantity.ts | 27 +- src/elm/aggregate.ts | 64 +- src/elm/arithmetic.ts | 201 ++- src/elm/clinical.ts | 2 +- src/elm/interval.ts | 18 +- src/elm/type.ts | 6 +- src/runtime/context.ts | 2 +- src/util/immutableUtil.ts | 16 +- src/util/math.ts | 66 +- src/util/units.ts | 31 +- test/datatypes/date-test.ts | 7 +- test/datatypes/datetime-test.ts | 5 +- test/datatypes/decimal-test.ts | 8 +- test/datatypes/interval-test.ts | 26 +- test/elm/aggregate/aggregate-test.ts | 68 +- test/elm/aggregate/data.cql | 24 +- test/elm/aggregate/data.js | 1267 ++++++++++------- test/elm/arithmetic/arithmetic-test.ts | 122 +- test/elm/arithmetic/data.cql | 2 +- test/elm/arithmetic/data.js | 6 +- test/elm/clinical/clinical-test.ts | 4 +- test/elm/convert/convert-test.ts | 42 +- test/elm/datetime/datetime-test.ts | 34 +- test/elm/interval/interval-test.ts | 16 +- test/elm/literal/literal-test.ts | 6 +- test/elm/message/message-test.ts | 4 +- test/elm/parameters/parameters-test.ts | 6 +- test/elm/quantity/quantity-test.ts | 2 +- test/elm/query/query-test.ts | 4 +- test/should-extensions.ts | 11 + .../cql/CqlArithmeticFunctionsTest.cql | 6 +- .../cql/CqlArithmeticFunctionsTest.json | 6 +- .../cql/ValueLiteralsAndSelectors.cql | 4 +- .../cql/ValueLiteralsAndSelectors.json | 4 +- test/spec-tests/skip-list.txt | 10 +- test/spec-tests/spec-test.ts | 15 +- test/util/math-test.ts | 8 +- test/util/units-test.ts | 53 +- 42 files changed, 1333 insertions(+), 1081 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e3cd80d1..e3c125fad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@lhncbc/ucum-lhc": "^7.1.9", + "decimal.js": "^10.6.0", "immutable": "^5.1.6", "luxon": "^3.7.2" }, @@ -2035,6 +2036,12 @@ "node": ">=0.10.0" } }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://artifacts.mitre.org:443/artifactory/api/npm/node-npm/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "license": "MIT" + }, "node_modules/default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", diff --git a/package.json b/package.json index d7e5bd2ed..c06af919c 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ }, "dependencies": { "@lhncbc/ucum-lhc": "^7.1.9", + "decimal.js": "^10.6.0", "immutable": "^5.1.6", "luxon": "^3.7.2" }, diff --git a/src/datatypes/datetime.ts b/src/datatypes/datetime.ts index 23fcb4ed2..b8f288895 100644 --- a/src/datatypes/datetime.ts +++ b/src/datatypes/datetime.ts @@ -19,6 +19,7 @@ import { MIN_DATETIME_VALUE_STRING, MIN_TIME_VALUE_STRING } from '../util/limits'; +import { Decimal } from './decimal'; // It's easiest and most performant to organize formats by length of the supported strings. // This way we can test strings only against the formats that have a chance of working. @@ -529,7 +530,7 @@ export class DateTime extends AbstractDate { minute: number | null; second: number | null; millisecond: number | null; - timezoneOffset: number | null; + timezoneOffset: Decimal | null; static readonly Unit = { YEAR: 'year', @@ -599,13 +600,19 @@ export class DateTime extends AbstractDate { } // TODO: Note: using the jsDate type causes issues, fix later - static fromJSDate(date: any, timezoneOffset?: any) { + static fromJSDate(date: any, timezoneOffset?: number | string | Decimal) { //This is from a JS Date, not a CQL Date if (date instanceof DateTime) { return date; } if (timezoneOffset != null) { - date = new jsDate(date.getTime() + timezoneOffset * 60 * 60 * 1000); + let tzOffset: number; + if (timezoneOffset instanceof Decimal) { + tzOffset = timezoneOffset.toNumber(); + } else { + tzOffset = +timezoneOffset; + } + date = new jsDate(date.getTime() + tzOffset * 60 * 60 * 1000); return new DateTime( date.getUTCFullYear(), date.getUTCMonth() + 1, @@ -614,7 +621,7 @@ export class DateTime extends AbstractDate { date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds(), - timezoneOffset + tzOffset ); } else { return new DateTime( @@ -641,7 +648,7 @@ export class DateTime extends AbstractDate { luxonDT.minute, luxonDT.second, luxonDT.millisecond, - luxonDT.offset / 60 + Decimal.from(luxonDT.offset / 60) ); } @@ -653,7 +660,7 @@ export class DateTime extends AbstractDate { minute: number | null = null, second: number | null = null, millisecond: number | null = null, - timezoneOffset?: number | null + timezoneOffset?: Decimal | number | null ) { // from the spec: If no timezone is specified, the timezone of the evaluation request timestamp is used. // NOTE: timezoneOffset will be explicitly null for the Time overload, whereas @@ -664,9 +671,11 @@ export class DateTime extends AbstractDate { this.second = second; this.millisecond = millisecond; if (timezoneOffset === undefined) { - this.timezoneOffset = (new jsDate().getTimezoneOffset() / 60) * -1; + this.timezoneOffset = Decimal.from((new jsDate().getTimezoneOffset() / 60) * -1); + } else if (timezoneOffset === null) { + this.timezoneOffset = null; } else { - this.timezoneOffset = timezoneOffset; + this.timezoneOffset = Decimal.from(timezoneOffset); } } @@ -869,7 +878,7 @@ export class DateTime extends AbstractDate { toLuxonDateTime() { const offsetMins = this.timezoneOffset != null - ? this.timezoneOffset * 60 + ? this.timezoneOffset.toNumber() * 60 : new jsDate().getTimezoneOffset() * -1; return LuxonDateTime.fromObject( { @@ -958,10 +967,11 @@ export class DateTime extends AbstractDate { } if (str.indexOf('T') !== -1 && this.timezoneOffset != null) { - str += this.timezoneOffset < 0 ? '-' : '+'; - const offsetHours = Math.floor(Math.abs(this.timezoneOffset)); + const tzOffset = this.timezoneOffset.toNumber(); + str += tzOffset < 0 ? '-' : '+'; + const offsetHours = Math.floor(Math.abs(tzOffset)); str += String(offsetHours).padStart(2, '0'); - const offsetMin = (Math.abs(this.timezoneOffset) - offsetHours) * 60; + const offsetMin = (Math.abs(tzOffset) - offsetHours) * 60; str += ':' + String(offsetMin).padStart(2, '0'); } @@ -1202,7 +1212,7 @@ export class Date extends AbstractDate { return str; } - getDateTime(timeZoneOffset?: number | null) { + getDateTime(timeZoneOffset?: Decimal | null) { // from the spec: the result will be a DateTime with the time components unspecified, // except for the timezone offset, which will be set to the timezone offset of the evaluation // request timestamp. (this last part is achieved by passing in the timeZoneOffset from the context) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 815b9fb5a..55b60c82a 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -1,48 +1,75 @@ +import { Decimal as DecimalJS } from 'decimal.js'; + +// Default precision is set to 30 significant figures. (Not decimal places) +// MAX_DECIMAL_VALUE = 99999999999999999999.99999999 is 28 significant figures, +// 30 is just a cleaner number. +DecimalJS.set({ precision: 30 }); export type DecimalInput = Decimal | string | number | bigint; -export type DecimalRoundingMode = 'down' | 'half-up' | 'half-even' | 'half-ceil' | 'ceil' | 'floor'; +export type DecimalRoundingMode = DecimalJS.Rounding; + +const MIN_FLOAT_PRECISION_VALUE = DecimalJS.pow(10, -8); -const MIN_FLOAT_PRECISION_VALUE = Math.pow(10, -8); +const CQL_IMPLICIT_SCALE = 8; +const CQL_IMPLICIT_ROUNDING = DecimalJS.ROUND_HALF_UP; export class Decimal { - public readonly value: number; + private value: DecimalJS; - private constructor(value: DecimalInput) { - const numericValue = toNumber(value); - if (!Number.isFinite(numericValue)) { + private constructor(value: string | number | bigint | DecimalJS) { + this.value = new DecimalJS(value); + if (!this.value.isFinite()) { throw new Error('Cannot create a decimal with a non-finite value'); } - this.value = numericValue; } static from(value: DecimalInput) { - return value instanceof Decimal ? value : new Decimal(value); + if (value instanceof Decimal) { + return value; + } + + return new Decimal(value); } get isDecimal() { return true; } - add(other: DecimalInput) { - return new Decimal(this.value + toNumber(other)); + normalized() { + if (this.value.decimalPlaces() <= CQL_IMPLICIT_SCALE) { + return this; + } + return this.setScale(CQL_IMPLICIT_SCALE, CQL_IMPLICIT_ROUNDING); } - subtract(other: DecimalInput) { - return new Decimal(this.value - toNumber(other)); + private applyWrapper( + operation: (value: any) => DecimalJS, + other: DecimalInput + ): Decimal { + const operand = other instanceof Decimal ? other.value : other; + + return new Decimal(operation.call(this.value, operand)); } - multiplyBy(other: DecimalInput) { - return new Decimal(this.value * toNumber(other)); + add(other: DecimalInput) : Decimal { + return this.applyWrapper(this.value.add, other); } - divideBy(other: DecimalInput) { - const divisor = toNumber(other); - if (divisor === 0) { + subtract(other: DecimalInput) : Decimal { + return this.applyWrapper(this.value.minus, other); + } + + multiplyBy(other: DecimalInput) : Decimal { + return this.applyWrapper(this.value.times, other); + } + + divideBy(other: DecimalInput) : Decimal { + if (toNumber(other) === 0) { throw new RangeError('Cannot divide a decimal by zero'); } - return new Decimal(this.value / divisor); + return this.applyWrapper(this.value.dividedBy, other); } modulo(other: DecimalInput) { @@ -50,12 +77,14 @@ export class Decimal { if (divisor === 0) { throw new RangeError('Cannot calculate decimal modulo by zero'); } - return new Decimal(this.value % divisor); + return this.applyWrapper(this.value.mod, other); } compareTo(other: DecimalInput) { - const otherValue = toNumber(other); - return this.value - otherValue; + if (other instanceof Decimal) { + return this.value.comparedTo(other.value) + } + return this.value.comparedTo(other); } greaterThan(other: DecimalInput) { @@ -79,72 +108,77 @@ export class Decimal { } successor() { - return new Decimal(this.value + MIN_FLOAT_PRECISION_VALUE); + return new Decimal(this.value.add(MIN_FLOAT_PRECISION_VALUE)); } predecessor() { - return new Decimal(this.value - MIN_FLOAT_PRECISION_VALUE); + return new Decimal(this.value.minus(MIN_FLOAT_PRECISION_VALUE)); } negate() { - return new Decimal(-this.value); + return new Decimal(this.value.neg()); } abs() { - return new Decimal(Math.abs(this.value)); + return new Decimal(this.value.abs()); } - truncate() { - return Math.trunc(this.value); + truncate() : number { + return this.value.truncated().toNumber(); } - ceil() { - return Math.ceil(this.value); + truncated() : Decimal { + return new Decimal(this.value.truncated()); } - floor() { - return Math.floor(this.value); + ceil() : number { + return this.value.ceil().toNumber(); } - isInteger() { - return Number.isInteger(this.value); + floor() : number { + return this.value.floor().toNumber(); } - round(scale = 0) { - return this.setScale(scale, 'half-ceil'); + isInteger() { + return this.value.isInteger(); } power(exponent: DecimalInput) { - return new Decimal(Math.pow(this.value, toNumber(exponent))); + return this.applyWrapper(this.value.toPower, exponent); } sqrt() { - return new Decimal(Math.sqrt(this.value)); + return new Decimal(this.value.sqrt()); } ln() { - return new Decimal(Math.log(this.value)); + return new Decimal(this.value.ln()); } exp() { - return new Decimal(Math.exp(this.value)); + return new Decimal(this.value.exp()); } log(base: DecimalInput) { - return this.ln().divideBy(Decimal.from(base).ln()); + return this.applyWrapper(this.value.log, base); + } + + round(scale: number) { + // notes on rounding modes + // ROUND_HALF_UP "Rounds towards nearest neighbour. If equidistant, rounds away from zero" + // rounds 0.5 -> 1.0, -0.5 -> -1.0 + // ROUND_HALF_CEIL "Rounds towards nearest neighbour. If equidistant, rounds towards Infinity" + // rounds 0.5 -> 1.0, -0.5 -> 0.0 + // https://mikemcl.github.io/decimal.js/#modes + return this.setScale(scale, DecimalJS.ROUND_HALF_CEIL); } - /** - * Return a value at the requested number of digits after the decimal point. - * `down` truncates toward zero, matching the current ToDecimal behavior. - */ - setScale(scale: number, roundingMode: DecimalRoundingMode = 'down') { + setScale(scale: number, roundingMode: DecimalRoundingMode = DecimalJS.ROUND_DOWN) { if (!Number.isInteger(scale) || scale < 0) { throw new RangeError('Decimal scale must be a non-negative integer'); } - - const factor = Math.pow(10, scale); - return new Decimal(round(this.value * factor, roundingMode) / factor); + + return new Decimal(this.value.toDecimalPlaces(scale, roundingMode)); } toInteger() { @@ -152,12 +186,12 @@ export class Decimal { } toNumber() { - return this.value; + return this.value.toNumber(); } toLong() { - // TODO: this is wrong - return BigInt(this.toNumber()); + // TODO + return BigInt(this.toString()); } toString() { @@ -177,7 +211,7 @@ export const MIN_DECIMAL_VALUE = Decimal.from(MIN_DECIMAL_STRING); function toNumber(value: DecimalInput) { if (value instanceof Decimal) { - return value.value; + return value.toNumber(); } if (typeof value === 'string' && value.trim() === '') { // Number() and Number('') return 0 instead of NaN, so catch that case @@ -185,32 +219,3 @@ function toNumber(value: DecimalInput) { } return Number(value); } - -function round(value: number, mode: DecimalRoundingMode) { - switch (mode) { - case 'down': - return Math.trunc(value); - case 'half-up': - return value < 0 ? -Math.round(-value) : Math.round(value); - case 'half-even': - return roundHalfEven(value); - case 'half-ceil': - return Math.round(value); - case 'ceil': - return Math.ceil(value); - case 'floor': - return Math.floor(value); - } -} - -function roundHalfEven(value: number) { - const lower = Math.floor(value); - const fraction = value - lower; - if (fraction < 0.5) { - return lower; - } - if (fraction > 0.5) { - return lower + 1; - } - return lower % 2 === 0 ? lower : lower + 1; -} diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index ec98aba2b..62c56b7ec 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -13,13 +13,13 @@ export class Quantity { public readonly value: Decimal; constructor( - value: Decimal | string | number | bigint, + value?: Decimal | string | number | bigint, public unit?: any ) { if (value == null || typeof value === 'number' && isNaN(value)) { throw new Error('Cannot create a quantity with an undefined value'); } - this.value = Decimal.from(value); + this.value = Decimal.from(value).normalized(); if (!isValidDecimal(this.value)) { throw new Error('Cannot create a quantity with an invalid decimal value'); } @@ -93,14 +93,15 @@ export class Quantity { if (other != null && other.isQuantity) { if ((!this.unit && other.unit) || (this.unit && !other.unit)) { return false; - } else if (!this.unit && !other.unit) { - return this.value === other.value; + } else if (this.unit === other.unit) { + // same unit, or both are null + return this.value.equals(other.value); } else { const otherVal = convertUnit(other.value, other.unit, this.unit); if (otherVal == null) { return null; } else { - return this.value.round(8).equals(Decimal.from(otherVal)); + return this.value.equals(otherVal); } } } @@ -121,19 +122,19 @@ export class Quantity { } const [val1, unit1, val2, unit2] = normalizeUnitsWhenPossible( - this.value.toNumber(), + this.value, this.unit, - Decimal.from(other.value).toNumber(), + other.value, other.unit ); - const resultValue = Decimal.from(val1 / val2); + const resultValue = val1.divideBy(val2); const resultUnit = getQuotientOfUnits(unit1, unit2); // Check for invalid unit or value if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { return null; } - return new Quantity(resultValue.round(8), resultUnit); + return new Quantity(resultValue, resultUnit); } multiplyBy(other: any) { @@ -145,19 +146,19 @@ export class Quantity { } const [val1, unit1, val2, unit2] = normalizeUnitsWhenPossible( - this.value.toNumber(), + this.value, this.unit, - Decimal.from(other.value).toNumber(), + other.value, other.unit ); - const resultValue = Decimal.from(val1 * val2); + const resultValue = val1.multiplyBy(val2); const resultUnit = getProductOfUnits(unit1, unit2); // Check for invalid unit or value if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { return null; } - return new Quantity(resultValue.round(8), resultUnit); + return new Quantity(resultValue, resultUnit); } } diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 08cd7dbdc..e94784810 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -26,21 +26,17 @@ function isDecimal(value: any): value is Decimal { return value != null && value.isDecimal; } -function numberValue(value: any) { - return value && value.isDecimal ? value.toNumber() : value; -} - function sumDecimals(values: Decimal[]) { - return values.reduce((sum, value) => sum.add(value)).setScale(8, 'half-up'); + return values.reduce((sum, value) => sum.add(value)); } function productDecimals(values: Decimal[]) { - return values.reduce((product, value) => product.multiplyBy(value)).setScale(8, 'half-up'); + return values.reduce((product, value) => product.multiplyBy(value)); } function decimalResult(value: number, values: any[], resultTypeName?: string) { return hasDecimals(values) || resultTypeName === ELM_DECIMAL_TYPE - ? Decimal.from(value).setScale(8, 'half-up') + ? Decimal.from(value).normalized() : value; } @@ -182,13 +178,10 @@ export class Avg extends AggregateExpression { if (hasOnlyQuantities(items)) { const sum = sumDecimals(getValuesFromQuantities(items)); - return new Quantity(sum.divideBy(items.length).setScale(8, 'half-up'), items[0].unit); + return new Quantity(sum.divideBy(items.length), items[0].unit); } else { - if (hasDecimals(items)) { - return sumDecimals(items.map(Decimal.from)).divideBy(items.length).setScale(8, 'half-up'); - } - const sum = items.reduce((x: number, y: number) => x + y); - return decimalResult(sum / items.length, items, this.resultTypeName); + // return type is always Decimal, so just map everything to Decimals + return sumDecimals(items.map(Decimal.from)).divideBy(items.length).normalized(); } } } @@ -310,37 +303,35 @@ export class StdDev extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items).map(numberValue); + const values = getValuesFromQuantities(items); const stdDev = this.standardDeviation(values); return new Quantity(stdDev, items[0].unit); } else { - const standardDeviation = this.standardDeviation(items.map(numberValue)); - return standardDeviation == null - ? null - : decimalResult(standardDeviation, items, this.resultTypeName); + const standardDeviation = this.standardDeviation(items.map(Decimal.from)); + return standardDeviation?.normalized(); // TODO: review function signatures. always return Decimal makes sense but is it correct? } } - standardDeviation(list: any[]) { + standardDeviation(list: Decimal[]) { const val = this.stats(list); if (val) { return val[this.type]; } } - stats(list: any[]) { - const sum = list.reduce((x, y) => x + y); - const mean = sum / list.length; - let sumOfSquares = 0; + stats(list: Decimal[]) { + const sum = list.reduce((x, y) => x.add(y), Decimal.from(0)); + const mean = sum.divideBy(list.length); - for (const sq of list) { - sumOfSquares += Math.pow(sq - mean, 2); - } + const sumOfSquares = list.reduce((total, value) => { + const difference = value.subtract(mean); + return total.add(difference.power(2)); + }, Decimal.from(0)); - const std_var = (1 / (list.length - 1)) * sumOfSquares; - const pop_var = (1 / list.length) * sumOfSquares; - const std_dev = Math.sqrt(std_var); - const pop_dev = Math.sqrt(pop_var); + const std_var = sumOfSquares.divideBy(list.length - 1); + const pop_var = sumOfSquares.divideBy(list.length); + const std_dev = std_var.sqrt(); + const pop_dev = pop_var.sqrt(); return { standard_variance: std_var, population_variance: pop_var, @@ -409,16 +400,11 @@ export class GeometricMean extends AggregateExpression { if (hasOnlyQuantities(items)) { const product = productDecimals(getValuesFromQuantities(items)); - const geoMean = product.power(1.0 / items.length).setScale(8, 'half-up'); + const geoMean = product.power(1.0 / items.length); return new Quantity(geoMean, items[0].unit); } else { - if (hasDecimals(items)) { - return productDecimals(items.map(Decimal.from)) - .power(1.0 / items.length) - .setScale(8, 'half-up'); - } - const product = items.reduce((x: number, y: number) => x * y); - return decimalResult(Math.pow(product, 1.0 / items.length), items, this.resultTypeName); + return productDecimals(items.map(Decimal.from)) + .power(1.0 / items.length).normalized(); } } } @@ -518,5 +504,5 @@ function medianOfDecimals(decimals: Decimal[]) { const middle = Math.floor(items.length / 2); return items.length % 2 === 1 ? items[middle] - : items[middle - 1].add(items[middle]).divideBy(2).setScale(8, 'half-up'); + : items[middle - 1].add(items[middle]).divideBy(2); } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index c63fa18f0..c14a01eca 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -29,39 +29,22 @@ import { MIN_LONG_VALUE } from '../util/limits'; -function isDecimal(value: any): boolean { - return value != null && value.isDecimal; -} - -function decimalResult(value: any, resultTypeName?: string): any { - if (isDecimal(value) || (typeof value === 'number' && !Number.isFinite(value))) { - return value; - } - return resultTypeName === ELM_DECIMAL_TYPE || (typeof value === 'number' && !Number.isInteger(value)) - ? Decimal.from(value).setScale(8, 'half-up') - : value; -} - -function add(x: any, y: any) { - return isDecimal(x) || isDecimal(y) ? Decimal.from(x).add(y).setScale(8, 'half-up') : x + y; -} - -function subtract(x: any, y: any) { - return isDecimal(x) || isDecimal(y) - ? Decimal.from(x).subtract(y).setScale(8, 'half-up') - : x - y; -} - -function multiply(x: any, y: any) { - return isDecimal(x) || isDecimal(y) - ? Decimal.from(x).multiplyBy(y).setScale(8, 'half-up') - : x * y; -} +function finalizeNumericResult(result: any, type?: string) { + + if (result instanceof Decimal) { + return result.normalized(); + } else if (result instanceof Quantity) { + return new Quantity(result.value.normalized(), result.unit); + } else if (result instanceof Uncertainty) { + if (result.low instanceof Quantity || result.low instanceof Decimal) { + result.low = finalizeNumericResult(result.low); + } + if (result.high instanceof Quantity || result.high instanceof Decimal) { + result.high = finalizeNumericResult(result.high); + } + } -function divide(x: any, y: any) { - return isDecimal(x) || isDecimal(y) - ? Decimal.from(x).divideBy(y).setScale(8, 'half-up') - : x / y; + return result; } export class Add extends Expression { @@ -75,7 +58,8 @@ export class Add extends Expression { return null; } - return MathUtil.add(args[0], args[1], this.resultTypeName); + const sum = MathUtil.add(args[0], args[1], this.resultTypeName); + return finalizeNumericResult(sum, this.resultTypeName); } } @@ -90,7 +74,8 @@ export class Subtract extends Expression { return null; } - return MathUtil.subtract(args[0], args[1], this.resultTypeName); + const difference = MathUtil.subtract(args[0], args[1], this.resultTypeName); + return finalizeNumericResult(difference, this.resultTypeName); } } @@ -105,30 +90,32 @@ export class Multiply extends Expression { return null; } - const product = args.reduce((x: any, y: any) => { - if (x.isUncertainty && !y.isUncertainty) { - y = new Uncertainty(y, y); - } else if (y.isUncertainty && !x.isUncertainty) { - x = new Uncertainty(x, x); - } - - if (x.isQuantity || y.isQuantity) { - return doMultiplication(x, y); - } else if (x.isUncertainty && y.isUncertainty) { - if (x.low.isQuantity) { - return new Uncertainty(doMultiplication(x.low, y.low), doMultiplication(x.high, y.high)); - } else { - return new Uncertainty(multiply(x.low, y.low), multiply(x.high, y.high)); - } + let [x, y] = args; + + if (x.isUncertainty && !y.isUncertainty) { + y = new Uncertainty(y, y); + } else if (y.isUncertainty && !x.isUncertainty) { + x = new Uncertainty(x, x); + } + + let product; + if (x.isQuantity || y.isQuantity) { + product = doMultiplication(x, y); + } else if (x.isUncertainty && y.isUncertainty) { + if (x.low.isQuantity) { + product = new Uncertainty(doMultiplication(x.low, y.low), doMultiplication(x.high, y.high)); } else { - return multiply(x, y); + product = new Uncertainty(MathUtil.multiply(x.low, y.low), MathUtil.multiply(x.high, y.high)); } - }); + } else { + product = MathUtil.multiply(x, y); + } if (MathUtil.overflowsOrUnderflows(product, this.resultTypeName)) { return null; } - return product; + + return finalizeNumericResult(product, this.resultTypeName); } } @@ -155,25 +142,28 @@ export class Divide extends Expression { if (x.isQuantity) { quotient = doDivision(x, y); } else if (x.isUncertainty && y.isUncertainty) { + let low, high; + // TODO change this section back if (x.low.isQuantity) { - quotient = new Uncertainty(doDivision(x.low, y.high), doDivision(x.high, y.low)); + low = doDivision(x.low, y.high); + high = doDivision(x.high, y.low); } else { - quotient = new Uncertainty(divide(x.low, y.high), divide(x.high, y.low)); + low = MathUtil.divide(x.low, y.high); + high = MathUtil.divide(x.high, y.low); } + quotient = new Uncertainty(low, high); } else { - quotient = divide(x, y); + quotient = MathUtil.divide(x, y); } } catch { // Decimal division by zero throws; CQL defines the result as null. return null; } - // Note, anything divided by 0 is Infinity in Javascript, which will be - // considered as overflow by this check. if (MathUtil.overflowsOrUnderflows(quotient, this.resultTypeName)) { return null; } - return quotient; + return finalizeNumericResult(quotient, this.resultTypeName); } } @@ -187,34 +177,27 @@ export class TruncatedDivide extends Expression { if (args == null || args.some((x: any) => x == null)) { return null; } - - let truncatedQuotient: number | bigint | Decimal; - if (typeof args[0] === 'bigint') { - // bigint division always truncates - try { - truncatedQuotient = args.reduce((x: bigint, y: bigint) => x / y); - } catch { - // bigint divide by 0 throws an error - return null; + + let [x, y] = args; + let quotient; + if (x.isQuantity) { + quotient = doDivision(x, y); + if (quotient instanceof Quantity) { + quotient = new Quantity(quotient.value.truncated(), quotient.unit); } } else { - try { - const quotient = args.reduce((x: any, y: any) => divide(x, y)); - const truncated = isDecimal(quotient) - ? quotient.truncate() - : quotient >= 0 - ? Math.floor(quotient) - : Math.ceil(quotient); - truncatedQuotient = decimalResult(truncated, this.resultTypeName); - } catch { - return null; + quotient = MathUtil.divide(x, y); + + // MathUtil.divide performs truncated division for Integers and Longs implicitly + if (quotient != null && (x.isDecimal || y.isDecimal || this.resultTypeName === ELM_DECIMAL_TYPE)) { + quotient = (quotient as Decimal).truncated(); } } - if (MathUtil.overflowsOrUnderflows(truncatedQuotient, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(quotient, this.resultTypeName)) { return null; } - return truncatedQuotient; + return quotient; } } @@ -230,16 +213,16 @@ export class Modulo extends Expression { } let modulo: number | bigint | Decimal; + const [x, y] = args; try { - modulo = args.reduce((x: any, y: any) => - isDecimal(x) || isDecimal(y) ? Decimal.from(x).modulo(y) : x % y - ); + modulo = + x.isDecimal || y.isDecimal ? Decimal.from(x).modulo(y) : x % y; } catch { // modulo divide by zero results in null according to specification return null; } - return MathUtil.decimalLongOrNull(decimalResult(modulo, this.resultTypeName)); + return MathUtil.decimalLongOrNull(finalizeNumericResult(modulo, this.resultTypeName)) } } @@ -254,7 +237,7 @@ export class Ceiling extends Expression { return null; } - return isDecimal(arg) ? arg.ceil() : Math.ceil(arg); + return arg.isDecimal ? arg.ceil() : Math.ceil(arg); } } @@ -269,7 +252,7 @@ export class Floor extends Expression { return null; } - return isDecimal(arg) ? arg.floor() : Math.floor(arg); + return arg.isDecimal ? arg.floor() : Math.floor(arg); } } @@ -284,7 +267,7 @@ export class Truncate extends Expression { return null; } - return isDecimal(arg) ? arg.truncate() : arg >= 0 ? Math.floor(arg) : Math.ceil(arg); + return arg.isDecimal ? arg.truncate() : arg >= 0 ? Math.floor(arg) : Math.ceil(arg); } } export class Abs extends Expression { @@ -303,7 +286,7 @@ export class Abs extends Expression { return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) ? null : absoluteValue; - } else if (isDecimal(arg)) { + } else if (arg.isDecimal) { const absoluteValue = arg.abs(); return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) ? null @@ -333,7 +316,7 @@ export class Negate extends Expression { return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) ? null : negatedValue; - } else if (isDecimal(arg)) { + } else if (arg.isDecimal) { const negatedValue = arg.negate(); return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) ? null @@ -362,10 +345,7 @@ export class Round extends Expression { } const dec = this.precision != null ? await this.precision.execute(ctx) : 0; - if (isDecimal(arg)) { - return arg.round(dec); - } - return decimalResult(Math.round(arg * Math.pow(10, dec)) / Math.pow(10, dec), this.resultTypeName); + return Decimal.from(arg).round(dec); } } @@ -381,9 +361,8 @@ export class Ln extends Expression { } try { - return isDecimal(arg) - ? arg.ln() - : MathUtil.decimalOrNull(decimalResult(Math.log(arg), ELM_DECIMAL_TYPE)); + const ln = Decimal.from(arg).ln().normalized(); + return MathUtil.decimalOrNull(ln); } catch { return null; } @@ -403,9 +382,7 @@ export class Exp extends Expression { let power; try { - power = isDecimal(arg) - ? arg.exp() - : decimalResult(Math.exp(arg), ELM_DECIMAL_TYPE); + power = Decimal.from(arg).exp().normalized(); } catch { return null; } @@ -429,12 +406,8 @@ export class Log extends Expression { } try { - const log = args.reduce((x: any, y: any) => - isDecimal(x) || isDecimal(y) - ? Decimal.from(x).log(y) - : Math.log(x) / Math.log(y) - ); - return isDecimal(log) ? log : MathUtil.decimalOrNull(decimalResult(log, ELM_DECIMAL_TYPE)); + const log = Decimal.from(args[0]).log(args[1]); + return MathUtil.decimalOrNull(log); } catch { return null; } @@ -451,8 +424,9 @@ export class Power extends Expression { if (args == null || args.some((x: any) => x == null)) { return null; } - - const power = decimalResult(args.reduce((x: any, y: any) => doPower(x, y)), this.resultTypeName); + // TODO: cql spec shows the return type is always Decimal, but that's not true + const [x, y] = args; + const power = doPower(x, y); // Note: The resultTypeName may be wrong if the exponent is a negative number. Math.overflowsOrUnderflows // already accounts for this possibility by only considering it an integer if Number.isInteger(value). @@ -465,21 +439,10 @@ export class Power extends Expression { } function doPower(x: any, y: any) { - if (isDecimal(x) || isDecimal(y)) { + if (x.isDecimal || y.isDecimal || (typeof y == 'number' && y < 0) || (typeof y === 'bigint' && y < 0n)) { + // Decimal values or negative powers always produce Decimal result return Decimal.from(x).power(y); } - if (typeof x === 'bigint' && typeof y === 'bigint' && y < 0n) { - // x ** y does not support negative exponents for bigint, so downgrade to number if possible, otherwise return null - if ( - x < BigInt(Number.MIN_SAFE_INTEGER) || - x > BigInt(Number.MAX_SAFE_INTEGER) || - y < BigInt(Number.MIN_SAFE_INTEGER) - ) { - // can't safely convert to number so just return null - return null; - } - return Number(x) ** Number(y); - } try { return x ** y; diff --git a/src/elm/clinical.ts b/src/elm/clinical.ts index 26a9c0019..5d0acd4f5 100644 --- a/src/elm/clinical.ts +++ b/src/elm/clinical.ts @@ -344,7 +344,7 @@ function calculateAge( precision: string, birthDate?: dt.Date | dt.DateTime, asOf?: dt.Date | dt.DateTime, - timeZoneOffset?: number | null + timeZoneOffset?: dt.Decimal | null ) { if (birthDate != null && asOf != null) { // Ensure we use like types (Date or DateTime) based on asOf type diff --git a/src/elm/interval.ts b/src/elm/interval.ts index 5ef38af84..14a109f44 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -516,12 +516,11 @@ export class Expand extends Expression { return results; } - expandDTishInterval(interval: any, per: any) { + expandDTishInterval(interval: any, per: Quantity) { per.unit = convertToCQLDateUnit(per.unit); if (per.unit === 'week') { - per.value *= 7; - per.unit = 'day'; + per = new Quantity(per.value.multiplyBy(7), 'day'); } // Precision Checks @@ -679,9 +678,9 @@ export class Expand extends Expression { high: any, perValue: any ) { - // If the per value is a Decimal (has a .), 8 decimal places are appropriate + // If the per value is a decimal, 8 decimal places are appropriate // Integers should have 0 Decimal places - const perIsIntegral = !perValue.toString().includes('.'); + const perIsIntegral = perValue.isInteger(); const decimalPrecision = perIsIntegral ? 0 : 8; // For the purposes of this function, we'll perform all the arithmetic using Decimals, @@ -707,8 +706,8 @@ export class Expand extends Expression { // If the interval boundaries are more precise than the per quantity, the // more precise values will be truncated to the precision specified by the // per quantity. - low = truncateDecimal(low, decimalPrecision); - high = truncateDecimal(high, decimalPrecision); + low = low.setScale(decimalPrecision); + high = high.setScale(decimalPrecision); if (low == null || high == null) { return []; @@ -783,7 +782,7 @@ function collapseIntervals(intervals: any, perWidth: any) { // width equal to the result of the successor function for the point type). if (perWidth == null) { const pointSize = intervalsClone[0].getPointSize(); - perWidth = pointSize.isQuantity ? pointSize : new Quantity(Number(pointSize), '1'); + perWidth = pointSize.isQuantity ? pointSize : new Quantity(pointSize, '1'); } // sort intervalsClone by start @@ -844,8 +843,7 @@ function collapseIntervals(intervals: any, perWidth: any) { a.high = b.high; } } else if ( - (a.high != null ? a.high.durationBetween(b.low, perWidth.unit).high : undefined) <= - perWidth.value + perWidth.value.greaterThanOrEquals(a.high != null ? a.high.durationBetween(b.low, perWidth.unit).high : undefined) ) { a.high = b.high; } else { diff --git a/src/elm/type.ts b/src/elm/type.ts index 073a12e59..2215be8b4 100644 --- a/src/elm/type.ts +++ b/src/elm/type.ts @@ -166,14 +166,14 @@ export class ToDecimal extends Expression { const arg = await this.execArgs(ctx); if (arg != null) { if (arg.isUncertainty) { - const low = Decimal.from(arg.low); - const high = Decimal.from(arg.high); + const low = Decimal.from(arg.low).normalized() + const high = Decimal.from(arg.high).normalized(); return new Uncertainty(low, high); } else { try { const decimal = Decimal.from(arg.toString()); if (isValidDecimal(decimal)) { - return decimal; + return decimal.normalized(); } } catch (_e) { return null; diff --git a/src/runtime/context.ts b/src/runtime/context.ts index 106a53639..84ec265a0 100644 --- a/src/runtime/context.ts +++ b/src/runtime/context.ts @@ -126,7 +126,7 @@ export class Context { } } - getTimezoneOffset(): number | null { + getTimezoneOffset(): dt.Decimal | null { if (this.executionDateTime != null) { return this.executionDateTime.timezoneOffset; } else if (this.parent && this.parent.getTimezoneOffset != null) { diff --git a/src/util/immutableUtil.ts b/src/util/immutableUtil.ts index 8f77acfda..d57e80772 100644 --- a/src/util/immutableUtil.ts +++ b/src/util/immutableUtil.ts @@ -1,6 +1,6 @@ import * as ucum from '@lhncbc/ucum-lhc'; import { type Collection, Map as ImmutableMap, Seq as ImmutableSeq } from 'immutable'; -import { Code, DateTime, Interval, Quantity, Ratio, Uncertainty } from '../datatypes/datatypes'; +import { Code, DateTime, Decimal, Interval, Quantity, Ratio, Uncertainty } from '../datatypes/datatypes'; import { decimalAdjust } from './math'; import { convertUnit } from './units'; @@ -56,7 +56,7 @@ export const toNormalizedKey = (js: any): NormalizedKey => { }); case DateTime: - if (typeof js.timezoneOffset === 'number' && js.timezoneOffset !== 0) { + if (js.timezoneOffset?.isDecimal && !js.timezoneOffset.equals(0)) { return ImmutableSeq(js.convertToTimezoneOffset(0)) .map((x: any) => toNormalizedKey(x)) .toMap() @@ -68,6 +68,12 @@ export const toNormalizedKey = (js: any): NormalizedKey => { .set('__instance', js.constructor); } + case Decimal: + return ImmutableMap({ + value: js.toString(), + __instance: js.constructor + }); + case Interval: return ImmutableSeq(js.toClosed()) .map((x: any) => toNormalizedKey(x)) @@ -77,7 +83,7 @@ export const toNormalizedKey = (js: any): NormalizedKey => { case Quantity: if (!js.unit) { return ImmutableMap({ - value: js.value ?? null, + value: js.value ? toNormalizedKey(js.value) : null, unit: null, __instance: js.constructor }); @@ -89,7 +95,7 @@ export const toNormalizedKey = (js: any): NormalizedKey => { if (!baseUnitKey) { // No units found - normalization not possible and use provided values return ImmutableMap({ - value: js.value ?? null, + value: js.value ? toNormalizedKey(js.value) : null, unit: js.unit ?? null, __instance: js.constructor }); @@ -99,7 +105,7 @@ export const toNormalizedKey = (js: any): NormalizedKey => { const conversionValue = convertUnit(js.value, js.unit, baseUnitKeyCode); const finalValue = conversionValue ? decimalAdjust('round', conversionValue, -8) : null; return ImmutableMap({ - value: finalValue ?? null, + value: finalValue ? toNormalizedKey(finalValue) : null, unit: baseUnitKeyCode ?? null, __instance: js.constructor }); diff --git a/src/util/math.ts b/src/util/math.ts index b0fb84436..d70db1bc3 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -133,22 +133,18 @@ export function add(a: any, b: any, type?: string): any { return low == null || high == null ? null : new Uncertainty(low, high); } - if (typeof a === 'bigint') { - const sum = a + (typeof b === 'bigint' ? b : BigInt(b)); - return overflowsOrUnderflows(sum, ELM_LONG_TYPE) ? null : sum; + if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { + const sum = Decimal.from(a).add(Decimal.from(b)); + return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : sum; } - if (typeof b === 'bigint') { - const sum = BigInt(a) + b; + if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + const sum = BigInt(a) + BigInt(b); return overflowsOrUnderflows(sum, ELM_LONG_TYPE) ? null : sum; } if (typeof a === 'number' && typeof b === 'number') { const sum = a + b; return overflowsOrUnderflows(sum, ELM_INTEGER_TYPE) ? null : sum; } - if (a?.isDecimal && b?.isDecimal) { - const sum = a.add(b); - return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : sum; - } if (a?.isQuantity && b?.isQuantity) { const [aValue, aUnit, bValue, bUnit] = normalizeUnitsWhenPossible( a.value, @@ -187,17 +183,63 @@ export function subtract(a: any, b: any, type?: string): any { if (typeof b === 'number' || typeof b === 'bigint') { return add(a, -b, type); } - if (a?.isDecimal && b?.isDecimal) { - const difference = a.subtract(b); - return overflowsOrUnderflows(difference, ELM_DECIMAL_TYPE) ? null : difference; + if (b?.isDecimal) { + return add(a, (b as Decimal).negate(), type); } if (b?.isQuantity) { + // Note - this path uses a fake Quantity object to defer validation of the unit return add(a, { isQuantity: true, value: b.value.negate(), unit: b.unit }, type); } throw new Error('Unsupported argument types.'); } +export function multiply(a: any, b: any, type?: string) { + if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { + const product = Decimal.from(a).multiplyBy(b); + return overflowsOrUnderflows(product, ELM_DECIMAL_TYPE) ? null : product; + } + if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + const product = BigInt(a) * BigInt(b); + return overflowsOrUnderflows(product, ELM_LONG_TYPE) ? null : product; + } + if (typeof a === 'number' && typeof b === 'number') { + const product = a * b; + return overflowsOrUnderflows(product, ELM_INTEGER_TYPE) ? null : product; + } + + throw new Error('Unsupported argument types.'); +} + +export function divide(a: any, b: any, type?: string) { + if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { + b = Decimal.from(b); + if (b.equals(0)) { + return null; + } + const quotient = Decimal.from(a).divideBy(b); + return overflowsOrUnderflows(quotient, ELM_DECIMAL_TYPE) ? null : quotient; + } + if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + if (b === 0 || b === 0n) { + return null; + } + // BigInt division is inherently truncated, eg 10n / 3n = 3n + const quotient = BigInt(a) / BigInt(b); + return overflowsOrUnderflows(quotient, ELM_LONG_TYPE) ? null : quotient; + } + if (typeof a === 'number' && typeof b === 'number') { + if (b === 0) { + return null; + } + // here we need to truncate manually to ensure the value is an integer + const quotient = Math.trunc(a / b); + return overflowsOrUnderflows(quotient, ELM_INTEGER_TYPE) ? null : quotient; + } + + throw new Error('Unsupported argument types.'); +} + export function limitDecimalPrecision( val?: T ): T | undefined { diff --git a/src/util/units.ts b/src/util/units.ts index 553720f42..688ef2f6f 100644 --- a/src/util/units.ts +++ b/src/util/units.ts @@ -68,21 +68,24 @@ export function checkUnit(unit: any, allowEmptyUnits = true, allowCQLDateUnits = return unitValidityCache.get(unit); } -export function convertUnit(fromVal: any, fromUnit: any, toUnit: any, adjustPrecision = true) { +export function convertUnit(fromVal: Decimal, fromUnit: any, toUnit: any) { [fromUnit, toUnit] = [fromUnit, toUnit].map(fixUnit); + if (fromUnit === toUnit) { + return fromVal; + } // IMPORTANT: the UCUM library operates on raw JS numbers, not our Decimal - const rawFromVal = fromVal.isDecimal ? fromVal.value : fromVal; - - const result = utils.convertUnitTo(fixUnit(fromUnit), rawFromVal, fixUnit(toUnit)); + // this means that extremely large or extremely small numbers would lose precision via this function. + // To prevent this, instead of converting fromVal directly, convert 1 unit to get the conversion factor, + // and manually multiply the fromVal by it. + const result = utils.convertUnitTo(fromUnit, 1, toUnit); if (result.status !== 'succeeded') { return; } - // note: convert result.toVal to number (by prefixing +) to keep typescript happy - const rawRetVal = adjustPrecision ? decimalAdjust('round', result.toVal, -8) : +result.toVal; - return fromVal.isDecimal ? Decimal.from(rawRetVal) : rawRetVal; + const conversionFactor = result.toVal; + return fromVal.multiplyBy(conversionFactor).normalized(); } -export function normalizeUnitsWhenPossible(val1: any, unit1: any, val2: any, unit2: any) { +export function normalizeUnitsWhenPossible(val1: Decimal, unit1: any, val2: Decimal, unit2: any) { // If both units are CQL date units, return CQL date units const useCQLDateUnits = unit1 in CQL_TO_UCUM_DATE_UNITS && unit2 in CQL_TO_UCUM_DATE_UNITS; const resultConverter = (unit: any) => { @@ -100,8 +103,8 @@ export function normalizeUnitsWhenPossible(val1: any, unit1: any, val2: any, uni // it was not convertible, so just return the quantities as-is return [val1, resultConverter(unit1), val2, resultConverter(unit2)]; } - // If the new val2 > old val2, return since we prefer conversion to smaller units - if (newVal2 >= val2) { + // If the new val2 >= old val2, return since we prefer conversion to smaller units + if (newVal2.greaterThanOrEquals(val2)) { return [val1, resultConverter(unit1), newVal2, resultConverter(newUnit2)]; } // else it was a conversion to a larger unit, so go the other way around @@ -126,11 +129,11 @@ export function convertToCQLDateUnit(unit: any) { export function compareUnits(unit1: any, unit2: any) { try { - const c = convertUnit(1, unit1, unit2) as number; - if (c && c > 1) { + const c = convertUnit(Decimal.from(1), unit1, unit2); + if (c && c.greaterThan(1)) { // unit1 is bigger (less precise) return 1; - } else if (c && c < 1) { + } else if (c && c.lessThan(1)) { // unit1 is smaller return -1; } @@ -245,7 +248,7 @@ export function getQuotientOfUnits(unit1: any, unit2: any) { // UNEXPORTED FUNCTIONS -function convertToBaseUnit(fromVal: any, fromUnit: any, toBaseUnit: any) { +function convertToBaseUnit(fromVal: Decimal, fromUnit: any, toBaseUnit: any) { const fromPower = getBaseUnitAndPower(fromUnit)[1]; const toUnit = fromPower === 1 ? toBaseUnit : `${toBaseUnit}${fromPower}`; const newVal = convertUnit(fromVal, fromUnit, toUnit); diff --git a/test/datatypes/date-test.ts b/test/datatypes/date-test.ts index 4fb294092..90080282f 100644 --- a/test/datatypes/date-test.ts +++ b/test/datatypes/date-test.ts @@ -3,6 +3,7 @@ import should from 'should'; import { Date, DateTime, MAX_DATE_VALUE, MIN_DATE_VALUE } from '../../src/datatypes/datetime'; import { Uncertainty } from '../../src/datatypes/uncertainty'; import { jsDate } from '../../src/util/util'; +import { Decimal } from '../../src/datatypes/decimal'; describe('Date', () => { it('should properly set all properties when constructed', () => { @@ -884,11 +885,11 @@ describe('Date.getPrecisionValue', () => { describe('Date.getDateTime', () => { it('should return a DateTime that has the passed in timeZoneOffset', () => { const d = new Date(2000, 12, 1); - const dateTime = d.getDateTime(2); + const dateTime = d.getDateTime(Decimal.from(2)); dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); - dateTime.timezoneOffset.should.equal(2); + dateTime.timezoneOffset.should.equalDecimal(Decimal.from(2)); }); it('should return a DateTime with a timeZoneOffset when one is not passed in', () => { @@ -897,7 +898,7 @@ describe('Date.getDateTime', () => { dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); - dateTime.timezoneOffset.should.equal((new jsDate().getTimezoneOffset() / 60) * -1); + dateTime.timezoneOffset.should.equalDecimal(Decimal.from((new jsDate().getTimezoneOffset() / 60) * -1)); }); it('should return a DateTime without a timeZoneOffset when a null timeZoneOffset is passed in', () => { diff --git a/test/datatypes/datetime-test.ts b/test/datatypes/datetime-test.ts index cd4e71f24..e771a8aca 100644 --- a/test/datatypes/datetime-test.ts +++ b/test/datatypes/datetime-test.ts @@ -2,6 +2,7 @@ import * as luxon from 'luxon'; import should from 'should'; import { DateTime, MAX_DATETIME_VALUE, MIN_DATETIME_VALUE } from '../../src/datatypes/datetime'; import { Uncertainty } from '../../src/datatypes/uncertainty'; +import { Decimal } from '../../src/datatypes/decimal'; const tzDate = function ( y: number, @@ -59,13 +60,13 @@ describe('DateTime', () => { d.minute.should.equal(25); d.second.should.equal(59); d.millisecond.should.equal(246); - d.timezoneOffset.should.equal(5.5); + d.timezoneOffset.should.equalDecimal(Decimal.from(5.5)); }); it('should leave unset properties as undefined', () => { const d = new DateTime(2000); d.year.should.equal(2000); - d.timezoneOffset.should.equal((new Date().getTimezoneOffset() / 60) * -1); + d.timezoneOffset.should.equalDecimal(Decimal.from((new Date().getTimezoneOffset() / 60) * -1)); should.not.exist(d.month); should.not.exist(d.day); should.not.exist(d.hour); diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 780b1ad21..54e693207 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -28,10 +28,10 @@ describe('Decimal', () => { Decimal.from('-1.9').truncate().should.equal(-1); Decimal.from('1.1').ceil().should.equal(2); Decimal.from('1.9').floor().should.equal(1); - Decimal.from('-0.5').round().should.eql(Decimal.from(0)); - Decimal.from('2').power(3).should.eql(Decimal.from(8)); - Decimal.from('9').sqrt().should.eql(Decimal.from(3)); - Decimal.from('8').log(2).should.eql(Decimal.from(3)); + Decimal.from('-0.5').setScale(0).should.equalDecimal(Decimal.from(0)); + Decimal.from('2').power(3).should.equalDecimal(Decimal.from(8)); + Decimal.from('9').sqrt().should.equalDecimal(Decimal.from(3)); + Decimal.from('8').log(2).should.equalDecimal(Decimal.from(3)); }); it('should reject non-finite and divide-by-zero values', () => { diff --git a/test/datatypes/interval-test.ts b/test/datatypes/interval-test.ts index 29d4ff072..57f1e15de 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -23,10 +23,8 @@ import { ELM_TIME_TYPE } from '../../src/util/elmTypes'; import { - MAX_FLOAT_VALUE, MAX_INT_VALUE, MAX_LONG_VALUE, - MIN_FLOAT_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from '../../src/util/limits'; @@ -134,7 +132,7 @@ describe('Interval', () => { }); it('should return the point size for Decimal intervals', () => { - new Interval(Decimal.from(0.5), Decimal.from(9.5)).getPointSize().should.eql(Decimal.from(0.00000001)); + new Interval(Decimal.from(0.5), Decimal.from(9.5)).getPointSize().should.equalDecimal(Decimal.from(0.00000001)); }); it('should return the point size for Quantity intervals', () => { @@ -156,7 +154,7 @@ describe('Interval', () => { it('should return low for intervals with closed low', () => { d.zeroToHundred.closed.start().should.equal(0); - d.zeroPointFiveToNinePointFive.closed.start().should.eql(Decimal.from(0.5)); + d.zeroPointFiveToNinePointFive.closed.start().should.equalDecimal(Decimal.from(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')); @@ -166,7 +164,7 @@ describe('Interval', () => { it('should return successor of low for intervals with open low', () => { d.zeroToHundred.openClosed.start().should.equal(1); - d.zeroPointFiveToNinePointFive.openClosed.start().should.eql(Decimal.from(0.50000001)); + d.zeroPointFiveToNinePointFive.openClosed.start().should.equalDecimal(Decimal.from("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')); @@ -179,10 +177,10 @@ describe('Interval', () => { 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.eql(Decimal.from(MIN_FLOAT_VALUE)); + d.zeroPointFiveToNinePointFive.withNullStart.closed.start().should.equalDecimal(MIN_DECIMAL_VALUE); d.zeroToHundredMg.withNullStart.closed .start() - .should.eql(new Quantity(MIN_FLOAT_VALUE, 'mg')); + .should.eql(new Quantity(MIN_DECIMAL_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); @@ -256,7 +254,7 @@ describe('Interval', () => { new Interval(null, null, true, true, ELM_DECIMAL_TYPE).start().should.eql(MIN_DECIMAL_VALUE); new Interval(null, null, true, true, ELM_QUANTITY_TYPE) .start() - .should.eql(new Quantity(MIN_FLOAT_VALUE, '1')); + .should.eql(new Quantity(MIN_DECIMAL_VALUE, '1')); new Interval(null, null, true, true, ELM_DATETIME_TYPE) .start() .should.eql(MIN_DATETIME_VALUE); @@ -296,7 +294,7 @@ describe('Interval', () => { it('should return high for intervals with closed high', () => { d.zeroToHundred.closed.end().should.equal(100); - d.zeroPointFiveToNinePointFive.closed.end().should.eql(Decimal.from(9.5)); + d.zeroPointFiveToNinePointFive.closed.end().should.equalDecimal(Decimal.from(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')); @@ -306,7 +304,7 @@ describe('Interval', () => { it('should return predecessor of high for intervals with open high', () => { d.zeroToHundred.closedOpen.end().should.equal(99); - d.zeroPointFiveToNinePointFive.closedOpen.end().should.eql(Decimal.from(9.49999999)); + d.zeroPointFiveToNinePointFive.closedOpen.end().should.equalDecimal(Decimal.from(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')); @@ -388,7 +386,7 @@ describe('Interval', () => { new Interval(null, null, true, true, ELM_DECIMAL_TYPE).end().should.eql(MAX_DECIMAL_VALUE); new Interval(null, null, true, true, ELM_QUANTITY_TYPE) .end() - .should.eql(new Quantity(MAX_FLOAT_VALUE, '1')); + .should.eql(new Quantity(MAX_DECIMAL_VALUE, '1')); 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); @@ -407,7 +405,7 @@ describe('Interval', () => { new Interval(null, null, false, false, ELM_QUANTITY_TYPE) .end() .should.eql( - new Uncertainty(new Quantity(MIN_FLOAT_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) ); new Interval(null, null, false, false, ELM_DATETIME_TYPE) .end() @@ -7006,8 +7004,8 @@ describe('DecimalInterval', () => { it('should calculate width and size outside the Integer range', () => { const interval = new Interval(Decimal.from(0.0), Decimal.from(3000000000.0), true, true, ELM_DECIMAL_TYPE); - interval.width().should.eql(Decimal.from(3000000000.0)); - interval.size().should.eql(Decimal.from(3000000000.0)); + interval.width().should.equalDecimal(Decimal.from("3000000000.0")); + interval.size().should.equalDecimal(Decimal.from("3000000000.00000001")); }); it('should close open decimal uncertainty endpoints using decimal point size', () => { diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index d4da6e1bd..6adc191e6 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -1,10 +1,10 @@ import should from 'should'; import setup from '../../setup'; -import { Decimal } from '../../../src/datatypes/decimal'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; const data = require('./data'); const validateQuantity = function (object: any, expectedValue: any, expectedUnit: any) { object.isQuantity.should.be.true(); - object.value.should.eql(Decimal.from(expectedValue)); + object.value.should.equalDecimal(expectedValue); object.unit.should.equal(expectedUnit); }; @@ -73,11 +73,11 @@ describe('Sum', () => { }); it('should be able to sum lists with decimals', async function () { - (await this.decimals.exec(this.ctx)).should.eql(Decimal.from(16.5)); + (await this.decimals.exec(this.ctx)).should.equalDecimal(Decimal.from(16.5)); }); it('should be able to sum decimals up to max decimal value', async function () { - (await this.decimals_at_max_value.exec(this.ctx)).should.eql(Decimal.from(99999999999999999999.99999999)); + (await this.decimals_at_max_value.exec(this.ctx)).should.equalDecimal(MAX_DECIMAL_VALUE); }); it('should return null when overflowing the max decimal value', async function () { @@ -85,7 +85,7 @@ describe('Sum', () => { }); it('should be able to sum decimals down to min decimal value', async function () { - (await this.decimals_at_min_value.exec(this.ctx)).should.eql(Decimal.from(-99999999999999999999.99999999)); + (await this.decimals_at_min_value.exec(this.ctx)).should.equalDecimal(MIN_DECIMAL_VALUE); }); it('should return null when underflowing the min decimal value', async function () { @@ -100,7 +100,7 @@ describe('Sum', () => { it('should be able to sum quantities up to max decimal value', async function () { validateQuantity( await this.quantities_at_max_value.exec(this.ctx), - 99999999999999999999.99999999, + MAX_DECIMAL_VALUE, 'ml' ); }); @@ -112,7 +112,7 @@ describe('Sum', () => { it('should be able to sum quantities down to min decimal value', async function () { validateQuantity( await this.quantities_at_min_value.exec(this.ctx), - -99999999999999999999.99999999, + MIN_DECIMAL_VALUE, 'ml' ); }); @@ -184,7 +184,7 @@ describe('Min', () => { }); it('list of Decimals', async function () { - (await this.decimalMin.exec(this.ctx)).should.eql(Decimal.from(-5)); + (await this.decimalMin.exec(this.ctx)).should.equalDecimal(Decimal.from(-5)); }); it('list of DateTimes', async function () { @@ -261,7 +261,7 @@ describe('Max', () => { }); it('list of Decimals', async function () { - (await this.decimalMax.exec(this.ctx)).should.eql(Decimal.from(5.1)); + (await this.decimalMax.exec(this.ctx)).should.equalDecimal(Decimal.from(5.1)); }); it('list of DateTimes', async function () { @@ -310,28 +310,28 @@ describe('Avg', () => { }); it('should be able to find average for lists without nulls', async function () { - (await this.not_null.exec(this.ctx)).should.eql(Decimal.from(3)); + (await this.not_null.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); }); it('should be able to find average for lists with nulls', async function () { - (await this.has_null.exec(this.ctx)).should.eql(Decimal.from(1.5)); + (await this.has_null.exec(this.ctx)).should.equalDecimal(Decimal.from(1.5)); }); it('should return null for empty list', async function () { should(await this.empty.exec(this.ctx)).be.null(); }); - it('should be able to find average for lists of quantiies without nulls', async function () { + it('should be able to find average for lists of quantities without nulls', async function () { const q = await this.not_null_q.exec(this.ctx); validateQuantity(q, 3, 'ml'); }); - it('should be able to find average for lists of quantiies with nulls', async function () { + it('should be able to find average for lists of quantities with nulls', async function () { const q = await this.has_null_q.exec(this.ctx); validateQuantity(q, 1.5, 'ml'); }); - it('should be able to find average for lists of quantiies with related units', async function () { + it('should be able to find average for lists of quantities with related units', async function () { const q = await this.q_diff_units.exec(this.ctx); validateQuantity(q, 3, 'ml'); }); @@ -351,19 +351,19 @@ describe('Median', () => { }); it('should be able to find median of odd numbered list', async function () { - (await this.odd.exec(this.ctx)).should.eql(Decimal.from(3)); + (await this.odd.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); }); it('should be able to find median of even numbered list', async function () { - (await this.even.exec(this.ctx)).should.eql(Decimal.from(3.5)); + (await this.even.exec(this.ctx)).should.equalDecimal(Decimal.from(3.5)); }); it('should be able to find median of odd numbered list that contains duplicates', async function () { - (await this.dup_vals_odd.exec(this.ctx)).should.eql(Decimal.from(3)); + (await this.dup_vals_odd.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); }); it('should be able to find median of even numbered list that contians duplicates', async function () { - (await this.dup_vals_even.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.dup_vals_even.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should return null for empty list', async function () { @@ -438,7 +438,7 @@ describe('PopulationVariance', () => { setup(this, data); }); it('should be able to find PopulationVariance of a list ', async function () { - (await this.v.exec(this.ctx)).should.eql(Decimal.from(2)); + (await this.v.exec(this.ctx)).should.equalDecimal(Decimal.from(2)); }); it('should be able to find PopulationVariance of a list of like quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2, 'ml'); @@ -459,7 +459,7 @@ describe('Variance', () => { setup(this, data); }); it('should be able to find Variance of a list ', async function () { - (await this.v.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.v.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should be able to find Variance of a list of matched quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2.5, 'ml'); @@ -480,13 +480,13 @@ describe('StdDev', () => { setup(this, data); }); it('should be able to find Standard Dev of a list ', async function () { - (await this.std.exec(this.ctx)).should.eql(Decimal.from(1.58113883)); + (await this.std.exec(this.ctx)).should.equalDecimal(Decimal.from("1.58113883")); }); it('should be able to find Standard Dev of a list of like quantities', async function () { - validateQuantity(await this.std_q.exec(this.ctx), 1.5811388300841898, 'ml'); + validateQuantity(await this.std_q.exec(this.ctx), "1.58113883", 'ml'); }); it('should be able to find Standard Dev of a list of related quantities', async function () { - validateQuantity(await this.q_diff_units.exec(this.ctx), 1.5811388300841898, 'ml'); + validateQuantity(await this.q_diff_units.exec(this.ctx), "1.58113883", 'ml'); }); it('should be null if some are numbers and some are quantities', async function () { should(await this.numbersAndQuantities.exec(this.ctx)).be.null(); @@ -501,13 +501,13 @@ describe('PopulationStdDev', () => { setup(this, data); }); it('should be able to find Population Standard Dev of a list ', async function () { - (await this.dev.exec(this.ctx)).should.eql(Decimal.from(1.41421356)); + (await this.dev.exec(this.ctx)).should.equalDecimal(Decimal.from("1.41421356")); }); it('should be able to find Population Standard Dev of a list of quantities', async function () { - validateQuantity(await this.dev_q.exec(this.ctx), 1.4142135623730951, 'ml'); + validateQuantity(await this.dev_q.exec(this.ctx), "1.41421356", 'ml'); }); it('should be able to find Population Standard Dev of a list of related quantities', async function () { - validateQuantity(await this.q_diff_units.exec(this.ctx), 1.4142135623730951, 'ml'); + validateQuantity(await this.q_diff_units.exec(this.ctx), "1.41421356", 'ml'); }); it('should be null if some are numbers and some are quantities', async function () { should(await this.numbersAndQuantities.exec(this.ctx)).be.null(); @@ -563,12 +563,12 @@ describe('Product', () => { }); it('should return a decimal product', async function () { - (await this.decimal_product.exec(this.ctx)).should.eql(Decimal.from(24.0)); + (await this.decimal_product.exec(this.ctx)).should.equalDecimal(Decimal.from(24.0)); }); it('should return decimal product up to max decimal value', async function () { (await this.decimals_at_max_value_product.exec(this.ctx)).should.eql( - Decimal.from(99999999999999999999.99999999) + MAX_DECIMAL_VALUE ); }); @@ -578,7 +578,7 @@ describe('Product', () => { it('should return decimal product down to min decimal value', async function () { (await this.decimals_at_min_value_product.exec(this.ctx)).should.eql( - Decimal.from(-99999999999999999999.99999999) + MIN_DECIMAL_VALUE ); }); @@ -597,7 +597,7 @@ describe('Product', () => { it('should return quantity product up to max decimal value', async function () { validateQuantity( await this.quantities_at_max_value_product.exec(this.ctx), - 99999999999999999999.99999999, + MAX_DECIMAL_VALUE, 'g' ); }); @@ -609,7 +609,7 @@ describe('Product', () => { it('should return quantity product down to min decimal value', async function () { validateQuantity( await this.quantities_at_min_value_product.exec(this.ctx), - -99999999999999999999.99999999, + MIN_DECIMAL_VALUE, 'g' ); }); @@ -654,15 +654,15 @@ describe('GeometricMean', () => { }); it('should return decimal geometric mean', async function () { - (await this.decimal_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(4.0)); + (await this.decimal_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from(4.0)); }); it('should retun 0 as a geometric mean', async function () { - (await this.zero_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(0)); + (await this.zero_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); }); it('should return value when pass in list that contains nulls', async function () { - (await this.null_geometric_mean.exec(this.ctx)).should.eql(Decimal.from(1.41421356)); + (await this.null_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from("1.41421356")); }); it('should return null when list is all null', async function () { diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index 40968e0b3..c82e2527e 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -21,10 +21,14 @@ define decimals_above_max_value: Sum({99999999999999999999.99999999, 99999999999 define decimals_at_min_value: Sum({-99999999999999999999.99999999}) define decimals_below_min_value: Sum({-99999999999999999999.99999999, -99999999999999999999.99999999}) define quantities: Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) -define quantities_at_max_value: Sum({99999999999999999999.99999999 'ml'}) -define quantities_above_max_value: Sum({99999999999999999999.99999999 'ml', 99999999999999999999.99999999 'ml'}) -define quantities_at_min_value: Sum({-99999999999999999999.99999999 'ml'}) -define quantities_below_min_value: Sum({-99999999999999999999.99999999 'ml', -99999999999999999999.99999999 'ml'}) +// Max/Min-valued quantities are described using the "maximum" and "minimum" operators +// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +define MaxValueMLQuantity: Quantity { value: maximum Decimal, unit: 'ml' } +define MinValueMLQuantity: Quantity { value: minimum Decimal, unit: 'ml' } +define quantities_at_max_value: Sum({MaxValueMLQuantity}) +define quantities_above_max_value: Sum({MaxValueMLQuantity, MaxValueMLQuantity}) +define quantities_at_min_value: Sum({MinValueMLQuantity}) +define quantities_below_min_value: Sum({MinValueMLQuantity, MinValueMLQuantity}) define has_null: Sum({1,null,null,null,2}) define has_null_q: Sum({1 'ml',null,null,null,2 'ml'}) define unmatched_units_q: Min({1 'ml',2 'm',3 'ml',4 'ml',5 'ml',0 'ml'}) @@ -156,10 +160,14 @@ define decimals_above_max_value_product: Product({99999999999999999999.99999999, define decimals_at_min_value_product: Product({-99999999999999999999.99999999, 1.0}) define decimals_below_min_value_product: Product({-99999999999999999999.99999999, 2.0}) define quantity_product: Product({1.0 'g', 2.0 'g', 3.0 'g', 4.0 'g'}) -define quantities_at_max_value_product: Product({99999999999999999999.99999999 'g', 1.0 'g'}) -define quantities_above_max_value_product: Product({99999999999999999999.99999999 'g', 2.0 'g'}) -define quantities_at_min_value_product: Product({-99999999999999999999.99999999 'g', 1.0 'g'}) -define quantities_below_min_value_product: Product({-99999999999999999999.99999999 'g', 2.0 'g'}) +// Max/Min-valued quantities are described using the "maximum" and "minimum" operators +// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +define MaxValueGramQuantity: Quantity { value: maximum Decimal, unit: 'g' } +define MinValueGramQuantity: Quantity { value: minimum Decimal, unit: 'g' } +define quantities_at_max_value_product: Product({MaxValueGramQuantity, 1.0 'g'}) +define quantities_above_max_value_product: Product({MaxValueGramQuantity, 2.0 'g'}) +define quantities_at_min_value_product: Product({MinValueGramQuantity, 1.0 'g'}) +define quantities_below_min_value_product: Product({MinValueGramQuantity, 2.0 'g'}) define quantity_zero_product: Product({1.0 'g', 2.0 'g', 0 'g'}) define zero_product: Product({0, 5, 10}) define product_with_null: Product({5, 4, null}) diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index f3231bca3..9199f9626 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -499,10 +499,14 @@ define decimals_above_max_value: Sum({99999999999999999999.99999999, 99999999999 define decimals_at_min_value: Sum({-99999999999999999999.99999999}) define decimals_below_min_value: Sum({-99999999999999999999.99999999, -99999999999999999999.99999999}) define quantities: Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) -define quantities_at_max_value: Sum({99999999999999999999.99999999 'ml'}) -define quantities_above_max_value: Sum({99999999999999999999.99999999 'ml', 99999999999999999999.99999999 'ml'}) -define quantities_at_min_value: Sum({-99999999999999999999.99999999 'ml'}) -define quantities_below_min_value: Sum({-99999999999999999999.99999999 'ml', -99999999999999999999.99999999 'ml'}) +// Max/Min-valued quantities are described using the "maximum" and "minimum" operators +// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +define MaxValueMLQuantity: Quantity { value: maximum Decimal, unit: 'ml' } +define MinValueMLQuantity: Quantity { value: minimum Decimal, unit: 'ml' } +define quantities_at_max_value: Sum({MaxValueMLQuantity}) +define quantities_above_max_value: Sum({MaxValueMLQuantity, MaxValueMLQuantity}) +define quantities_at_min_value: Sum({MinValueMLQuantity}) +define quantities_below_min_value: Sum({MinValueMLQuantity, MinValueMLQuantity}) define has_null: Sum({1,null,null,null,2}) define has_null_q: Sum({1 'ml',null,null,null,2 'ml'}) define unmatched_units_q: Min({1 'ml',2 'm',3 'ml',4 'ml',5 'ml',0 'ml'}) @@ -524,7 +528,7 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "682", + "r" : "694", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -2285,7 +2289,7 @@ module.exports['Sum'] = { }, { "localId" : "502", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "quantities_at_max_value", + "name" : "MaxValueMLQuantity", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -2293,20 +2297,170 @@ module.exports['Sum'] = { "t" : [ ], "s" : { "r" : "502", + "s" : [ { + "value" : [ "// Max/Min-valued quantities are described using the \"maximum\" and \"minimum\" operators\n// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal\n", "define ", "MaxValueMLQuantity", ": " ] + }, { + "r" : "503", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "value" : [ "value", ": " ] + }, { + "r" : "506", + "s" : [ { + "value" : [ "maximum", " " ] + }, { + "r" : "505", + "s" : [ { + "value" : [ "Decimal" ] + } ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "507", + "s" : [ { + "value" : [ "'ml'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Instance", + "localId" : "503", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "MaxValue", + "localId" : "506", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "507", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "ml", + "annotation" : [ ] + } + } ] + } + }, { + "localId" : "511", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "MinValueMLQuantity", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "511", + "s" : [ { + "value" : [ "", "define ", "MinValueMLQuantity", ": " ] + }, { + "r" : "512", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "value" : [ "value", ": " ] + }, { + "r" : "515", + "s" : [ { + "value" : [ "minimum", " " ] + }, { + "r" : "514", + "s" : [ { + "value" : [ "Decimal" ] + } ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "516", + "s" : [ { + "value" : [ "'ml'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Instance", + "localId" : "512", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "MinValue", + "localId" : "515", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "516", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "ml", + "annotation" : [ ] + } + } ] + } + }, { + "localId" : "520", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "quantities_at_max_value", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "520", "s" : [ { "value" : [ "", "define ", "quantities_at_max_value", ": " ] }, { - "r" : "511", + "r" : "529", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "503", + "r" : "521", "s" : [ { "value" : [ "{" ] }, { - "r" : "504", + "r" : "522", "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] + "value" : [ "MaxValueMLQuantity" ] } ] }, { "value" : [ "}" ] @@ -2319,47 +2473,46 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "511", + "localId" : "529", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "512", + "localId" : "530", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "513", + "localId" : "531", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "503", + "localId" : "521", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "505", + "localId" : "523", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "506", + "localId" : "524", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Quantity", - "localId" : "504", + "type" : "ExpressionRef", + "localId" : "522", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", + "name" : "MaxValueMLQuantity", "annotation" : [ ] } ] } } }, { - "localId" : "516", + "localId" : "534", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_above_max_value", "context" : "Patient", @@ -2368,28 +2521,28 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "516", + "r" : "534", "s" : [ { "value" : [ "", "define ", "quantities_above_max_value", ": " ] }, { - "r" : "526", + "r" : "544", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "517", + "r" : "535", "s" : [ { "value" : [ "{" ] }, { - "r" : "518", + "r" : "536", "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] + "value" : [ "MaxValueMLQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "519", + "r" : "537", "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] + "value" : [ "MaxValueMLQuantity" ] } ] }, { "value" : [ "}" ] @@ -2402,54 +2555,52 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "526", + "localId" : "544", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "527", + "localId" : "545", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "528", + "localId" : "546", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "517", + "localId" : "535", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "520", + "localId" : "538", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "521", + "localId" : "539", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Quantity", - "localId" : "518", + "type" : "ExpressionRef", + "localId" : "536", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", + "name" : "MaxValueMLQuantity", "annotation" : [ ] }, { - "type" : "Quantity", - "localId" : "519", + "type" : "ExpressionRef", + "localId" : "537", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", + "name" : "MaxValueMLQuantity", "annotation" : [ ] } ] } } }, { - "localId" : "531", + "localId" : "549", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_at_min_value", "context" : "Patient", @@ -2458,26 +2609,21 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "531", + "r" : "549", "s" : [ { "value" : [ "", "define ", "quantities_at_min_value", ": " ] }, { - "r" : "542", + "r" : "558", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "532", + "r" : "550", "s" : [ { "value" : [ "{" ] }, { - "r" : "533", + "r" : "551", "s" : [ { - "value" : [ "-" ] - }, { - "r" : "534", - "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] - } ] + "value" : [ "MinValueMLQuantity" ] } ] }, { "value" : [ "}" ] @@ -2490,59 +2636,46 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "542", + "localId" : "558", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "543", + "localId" : "559", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "544", + "localId" : "560", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "532", + "localId" : "550", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "536", + "localId" : "552", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "537", + "localId" : "553", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Negate", - "localId" : "533", + "type" : "ExpressionRef", + "localId" : "551", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "535", - "name" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Quantity", - "localId" : "534", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", - "annotation" : [ ] - } + "name" : "MinValueMLQuantity", + "annotation" : [ ] } ] } } }, { - "localId" : "547", + "localId" : "563", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_below_min_value", "context" : "Patient", @@ -2551,38 +2684,28 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "547", + "r" : "563", "s" : [ { "value" : [ "", "define ", "quantities_below_min_value", ": " ] }, { - "r" : "561", + "r" : "573", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "548", + "r" : "564", "s" : [ { "value" : [ "{" ] }, { - "r" : "549", + "r" : "565", "s" : [ { - "value" : [ "-" ] - }, { - "r" : "550", - "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] - } ] + "value" : [ "MinValueMLQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "552", + "r" : "566", "s" : [ { - "value" : [ "-" ] - }, { - "r" : "553", - "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'ml'" ] - } ] + "value" : [ "MinValueMLQuantity" ] } ] }, { "value" : [ "}" ] @@ -2595,78 +2718,52 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "561", + "localId" : "573", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "562", + "localId" : "574", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "563", + "localId" : "575", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "548", + "localId" : "564", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "555", + "localId" : "567", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "556", + "localId" : "568", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Negate", - "localId" : "549", + "type" : "ExpressionRef", + "localId" : "565", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "551", - "name" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Quantity", - "localId" : "550", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", - "annotation" : [ ] - } + "name" : "MinValueMLQuantity", + "annotation" : [ ] }, { - "type" : "Negate", - "localId" : "552", + "type" : "ExpressionRef", + "localId" : "566", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "554", - "name" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Quantity", - "localId" : "553", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "ml", - "annotation" : [ ] - } + "name" : "MinValueMLQuantity", + "annotation" : [ ] } ] } } }, { - "localId" : "566", + "localId" : "578", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "has_null", "context" : "Patient", @@ -2675,17 +2772,17 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "566", + "r" : "578", "s" : [ { "value" : [ "", "define ", "has_null", ": " ] }, { - "r" : "582", + "r" : "594", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "567", + "r" : "579", "s" : [ { - "r" : "568", + "r" : "580", "value" : [ "{", "1", ",", "null", ",", "null", ",", "null", ",", "2", "}" ] } ] }, { @@ -2696,81 +2793,81 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "582", + "localId" : "594", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "583", + "localId" : "595", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "584", + "localId" : "596", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "567", + "localId" : "579", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "576", + "localId" : "588", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "577", + "localId" : "589", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "element" : [ { "type" : "Literal", - "localId" : "568", + "localId" : "580", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", "annotation" : [ ] }, { "type" : "As", - "localId" : "573", + "localId" : "585", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "569", + "localId" : "581", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "574", + "localId" : "586", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "570", + "localId" : "582", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "575", + "localId" : "587", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "571", + "localId" : "583", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "Literal", - "localId" : "572", + "localId" : "584", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -2779,7 +2876,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "587", + "localId" : "599", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "has_null_q", "context" : "Patient", @@ -2788,27 +2885,27 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "587", + "r" : "599", "s" : [ { "value" : [ "", "define ", "has_null_q", ": " ] }, { - "r" : "603", + "r" : "615", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "588", + "r" : "600", "s" : [ { "value" : [ "{" ] }, { - "r" : "589", + "r" : "601", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { - "r" : "590", + "r" : "602", "value" : [ ",", "null", ",", "null", ",", "null", "," ] }, { - "r" : "593", + "r" : "605", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] @@ -2823,81 +2920,81 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "603", + "localId" : "615", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "604", + "localId" : "616", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "605", + "localId" : "617", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "588", + "localId" : "600", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "597", + "localId" : "609", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "598", + "localId" : "610", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "589", + "localId" : "601", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "As", - "localId" : "594", + "localId" : "606", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "590", + "localId" : "602", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "595", + "localId" : "607", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "591", + "localId" : "603", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "596", + "localId" : "608", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "592", + "localId" : "604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "Quantity", - "localId" : "593", + "localId" : "605", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", @@ -2906,7 +3003,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "608", + "localId" : "620", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "unmatched_units_q", "context" : "Patient", @@ -2915,54 +3012,54 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "608", + "r" : "620", "s" : [ { "value" : [ "", "define ", "unmatched_units_q", ": " ] }, { - "r" : "622", + "r" : "634", "s" : [ { "value" : [ "Min", "(" ] }, { - "r" : "609", + "r" : "621", "s" : [ { "value" : [ "{" ] }, { - "r" : "610", + "r" : "622", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "611", + "r" : "623", "s" : [ { "value" : [ "2 ", "'m'" ] } ] }, { "value" : [ "," ] }, { - "r" : "612", + "r" : "624", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "613", + "r" : "625", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "614", + "r" : "626", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "615", + "r" : "627", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -2977,73 +3074,73 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Min", - "localId" : "622", + "localId" : "634", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "623", + "localId" : "635", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "624", + "localId" : "636", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "609", + "localId" : "621", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "616", + "localId" : "628", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "617", + "localId" : "629", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "610", + "localId" : "622", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "611", + "localId" : "623", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "m", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "612", + "localId" : "624", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "613", + "localId" : "625", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "614", + "localId" : "626", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "615", + "localId" : "627", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -3052,7 +3149,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "627", + "localId" : "639", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "empty", "context" : "Patient", @@ -3061,19 +3158,19 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "627", + "r" : "639", "s" : [ { "value" : [ "", "define ", "empty", ": " ] }, { - "r" : "637", + "r" : "649", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "629", + "r" : "641", "s" : [ { "value" : [ "List<" ] }, { - "r" : "628", + "r" : "640", "s" : [ { "value" : [ "Integer" ] } ] @@ -3088,31 +3185,31 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "637", + "localId" : "649", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "638", + "localId" : "650", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "639", + "localId" : "651", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "629", + "localId" : "641", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "631", + "localId" : "643", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "632", + "localId" : "644", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } @@ -3121,7 +3218,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "642", + "localId" : "654", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "q_diff_units", "context" : "Patient", @@ -3130,47 +3227,47 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "642", + "r" : "654", "s" : [ { "value" : [ "", "define ", "q_diff_units", ": " ] }, { - "r" : "655", + "r" : "667", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "643", + "r" : "655", "s" : [ { "value" : [ "{" ] }, { - "r" : "644", + "r" : "656", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "645", + "r" : "657", "s" : [ { "value" : [ "0.002 ", "'l'" ] } ] }, { "value" : [ "," ] }, { - "r" : "646", + "r" : "658", "s" : [ { "value" : [ "0.03 ", "'dl'" ] } ] }, { "value" : [ "," ] }, { - "r" : "647", + "r" : "659", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "648", + "r" : "660", "s" : [ { "value" : [ "0.005 ", "'l'" ] } ] @@ -3185,66 +3282,66 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "655", + "localId" : "667", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "656", + "localId" : "668", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "657", + "localId" : "669", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "643", + "localId" : "655", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "649", + "localId" : "661", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "650", + "localId" : "662", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "644", + "localId" : "656", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "645", + "localId" : "657", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "l", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "646", + "localId" : "658", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.03, "unit" : "dl", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "647", + "localId" : "659", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "648", + "localId" : "660", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.005, "unit" : "l", @@ -3253,7 +3350,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "660", + "localId" : "672", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "NumbersAndQuantities", "context" : "Patient", @@ -3262,48 +3359,48 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "660", + "r" : "672", "s" : [ { "value" : [ "", "define ", "NumbersAndQuantities", ": " ] }, { - "r" : "677", + "r" : "689", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "661", + "r" : "673", "s" : [ { - "r" : "662", + "r" : "674", "value" : [ "{", "1", " ," ] }, { - "r" : "663", + "r" : "675", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "664", + "r" : "676", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "665", + "r" : "677", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "666", + "r" : "678", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "667", + "r" : "679", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -3318,48 +3415,48 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "677", + "localId" : "689", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "678", + "localId" : "690", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "679", + "localId" : "691", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "661", + "localId" : "673", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "671", + "localId" : "683", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "672", + "localId" : "684", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "ToQuantity", - "localId" : "669", + "localId" : "681", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "670", + "localId" : "682", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "662", + "localId" : "674", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -3367,35 +3464,35 @@ module.exports['Sum'] = { } }, { "type" : "Quantity", - "localId" : "663", + "localId" : "675", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "664", + "localId" : "676", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "665", + "localId" : "677", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "666", + "localId" : "678", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "667", + "localId" : "679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -3404,7 +3501,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "682", + "localId" : "694", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "IncompatibleUnitsNull", "context" : "Patient", @@ -3413,26 +3510,26 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "682", + "r" : "694", "s" : [ { "value" : [ "", "define ", "IncompatibleUnitsNull", ": " ] }, { - "r" : "692", + "r" : "704", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "683", + "r" : "695", "s" : [ { "value" : [ "{" ] }, { - "r" : "684", + "r" : "696", "s" : [ { "value" : [ "1 ", "'mg/d'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "685", + "r" : "697", "s" : [ { "value" : [ "0.002 ", "'/d'" ] } ] @@ -3447,45 +3544,45 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "692", + "localId" : "704", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "693", + "localId" : "705", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "694", + "localId" : "706", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "683", + "localId" : "695", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "686", + "localId" : "698", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "687", + "localId" : "699", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "684", + "localId" : "696", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "mg/d", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "685", + "localId" : "697", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "/d", @@ -15140,10 +15237,14 @@ define decimals_above_max_value_product: Product({99999999999999999999.99999999, define decimals_at_min_value_product: Product({-99999999999999999999.99999999, 1.0}) define decimals_below_min_value_product: Product({-99999999999999999999.99999999, 2.0}) define quantity_product: Product({1.0 'g', 2.0 'g', 3.0 'g', 4.0 'g'}) -define quantities_at_max_value_product: Product({99999999999999999999.99999999 'g', 1.0 'g'}) -define quantities_above_max_value_product: Product({99999999999999999999.99999999 'g', 2.0 'g'}) -define quantities_at_min_value_product: Product({-99999999999999999999.99999999 'g', 1.0 'g'}) -define quantities_below_min_value_product: Product({-99999999999999999999.99999999 'g', 2.0 'g'}) +// Max/Min-valued quantities are described using the "maximum" and "minimum" operators +// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +define MaxValueGramQuantity: Quantity { value: maximum Decimal, unit: 'g' } +define MinValueGramQuantity: Quantity { value: minimum Decimal, unit: 'g' } +define quantities_at_max_value_product: Product({MaxValueGramQuantity, 1.0 'g'}) +define quantities_above_max_value_product: Product({MaxValueGramQuantity, 2.0 'g'}) +define quantities_at_min_value_product: Product({MinValueGramQuantity, 1.0 'g'}) +define quantities_below_min_value_product: Product({MinValueGramQuantity, 2.0 'g'}) define quantity_zero_product: Product({1.0 'g', 2.0 'g', 0 'g'}) define zero_product: Product({0, 5, 10}) define product_with_null: Product({5, 4, null}) @@ -15166,7 +15267,7 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "670", + "r" : "684", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -16683,7 +16784,7 @@ module.exports['Product'] = { }, { "localId" : "475", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "quantities_at_max_value_product", + "name" : "MaxValueGramQuantity", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -16692,24 +16793,174 @@ module.exports['Product'] = { "s" : { "r" : "475", "s" : [ { - "value" : [ "", "define ", "quantities_at_max_value_product", ": " ] + "value" : [ "// Max/Min-valued quantities are described using the \"maximum\" and \"minimum\" operators\n// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal\n", "define ", "MaxValueGramQuantity", ": " ] + }, { + "r" : "476", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "value" : [ "value", ": " ] + }, { + "r" : "479", + "s" : [ { + "value" : [ "maximum", " " ] + }, { + "r" : "478", + "s" : [ { + "value" : [ "Decimal" ] + } ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "480", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Instance", + "localId" : "476", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "MaxValue", + "localId" : "479", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "480", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + } + }, { + "localId" : "484", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "MinValueGramQuantity", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "484", + "s" : [ { + "value" : [ "", "define ", "MinValueGramQuantity", ": " ] }, { "r" : "485", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "value" : [ "value", ": " ] + }, { + "r" : "488", + "s" : [ { + "value" : [ "minimum", " " ] + }, { + "r" : "487", + "s" : [ { + "value" : [ "Decimal" ] + } ] + } ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "489", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Instance", + "localId" : "485", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "MinValue", + "localId" : "488", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "489", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + } + }, { + "localId" : "493", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "quantities_at_max_value_product", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "493", + "s" : [ { + "value" : [ "", "define ", "quantities_at_max_value_product", ": " ] + }, { + "r" : "503", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "476", + "r" : "494", "s" : [ { "value" : [ "{" ] }, { - "r" : "477", + "r" : "495", "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'g'" ] + "value" : [ "MaxValueGramQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "478", + "r" : "496", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] @@ -16724,45 +16975,44 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "485", + "localId" : "503", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "486", + "localId" : "504", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "487", + "localId" : "505", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "476", + "localId" : "494", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "479", + "localId" : "497", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "480", + "localId" : "498", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Quantity", - "localId" : "477", + "type" : "ExpressionRef", + "localId" : "495", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "g", + "name" : "MaxValueGramQuantity", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "478", + "localId" : "496", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", @@ -16771,7 +17021,7 @@ module.exports['Product'] = { } } }, { - "localId" : "490", + "localId" : "508", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_above_max_value_product", "context" : "Patient", @@ -16780,26 +17030,26 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "490", + "r" : "508", "s" : [ { "value" : [ "", "define ", "quantities_above_max_value_product", ": " ] }, { - "r" : "500", + "r" : "518", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "491", + "r" : "509", "s" : [ { "value" : [ "{" ] }, { - "r" : "492", + "r" : "510", "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'g'" ] + "value" : [ "MaxValueGramQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "493", + "r" : "511", "s" : [ { "value" : [ "2.0 ", "'g'" ] } ] @@ -16814,45 +17064,44 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "500", + "localId" : "518", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "501", + "localId" : "519", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "502", + "localId" : "520", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "491", + "localId" : "509", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "494", + "localId" : "512", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "495", + "localId" : "513", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Quantity", - "localId" : "492", + "type" : "ExpressionRef", + "localId" : "510", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "g", + "name" : "MaxValueGramQuantity", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "493", + "localId" : "511", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2.0, "unit" : "g", @@ -16861,7 +17110,7 @@ module.exports['Product'] = { } } }, { - "localId" : "505", + "localId" : "523", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_at_min_value_product", "context" : "Patient", @@ -16870,31 +17119,26 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "505", + "r" : "523", "s" : [ { "value" : [ "", "define ", "quantities_at_min_value_product", ": " ] }, { - "r" : "517", + "r" : "533", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "506", + "r" : "524", "s" : [ { "value" : [ "{" ] }, { - "r" : "507", + "r" : "525", "s" : [ { - "value" : [ "-" ] - }, { - "r" : "508", - "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'g'" ] - } ] + "value" : [ "MinValueGramQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "510", + "r" : "526", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] @@ -16909,57 +17153,44 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "517", + "localId" : "533", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "518", + "localId" : "534", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "519", + "localId" : "535", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "506", + "localId" : "524", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "511", + "localId" : "527", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "512", + "localId" : "528", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Negate", - "localId" : "507", + "type" : "ExpressionRef", + "localId" : "525", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "509", - "name" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Quantity", - "localId" : "508", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "g", - "annotation" : [ ] - } + "name" : "MinValueGramQuantity", + "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "510", + "localId" : "526", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", @@ -16968,7 +17199,7 @@ module.exports['Product'] = { } } }, { - "localId" : "522", + "localId" : "538", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantities_below_min_value_product", "context" : "Patient", @@ -16977,31 +17208,26 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "522", + "r" : "538", "s" : [ { "value" : [ "", "define ", "quantities_below_min_value_product", ": " ] }, { - "r" : "534", + "r" : "548", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "523", + "r" : "539", "s" : [ { "value" : [ "{" ] }, { - "r" : "524", + "r" : "540", "s" : [ { - "value" : [ "-" ] - }, { - "r" : "525", - "s" : [ { - "value" : [ "99999999999999999999.99999999 ", "'g'" ] - } ] + "value" : [ "MinValueGramQuantity" ] } ] }, { "value" : [ ", " ] }, { - "r" : "527", + "r" : "541", "s" : [ { "value" : [ "2.0 ", "'g'" ] } ] @@ -17016,57 +17242,44 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "534", + "localId" : "548", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "535", + "localId" : "549", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "536", + "localId" : "550", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "523", + "localId" : "539", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "528", + "localId" : "542", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "529", + "localId" : "543", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { - "type" : "Negate", - "localId" : "524", + "type" : "ExpressionRef", + "localId" : "540", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "526", - "name" : "{urn:hl7-org:elm-types:r1}Quantity", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Quantity", - "localId" : "525", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 1.0E20, - "unit" : "g", - "annotation" : [ ] - } + "name" : "MinValueGramQuantity", + "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "527", + "localId" : "541", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2.0, "unit" : "g", @@ -17075,7 +17288,7 @@ module.exports['Product'] = { } } }, { - "localId" : "539", + "localId" : "553", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "quantity_zero_product", "context" : "Patient", @@ -17084,33 +17297,33 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "539", + "r" : "553", "s" : [ { "value" : [ "", "define ", "quantity_zero_product", ": " ] }, { - "r" : "550", + "r" : "564", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "540", + "r" : "554", "s" : [ { "value" : [ "{" ] }, { - "r" : "541", + "r" : "555", "s" : [ { "value" : [ "1.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "542", + "r" : "556", "s" : [ { "value" : [ "2.0 ", "'g'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "543", + "r" : "557", "s" : [ { "value" : [ "0 ", "'g'" ] } ] @@ -17125,52 +17338,52 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "550", + "localId" : "564", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "551", + "localId" : "565", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "552", + "localId" : "566", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "540", + "localId" : "554", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "544", + "localId" : "558", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "545", + "localId" : "559", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "541", + "localId" : "555", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1.0, "unit" : "g", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "542", + "localId" : "556", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2.0, "unit" : "g", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "543", + "localId" : "557", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "g", @@ -17179,7 +17392,7 @@ module.exports['Product'] = { } } }, { - "localId" : "555", + "localId" : "569", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "zero_product", "context" : "Patient", @@ -17188,17 +17401,17 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "555", + "r" : "569", "s" : [ { "value" : [ "", "define ", "zero_product", ": " ] }, { - "r" : "566", + "r" : "580", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "556", + "r" : "570", "s" : [ { - "r" : "557", + "r" : "571", "value" : [ "{", "0", ", ", "5", ", ", "10", "}" ] } ] }, { @@ -17209,52 +17422,52 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "566", + "localId" : "580", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "567", + "localId" : "581", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "568", + "localId" : "582", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "556", + "localId" : "570", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "560", + "localId" : "574", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "561", + "localId" : "575", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "element" : [ { "type" : "Literal", - "localId" : "557", + "localId" : "571", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "0", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "558", + "localId" : "572", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "559", + "localId" : "573", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "10", @@ -17263,7 +17476,7 @@ module.exports['Product'] = { } } }, { - "localId" : "571", + "localId" : "585", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "product_with_null", "context" : "Patient", @@ -17272,17 +17485,17 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "571", + "r" : "585", "s" : [ { "value" : [ "", "define ", "product_with_null", ": " ] }, { - "r" : "583", + "r" : "597", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "572", + "r" : "586", "s" : [ { - "r" : "573", + "r" : "587", "value" : [ "{", "5", ", ", "4", ", ", "null", "}" ] } ] }, { @@ -17293,58 +17506,58 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "583", + "localId" : "597", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "584", + "localId" : "598", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "585", + "localId" : "599", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "572", + "localId" : "586", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "577", + "localId" : "591", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "578", + "localId" : "592", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "element" : [ { "type" : "Literal", - "localId" : "573", + "localId" : "587", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "5", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "574", + "localId" : "588", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "4", "annotation" : [ ] }, { "type" : "As", - "localId" : "576", + "localId" : "590", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "575", + "localId" : "589", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } @@ -17352,7 +17565,7 @@ module.exports['Product'] = { } } }, { - "localId" : "588", + "localId" : "602", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "product_of_nulls", "context" : "Patient", @@ -17361,30 +17574,30 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "588", + "r" : "602", "s" : [ { "value" : [ "", "define ", "product_of_nulls", ": " ] }, { - "r" : "603", + "r" : "617", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "589", + "r" : "603", "s" : [ { "value" : [ "{" ] }, { - "r" : "590", + "r" : "604", "s" : [ { - "r" : "591", + "r" : "605", "value" : [ "null", " as " ] }, { - "r" : "592", + "r" : "606", "s" : [ { "value" : [ "Integer" ] } ] } ] }, { - "r" : "593", + "r" : "607", "value" : [ ", ", "null", ", ", "null", "}" ] } ] }, { @@ -17395,76 +17608,76 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "603", + "localId" : "617", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "604", + "localId" : "618", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "605", + "localId" : "619", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "589", + "localId" : "603", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "597", + "localId" : "611", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "598", + "localId" : "612", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "element" : [ { "type" : "As", - "localId" : "590", + "localId" : "604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "591", + "localId" : "605", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "NamedTypeSpecifier", - "localId" : "592", + "localId" : "606", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, { "type" : "As", - "localId" : "595", + "localId" : "609", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "593", + "localId" : "607", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "596", + "localId" : "610", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "594", + "localId" : "608", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } @@ -17472,7 +17685,7 @@ module.exports['Product'] = { } } }, { - "localId" : "608", + "localId" : "622", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "name" : "product_null", "context" : "Patient", @@ -17481,24 +17694,24 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "608", + "r" : "622", "s" : [ { "value" : [ "", "define ", "product_null", ": " ] }, { - "r" : "621", + "r" : "635", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "609", + "r" : "623", "s" : [ { - "r" : "610", + "r" : "624", "value" : [ "null", " as " ] }, { - "r" : "611", + "r" : "625", "s" : [ { "value" : [ "List<" ] }, { - "r" : "612", + "r" : "626", "s" : [ { "value" : [ "Decimal" ] } ] @@ -17514,32 +17727,32 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "621", + "localId" : "635", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "622", + "localId" : "636", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "623", + "localId" : "637", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } } ], "source" : { "type" : "As", - "localId" : "609", + "localId" : "623", "strict" : false, "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "615", + "localId" : "629", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "616", + "localId" : "630", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } @@ -17547,28 +17760,28 @@ module.exports['Product'] = { "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "610", + "localId" : "624", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "611", + "localId" : "625", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "613", + "localId" : "627", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "614", + "localId" : "628", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } }, "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "612", + "localId" : "626", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] @@ -17577,7 +17790,7 @@ module.exports['Product'] = { } } }, { - "localId" : "626", + "localId" : "640", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "product_quantity_null", "context" : "Patient", @@ -17586,24 +17799,24 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "626", + "r" : "640", "s" : [ { "value" : [ "", "define ", "product_quantity_null", ": " ] }, { - "r" : "643", + "r" : "657", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "627", + "r" : "641", "s" : [ { "value" : [ "{" ] }, { - "r" : "628", + "r" : "642", "s" : [ { - "r" : "629", + "r" : "643", "value" : [ "null", " as " ] }, { - "r" : "630", + "r" : "644", "s" : [ { "value" : [ "Quantity" ] } ] @@ -17611,12 +17824,12 @@ module.exports['Product'] = { }, { "value" : [ ", " ] }, { - "r" : "631", + "r" : "645", "s" : [ { - "r" : "632", + "r" : "646", "value" : [ "null", " as " ] }, { - "r" : "633", + "r" : "647", "s" : [ { "value" : [ "Quantity" ] } ] @@ -17624,12 +17837,12 @@ module.exports['Product'] = { }, { "value" : [ ", " ] }, { - "r" : "634", + "r" : "648", "s" : [ { - "r" : "635", + "r" : "649", "value" : [ "null", " as " ] }, { - "r" : "636", + "r" : "650", "s" : [ { "value" : [ "Quantity" ] } ] @@ -17645,91 +17858,91 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "643", + "localId" : "657", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "644", + "localId" : "658", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "645", + "localId" : "659", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "627", + "localId" : "641", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "637", + "localId" : "651", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "638", + "localId" : "652", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "As", - "localId" : "628", + "localId" : "642", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "629", + "localId" : "643", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "NamedTypeSpecifier", - "localId" : "630", + "localId" : "644", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "As", - "localId" : "631", + "localId" : "645", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "632", + "localId" : "646", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "NamedTypeSpecifier", - "localId" : "633", + "localId" : "647", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, { "type" : "As", - "localId" : "634", + "localId" : "648", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "strict" : false, "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "635", + "localId" : "649", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] }, "asTypeSpecifier" : { "type" : "NamedTypeSpecifier", - "localId" : "636", + "localId" : "650", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] @@ -17738,7 +17951,7 @@ module.exports['Product'] = { } } }, { - "localId" : "648", + "localId" : "662", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "NumbersAndQuantities", "context" : "Patient", @@ -17747,48 +17960,48 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "648", + "r" : "662", "s" : [ { "value" : [ "", "define ", "NumbersAndQuantities", ": " ] }, { - "r" : "665", + "r" : "679", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "649", + "r" : "663", "s" : [ { - "r" : "650", + "r" : "664", "value" : [ "{", "1", " ," ] }, { - "r" : "651", + "r" : "665", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "652", + "r" : "666", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "653", + "r" : "667", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "654", + "r" : "668", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "655", + "r" : "669", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -17803,48 +18016,48 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "665", + "localId" : "679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "666", + "localId" : "680", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "667", + "localId" : "681", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "649", + "localId" : "663", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "659", + "localId" : "673", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "660", + "localId" : "674", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "ToQuantity", - "localId" : "657", + "localId" : "671", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "658", + "localId" : "672", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "650", + "localId" : "664", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -17852,35 +18065,35 @@ module.exports['Product'] = { } }, { "type" : "Quantity", - "localId" : "651", + "localId" : "665", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "652", + "localId" : "666", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "653", + "localId" : "667", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "654", + "localId" : "668", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "655", + "localId" : "669", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -17889,7 +18102,7 @@ module.exports['Product'] = { } } }, { - "localId" : "670", + "localId" : "684", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "IncompatibleUnitsNull", "context" : "Patient", @@ -17898,26 +18111,26 @@ module.exports['Product'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "670", + "r" : "684", "s" : [ { "value" : [ "", "define ", "IncompatibleUnitsNull", ": " ] }, { - "r" : "680", + "r" : "694", "s" : [ { "value" : [ "Product", "(" ] }, { - "r" : "671", + "r" : "685", "s" : [ { "value" : [ "{" ] }, { - "r" : "672", + "r" : "686", "s" : [ { "value" : [ "1 ", "'mg/d'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "673", + "r" : "687", "s" : [ { "value" : [ "0.002 ", "'/d'" ] } ] @@ -17932,45 +18145,45 @@ module.exports['Product'] = { } ], "expression" : { "type" : "Product", - "localId" : "680", + "localId" : "694", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "681", + "localId" : "695", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "682", + "localId" : "696", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "671", + "localId" : "685", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "674", + "localId" : "688", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "675", + "localId" : "689", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "672", + "localId" : "686", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "mg/d", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "673", + "localId" : "687", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "/d", diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 618265736..774aa91bd 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -211,64 +211,64 @@ describe('Divide', () => { }); it('should divide two numbers', async function () { - (await this.tenDividedByTwo.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.tenDividedByTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); }); it("should divide two numbers that don't evenly divide", async function () { - (await this.tenDividedByFour.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.tenDividedByFour.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should divide multiple numbers', async function () { - (await this.divideMultiple.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.divideMultiple.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); }); it('should divide variables', async function () { - (await this.divideVariables.exec(this.ctx)).should.eql(Decimal.from(25)); + (await this.divideVariables.exec(this.ctx)).should.equalDecimal(Decimal.from(25)); }); it('should divide two longs', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoLong.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.tenDividedByTwoLong.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); }); it('should divide integer by long', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoMixed.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.tenDividedByTwoMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); }); it('should divide long by integer', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.eql(Decimal.from(5)); + (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); }); it('should divide two longs with decimal result', async function () { - (await this.tenDividedByFourLong.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.tenDividedByFourLong.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should divide integer by long with decimal result', async function () { - (await this.tenDividedByFourMixed.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.tenDividedByFourMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should divide long by integer with decimal result', async function () { - (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.eql(Decimal.from(2.5)); + (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); }); it('should divide uncertainty by uncertainty', async function () { const result = await this.divideUncertainties.exec(this.ctx); - result.low.should.eql(Decimal.from(0.42857143)); // 6/14 - result.high.should.eql(Decimal.from(9)); + result.low.should.equalDecimal(Decimal.from("0.42857143")); // 6/14 + result.high.should.equalDecimal(Decimal.from(9)); }); it('should divide uncertainty by number', async function () { const result = await this.divideUncertaintyByNumber.exec(this.ctx); - result.low.should.eql(Decimal.from(3)); - result.high.should.eql(Decimal.from(9)); + result.low.should.equalDecimal(Decimal.from(3)); + result.high.should.equalDecimal(Decimal.from(9)); }); it('should divide number by uncertainty', async function () { const result = await this.divideNumberByUncertainty.exec(this.ctx); - result.low.should.eql(Decimal.from(2)); - result.high.should.eql(Decimal.from(6)); + result.low.should.equalDecimal(Decimal.from(2)); + result.high.should.equalDecimal(Decimal.from(6)); }); }); @@ -300,11 +300,11 @@ describe('MathPrecedence', () => { }); it('should follow order of operations', async function () { - (await this.mixed.exec(this.ctx)).should.eql(Decimal.from(46)); + (await this.mixed.exec(this.ctx)).should.equalDecimal(Decimal.from(46)); }); it('should allow parentheses to override order of operations', async function () { - (await this.parenthetical.exec(this.ctx)).should.eql(Decimal.from(-10)); + (await this.parenthetical.exec(this.ctx)).should.equalDecimal(Decimal.from(-10)); }); }); @@ -318,7 +318,7 @@ describe('Power', () => { }); it('should be able to calculate the negative power of a number', async function () { - (await this.negPow.exec(this.ctx)).should.eql(Decimal.from(0.1)); + (await this.negPow.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); }); it('should be able to calculate the power of a long', async function () { @@ -334,7 +334,7 @@ describe('Power', () => { }); it('should be able to calculate the negative power of a long', async function () { - (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.eql(Decimal.from(0.1)); + (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); }); it('should return null when a long power exponent is too large (beyond max Long value)', async function () { @@ -368,19 +368,12 @@ describe('MinValue', () => { String(minLongResult).should.equal(minLongStringValue); }); - // JS number doesn't handle limits of decimal precisely, but this ensures we are in the ballpark - it('of Decimal should return approximate minimum representable Decimal value', async function () { - const minDecimalValue = -99999999999999999999.99999999; - const minDecimalResult = await this.minDecimal.exec(this.ctx); - minDecimalResult.should.be.approximately(minDecimalValue, 0.000000001); - }); - - it.skip('of Decimal should return exact minimum representable Decimal value', async function () { - const minDecimalValue = -99999999999999999999.99999999; + it('of Decimal should return exact minimum representable Decimal value', async function () { const minDecimalStringValue = '-99999999999999999999.99999999'; + const minDecimalValue = Decimal.from(minDecimalStringValue); const minDecimalResult = await this.minDecimal.exec(this.ctx); - minDecimalResult.should.equal(minDecimalValue); - String(minDecimalResult).should.equal(minDecimalStringValue); + minDecimalResult.should.equalDecimal(minDecimalValue); + minDecimalResult.toString().should.equal(minDecimalStringValue); }); it('of DateTime should return minimum representable DateTime value', async function () { @@ -428,19 +421,12 @@ describe('MaxValue', () => { String(maxLongResult).should.equal(maxLongStringValue); }); - // JS number doesn't handle limits of decimal precisely, but this ensures we are in the ballpark - it('of Decimal should return approximate maximum representable Decimal value', async function () { - const maxDecimalValue = 99999999999999999999.99999999; - const maxDecimalResult = await this.maxDecimal.exec(this.ctx); - maxDecimalResult.should.be.approximately(maxDecimalValue, 0.000000001); - }); - - it.skip('of Decimal should return exact maximum representable Decimal value', async function () { - const maxDecimalValue = 99999999999999999999.99999999; + it('of Decimal should return exact maximum representable Decimal value', async function () { const maxDecimalStringValue = '99999999999999999999.99999999'; + const maxDecimalValue = Decimal.from(maxDecimalStringValue); const maxDecimalResult = await this.maxDecimal.exec(this.ctx); - maxDecimalResult.should.equal(maxDecimalValue, 0.000000001); - String(maxDecimalResult).should.equal(maxDecimalStringValue); + maxDecimalResult.should.equalDecimal(maxDecimalValue); + maxDecimalResult.toString().should.equal(maxDecimalStringValue); }); it('of DateTime should return maximum representable DateTime value', async function () { @@ -551,11 +537,13 @@ describe('Ln', () => { }); it('should be able to return the natural log of a number', async function () { - (await this.ln.exec(this.ctx)).should.eql(Decimal.from(Math.log(4))); + const log4 = Decimal.from("1.3862943611198906").normalized(); + (await this.ln.exec(this.ctx)).should.equalDecimal(log4); }); it('should be able to return the natural log of a long', async function () { - (await this.lnFourLong.exec(this.ctx)).should.eql(Decimal.from(Math.log(4))); + const log4 = Decimal.from("1.3862943611198906").normalized(); + (await this.lnFourLong.exec(this.ctx)).should.equalDecimal(log4); }); }); @@ -565,11 +553,11 @@ describe('Log', () => { }); it('should be able to return the log of a number based on an arbitrary base value', async function () { - (await this.log.exec(this.ctx)).should.eql(Decimal.from(0.25)); + (await this.log.exec(this.ctx)).should.equalDecimal(Decimal.from(0.25)); }); it('should be able to return the log of a long based on an arbitrary base value', async function () { - (await this.logLong.exec(this.ctx)).should.eql(Decimal.from(0.25)); + (await this.logLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.25)); }); }); @@ -638,12 +626,12 @@ describe('Round', () => { }); it('should be able to round a number up or down to the closest integer value', async function () { - (await this.up.exec(this.ctx)).should.eql(Decimal.from(5)); - (await this.down.exec(this.ctx)).should.eql(Decimal.from(4)); + (await this.up.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.down.exec(this.ctx)).should.equalDecimal(Decimal.from(4)); }); it('should be able to round a number up or down to the closest decimal place ', async function () { - (await this.up_percent.exec(this.ctx)).should.eql(Decimal.from(4.6)); - (await this.down_percent.exec(this.ctx)).should.eql(Decimal.from(4.4)); + (await this.up_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.6)); + (await this.down_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.4)); }); }); @@ -661,7 +649,7 @@ describe('Successor', () => { }); it('should be able to get Real Successor', async function () { - (await this.rs.exec(this.ctx)).should.eql(Decimal.from(2.2 + Math.pow(10, -8))); + (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from(2.2 + Math.pow(10, -8))); }); it('should return null for Successor greater than Integer Max value', async function () { @@ -764,7 +752,7 @@ describe('Predecessor', () => { }); it('should be able to get Real Predecessor', async function () { - (await this.rs.exec(this.ctx)).should.eql(Decimal.from(2.2 - Math.pow(10, -8))); + (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from("2.19999999")); }); it('should return null for Predecessor greater than Integer Max value', async function () { @@ -891,13 +879,13 @@ describe('Quantity', () => { it('should be able to perform Quantity Absolution', async function () { const q = await this.abs.exec(this.ctx); - q.value.should.eql(Decimal.from(10)); + q.value.should.equalDecimal(Decimal.from(10)); q.unit.should.equal('days'); }); it('should be able to perform Quantity Negation', async function () { const q = await this.neg.exec(this.ctx); - q.value.should.eql(Decimal.from(-10)); + q.value.should.equalDecimal(Decimal.from(-10)); q.unit.should.equal('days'); }); @@ -1023,12 +1011,12 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but more than max integer and near JavaScript max safe number - should(await this.integerDivideNearOverflow.exec(this.ctx)).eql(Decimal.from(8589934588000000)); + should(await this.integerDivideNearOverflow.exec(this.ctx)).equalDecimal(Decimal.from(8589934588000000)); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but less than min integer and near JavaScript min safe number - should(await this.integerDivideNearUnderflow.exec(this.ctx)).eql(Decimal.from(-8589934592000000)); + should(await this.integerDivideNearUnderflow.exec(this.ctx)).equalDecimal(Decimal.from(-8589934592000000)); }); it('should return null for Divide By Zero', async function () { @@ -1127,12 +1115,15 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but near JavaScript max safe number - should(await this.longDivideNearOverflow.exec(this.ctx)).eql(Decimal.from(9007199254740992n)); + // note that all division in CQL (except truncated division) is really decimal division + // note also that MAX_LONG_VALUE is (2^63)-1, + // 9223372036854775807 = 7^2 * 73 * 127 * 337 * 92737 * 649657 + should(await this.longDivideNearOverflow.exec(this.ctx)).equalDecimal(Decimal.from(99457304386111n)); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but near JavaScript min safe number - should(await this.longDivideNearUnderflow.exec(this.ctx)).eql(Decimal.from(-9007199254740992n)); + should(await this.longDivideNearUnderflow.exec(this.ctx)).equalDecimal(Decimal.from(-9007199254740992n)); }); it('should return null for Divide By Zero', async function () { @@ -1265,13 +1256,12 @@ describe('OutOfBounds', () => { should(await this.decimalPredecessorUnderflow.exec(this.ctx)).be.null(); }); - // NOTE: skipping successor/predecessor tests near overflow due to JS Number imprecision - it.skip('should return value for successor near overflow', async function () { - should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equal(MAX_DECIMAL_VALUE); + it('should return value for successor near overflow', async function () { + should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equalDecimal(MAX_DECIMAL_VALUE); }); - it.skip('should return value for predecessor near underflow', async function () { - should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equal(MIN_DECIMAL_VALUE); + it('should return value for predecessor near underflow', async function () { + should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equalDecimal(MIN_DECIMAL_VALUE); }); }); @@ -1369,14 +1359,14 @@ describe('OutOfBounds', () => { }); // NOTE: skipping successor/predecessor tests near overflow due to JS Number imprecision - it.skip('should return value for successor near overflow', async function () { + it('should return value for successor near overflow', async function () { const result = await this.quantitySuccessorNearOverflow.exec(this.ctx); should(result).not.be.null(); validateQuantity(result, MAX_DECIMAL_VALUE, 'mm'); }); - it.skip('should return value for predecessor near underflow', async function () { - const result = await this.quantitPpredecessorNearOverflow.exec(this.ctx); + it('should return value for predecessor near underflow', async function () { + const result = await this.quantityPredecessorNearUnderflow.exec(this.ctx); should(result).not.be.null(); validateQuantity(result, MIN_DECIMAL_VALUE, 'mm'); }); diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 883ad6e33..5f621470a 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -250,7 +250,7 @@ define LongMultiplyNearUnderflow: minimum Long * 1L // NOTE: Long division results in decimal, so it must overflow/underflow decimal define LongDivideOverflow: maximum Long / 0.05 define LongDivideUnderflow: minimum Long / 0.05 -define LongDivideNearOverflow: maximum Long / 1024L +define LongDivideNearOverflow: maximum Long / 92737L define LongDivideNearUnderflow: minimum Long / 1024L define LongDivideByZero: 1L / 0L define LongPowerOverflow: (maximum Long)^3L diff --git a/test/elm/arithmetic/data.js b/test/elm/arithmetic/data.js index dfc83788a..fd1503036 100644 --- a/test/elm/arithmetic/data.js +++ b/test/elm/arithmetic/data.js @@ -13277,7 +13277,7 @@ define LongMultiplyNearUnderflow: minimum Long * 1L // NOTE: Long division results in decimal, so it must overflow/underflow decimal define LongDivideOverflow: maximum Long / 0.05 define LongDivideUnderflow: minimum Long / 0.05 -define LongDivideNearOverflow: maximum Long / 1024L +define LongDivideNearOverflow: maximum Long / 92737L define LongDivideNearUnderflow: minimum Long / 1024L define LongDivideByZero: 1L / 0L define LongPowerOverflow: (maximum Long)^3L @@ -16148,7 +16148,7 @@ module.exports['OutOfBounds'] = { } ] }, { "r" : "600", - "value" : [ " / ", "1024L" ] + "value" : [ " / ", "92737L" ] } ] } ] } @@ -16201,7 +16201,7 @@ module.exports['OutOfBounds'] = { "localId" : "600", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "1024", + "value" : "92737", "annotation" : [ ] } } ] diff --git a/test/elm/clinical/clinical-test.ts b/test/elm/clinical/clinical-test.ts index e7eb48279..bdb99d29f 100644 --- a/test/elm/clinical/clinical-test.ts +++ b/test/elm/clinical/clinical-test.ts @@ -484,7 +484,7 @@ describe('CalculateAge: Date-Only Birth Date as DateTime', () => { // Execute these tests as if it is 2020-10-01 at 12:01:02.003 GMT this.ctx.executionDateTime = new DT.DateTime(2020, 10, 1, 12, 1, 2, 3, 0); // Fix the timezone offset to 0 to make things more predictable - this.ctx.patient.birthDate.timezoneOffset = 0; + this.ctx.patient.birthDate.timezoneOffset = DT.Decimal.from(0); }); it('should execute age in years', async function () { @@ -529,7 +529,7 @@ describe('CalculateAge: Date-Only Birth Date as DateTime on Today', () => { // Execute these tests as if it is 2020-10-01 at 12:01:02.003 GMT this.ctx.executionDateTime = new DT.DateTime(2020, 10, 1, 12, 1, 2, 3, 0); // Fix the timezone offset to 0 to make things more predictable - this.ctx.patient.birthDate.timezoneOffset = 0; + this.ctx.patient.birthDate.timezoneOffset = DT.Decimal.from(0); }); it('should execute age in years', async function () { diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index 72f6c059a..7e0ac943a 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -29,7 +29,7 @@ describe('FromString', () => { }); it("should convert '10.2' to Decimal", async function () { - (await this.decimalValid.exec(this.ctx)).should.eql(Decimal.from(10.2)); + (await this.decimalValid.exec(this.ctx)).should.equalDecimal(Decimal.from(10.2)); }); it("should be null trying to convert 'abc' to Decimal", async function () { @@ -62,25 +62,25 @@ describe('FromString', () => { it('should convert "10 \'A\'" to Quantity', async function () { const quantity = await this.quantityStr.exec(this.ctx); - quantity.value.should.eql(Decimal.from(10)); + quantity.value.should.equalDecimal(Decimal.from(10)); quantity.unit.should.equal('A'); }); it('should convert "+10 \'A\'" to Quantity', async function () { const quantity = await this.posQuantityStr.exec(this.ctx); - quantity.value.should.eql(Decimal.from(10)); + quantity.value.should.equalDecimal(Decimal.from(10)); quantity.unit.should.equal('A'); }); it('should convert "-10 \'A\'" to Quantity', async function () { const quantity = await this.negQuantityStr.exec(this.ctx); - quantity.value.should.eql(Decimal.from(-10)); + quantity.value.should.equalDecimal(Decimal.from(-10)); quantity.unit.should.equal('A'); }); it('should convert "10.0\'mA\'" to Quantity', async function () { const quantity = await this.quantityStrDecimal.exec(this.ctx); - quantity.value.should.eql(Decimal.from(10.0)); + quantity.value.should.equalDecimal(Decimal.from(10.0)); quantity.unit.should.equal('mA'); }); @@ -105,7 +105,7 @@ describe('FromString', () => { }); it('should convert DateTime string with Z', async function () { - const expectedDateTime = new DateTime(2014, 1, 1, 14, 30, 0, 0, 0); + const expectedDateTime = new DateTime(2014, 1, 1, 14, 30, 0, 0, Decimal.from(0)); (await this.zDateTime.exec(this.ctx)).equals(expectedDateTime).should.be.true(); }); @@ -129,7 +129,7 @@ describe('FromInteger', () => { }); it('should convert 10 to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.eql(Decimal.from(10.0)); + (await this.decimal10.exec(this.ctx)).should.equalDecimal(Decimal.from(10.0)); }); it('should convert null to null', async function () { @@ -155,7 +155,7 @@ describe('FromLong', () => { }); it('should convert 10L to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.eql(Decimal.from(10.0)); + (await this.decimal10.exec(this.ctx)).should.equalDecimal(Decimal.from(10.0)); }); it('should convert null to null', async function () { @@ -186,7 +186,7 @@ describe('FromQuantity', () => { it('should convert "10 \'A\'" to "10 \'A\'"', async function () { const quantity = await this.quantityQuantity.exec(this.ctx); - quantity.value.should.eql(Decimal.from(10)); + quantity.value.should.equalDecimal(Decimal.from(10)); quantity.unit.should.equal('A'); }); }); @@ -243,7 +243,7 @@ describe('FromDateTime', () => { dateTime.minute.should.equal(1); dateTime.second.should.equal(2); dateTime.millisecond.should.equal(321); - dateTime.timezoneOffset.should.eql(Decimal.from(-6)); + dateTime.timezoneOffset.should.equalDecimal(Decimal.from(-6)); }); }); @@ -261,7 +261,7 @@ describe('FromDate', () => { should.not.exist(dateTime.minute); should.not.exist(dateTime.second); should.not.exist(dateTime.millisecond); - dateTime.timezoneOffset.should.equal(this.ctx.getTimezoneOffset()); + dateTime.timezoneOffset.should.equalDecimal(this.ctx.getTimezoneOffset()); dateTime.isDateTime.should.equal(true); }); @@ -274,7 +274,7 @@ describe('FromDate', () => { for (field of ['hour', 'minute', 'second', 'millisecond']) { should.not.exist(dateTime[field]); } - dateTime.timezoneOffset.should.equal(this.ctx.getTimezoneOffset()); + dateTime.timezoneOffset.should.equalDecimal(this.ctx.getTimezoneOffset()); dateTime.isDateTime.should.equal(true); }); @@ -287,7 +287,7 @@ describe('FromDate', () => { for (field of ['hour', 'minute', 'second', 'millisecond']) { should.not.exist(dateTime[field]); } - dateTime.timezoneOffset.should.equal(this.ctx.getTimezoneOffset()); + dateTime.timezoneOffset.should.equalDecimal(this.ctx.getTimezoneOffset()); dateTime.isDateTime.should.equal(true); }); @@ -345,19 +345,19 @@ describe('ToDecimal', () => { }); it("should convert '0.0' to 0.0", async function () { - (await this.noSign.exec(this.ctx)).should.eql(Decimal.from(0.0)); + (await this.noSign.exec(this.ctx)).should.equalDecimal(Decimal.from(0.0)); }); it("should convert '+1.1' to 1.1", async function () { - (await this.positiveSign.exec(this.ctx)).should.eql(Decimal.from(1.1)); + (await this.positiveSign.exec(this.ctx)).should.equalDecimal(Decimal.from(1.1)); }); it("should convert '-1.1' to -1.1", async function () { - (await this.negativeSign.exec(this.ctx)).should.eql(Decimal.from(-1.1)); + (await this.negativeSign.exec(this.ctx)).should.equalDecimal(Decimal.from(-1.1)); }); it('should truncate decimal to 8 digits after decimal point', async function () { - (await this.tooPrecise.exec(this.ctx)).should.eql(Decimal.from(0.44444444)); + (await this.tooPrecise.exec(this.ctx)).should.equalDecimal(Decimal.from(0.44444444)); }); it('should be null for decimal that is above max decimal value', async function () { @@ -561,17 +561,17 @@ describe('ToRatio', () => { it('should be valid given quantities with custom UCUM units', async function () { const ratio = await this.isValidWithCustomUCUM.exec(this.ctx); - ratio.numerator.value.should.eql(Decimal.from(1.0)); + ratio.numerator.value.should.equalDecimal(Decimal.from(1.0)); ratio.numerator.unit.should.eql('{foo:bar}'); - ratio.denominator.value.should.eql(Decimal.from(2.0)); + ratio.denominator.value.should.equalDecimal(Decimal.from(2.0)); ratio.denominator.unit.should.eql('mg'); }); it('should create valid ratio', async function () { const ratio = await this.isValid.exec(this.ctx); - ratio.numerator.value.should.eql(Decimal.from(1.0)); + ratio.numerator.value.should.equalDecimal(Decimal.from(1.0)); ratio.numerator.unit.should.eql('mg'); - ratio.denominator.value.should.eql(Decimal.from(2.0)); + ratio.denominator.value.should.equalDecimal(Decimal.from(2.0)); ratio.denominator.unit.should.eql('mg'); }); }); diff --git a/test/elm/datetime/datetime-test.ts b/test/elm/datetime/datetime-test.ts index 0c87541a8..95c449818 100644 --- a/test/elm/datetime/datetime-test.ts +++ b/test/elm/datetime/datetime-test.ts @@ -9,14 +9,14 @@ import { Decimal } from '../../../src/datatypes/decimal'; describe('DateTime', () => { beforeEach(function () { setup(this, data); - this.defaultOffset = (new Date().getTimezoneOffset() / 60) * -1; + this.defaultOffset = Decimal.from((new Date().getTimezoneOffset() / 60) * -1); }); it('should execute year precision correctly', async function () { const d = await this.year.exec(this.ctx); d.isTime().should.be.false(); d.year.should.equal(2012); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); ['month', 'day', 'hour', 'minute', 'second', 'millisecond'].forEach(field => should.not.exist(d[field]) ); @@ -27,7 +27,7 @@ describe('DateTime', () => { d.isTime().should.be.false(); d.year.should.equal(2012); d.month.should.equal(2); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); ['day', 'hour', 'minute', 'second', 'millisecond'].forEach(field => should.not.exist(d[field])); }); @@ -37,7 +37,7 @@ describe('DateTime', () => { d.year.should.equal(2012); d.month.should.equal(2); d.day.should.equal(15); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); ['hour', 'minute', 'second', 'millisecond'].forEach(field => should.not.exist(d[field])); }); @@ -48,7 +48,7 @@ describe('DateTime', () => { d.month.should.equal(2); d.day.should.equal(15); d.hour.should.equal(12); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); ['minute', 'second', 'millisecond'].forEach(field => should.not.exist(d[field])); }); @@ -60,7 +60,7 @@ describe('DateTime', () => { d.day.should.equal(15); d.hour.should.equal(12); d.minute.should.equal(10); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); ['second', 'millisecond'].forEach(field => should.not.exist(d[field])); }); @@ -73,7 +73,7 @@ describe('DateTime', () => { d.hour.should.equal(12); d.minute.should.equal(10); d.second.should.equal(59); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); should.not.exist(d.millisecond); }); @@ -87,7 +87,7 @@ describe('DateTime', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.equal(this.defaultOffset); + d.timezoneOffset.should.equalDecimal(this.defaultOffset); }); it('should execute timezone offsets correctly', async function () { @@ -100,7 +100,7 @@ describe('DateTime', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.eql(Decimal.from(-8)); + d.timezoneOffset.should.equalDecimal(Decimal.from(-8)); }); }); @@ -219,7 +219,7 @@ describe('Now', () => { should.exist(now.minute); should.exist(now.second); should.exist(now.millisecond); - now.timezoneOffset.should.equal(this.ctx.getTimezoneOffset()); + now.timezoneOffset.should.equalDecimal(this.ctx.getTimezoneOffset()); }); it('should return all date components representing now using a passed in timezone', async function () { @@ -239,7 +239,7 @@ describe('Now', () => { should.exist(now.minute); should.exist(now.second); should.exist(now.millisecond); - now.timezoneOffset.should.equal('0'); + now.timezoneOffset.should.equalDecimal(Decimal.from(0)); }); it('should return all date components representing now using a passed in timezone using a child context', async function () { @@ -260,8 +260,8 @@ describe('Now', () => { should.exist(now.minute); should.exist(now.second); should.exist(now.millisecond); - now.timezoneOffset.should.equal(this.child_ctx.getTimezoneOffset()); - now.timezoneOffset.should.equal('0'); + now.timezoneOffset.should.equalDecimal(this.child_ctx.getTimezoneOffset()); + now.timezoneOffset.should.equalDecimal(Decimal.from(0)); }); }); @@ -409,13 +409,13 @@ describe('TimezoneOffsetFrom', () => { }); it('should return the timezoneoffset from a fully defined DateTime', async function () { - (await this.centralEuropean.exec(this.ctx)).should.eql(Decimal.from(1)); - (await this.easternStandard.exec(this.ctx)).should.eql(Decimal.from(-5)); + (await this.centralEuropean.exec(this.ctx)).should.equalDecimal(Decimal.from(1)); + (await this.easternStandard.exec(this.ctx)).should.equalDecimal(Decimal.from(-5)); }); it('should return the default timezone when not specified', async function () { - (await this.defaultTimezone.exec(this.ctx)).should.equal( - (new Date().getTimezoneOffset() / 60) * -1 + (await this.defaultTimezone.exec(this.ctx)).should.equalDecimal( + Decimal.from((new Date().getTimezoneOffset() / 60) * -1) ); }); diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 45d5b94b3..78757f286 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -1619,9 +1619,9 @@ describe('Width', () => { it('should calculate the width of real intervals', async function () { // define RealWidth: width of Interval[1.23, 4.56] - (await this.realWidth.exec(this.ctx)).should.eql(Decimal.from(3.33)); + (await this.realWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.33)); // define RealOpenWidth: width of Interval(1.23, 4.56) - (await this.realOpenWidth.exec(this.ctx)).should.eql(Decimal.from(3.32999998)); + (await this.realOpenWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.32999998)); }); it('should calculate the width of infinite intervals', async function () { @@ -1645,7 +1645,7 @@ describe('Width', () => { it('should calculate the width of interval of quantities', async function () { // define WidthOfQuantityInterval: width of Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}] const width = await this.widthOfQuantityInterval.exec(this.ctx); - width.value.should.eql(Decimal.from(9)); + width.value.should.equalDecimal(Decimal.from(9)); width.unit.should.equal('mm'); }); @@ -1686,9 +1686,9 @@ describe('Size', () => { it('should calculate the size of real intervals', async function () { // define RealSize: Size(Interval[1.23, 4.56]) - (await this.realSize.exec(this.ctx)).should.eql(Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE)); + (await this.realSize.exec(this.ctx)).should.equalDecimal(Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE)); // define RealOpenSize: Size(Interval(1.23, 4.56)) - (await this.realOpenSize.exec(this.ctx)).should.eql(Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE)); + (await this.realOpenSize.exec(this.ctx)).should.equalDecimal(Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE)); }); it('should calculate the size of infinite intervals', async function () { @@ -1722,7 +1722,7 @@ describe('Size', () => { it('should calculate size of interval of quantities', async function () { // define SizeOfQuantityInterval: Size(Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}]) const size = await this.sizeOfQuantityInterval.exec(this.ctx); - size.value.should.eql(Decimal.from(9.00000001)); + size.value.should.equalDecimal(Decimal.from(9.00000001)); size.unit.should.equal('mm'); }); @@ -1758,7 +1758,7 @@ describe('Start', () => { it('should return the minimum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.eql(5); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(Decimal.from(5)); }); it('should return the minimum possible Integer', async function () { @@ -1808,7 +1808,7 @@ describe('End', () => { it('should return the maximum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.eql(5); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(Decimal.from(5)); }); it('should return the maximum possible Integer', async function () { diff --git a/test/elm/literal/literal-test.ts b/test/elm/literal/literal-test.ts index 87f1d508c..c409a696d 100644 --- a/test/elm/literal/literal-test.ts +++ b/test/elm/literal/literal-test.ts @@ -41,11 +41,11 @@ describe('Literal', () => { }); it('should convert .1 to decimal .1', function () { - this.decimalTenth.value.should.eql(Decimal.from(0.1)); + this.decimalTenth.value.should.equalDecimal(Decimal.from(0.1)); }); it('should execute .1 as .1', async function () { - (await this.decimalTenth.exec(this.ctx)).should.eql(Decimal.from(0.1)); + (await this.decimalTenth.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); }); it("should convert 'true' to string 'true'", function () { @@ -66,7 +66,7 @@ describe('Literal', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.eql(Decimal.from(0)); + d.timezoneOffset.should.equalDecimal(Decimal.from(0)); }); it("should execute '' as correct Time", async function () { diff --git a/test/elm/message/message-test.ts b/test/elm/message/message-test.ts index c1f2d29db..67d1243c0 100644 --- a/test/elm/message/message-test.ts +++ b/test/elm/message/message-test.ts @@ -14,7 +14,7 @@ describe('Message', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.eql(Decimal.from(0.5)); + (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(0.5)); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); @@ -40,7 +40,7 @@ describe('Retrieve', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.eql(Decimal.from(0.5)); + (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(0.5)); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); diff --git a/test/elm/parameters/parameters-test.ts b/test/elm/parameters/parameters-test.ts index 3a7c80ff4..dc2e354a9 100644 --- a/test/elm/parameters/parameters-test.ts +++ b/test/elm/parameters/parameters-test.ts @@ -100,7 +100,7 @@ describe('DecimalParameterTypes', () => { }); it('should execute to provided valid value', async function () { - (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.eql(Decimal.from(3.0)); + (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.equalDecimal(Decimal.from(3.0)); }); it('should throw when provided value is wrong type', function () { @@ -108,11 +108,11 @@ describe('DecimalParameterTypes', () => { }); it('should execute to default value', async function () { - (await this.foo2.exec(this.ctx)).should.eql(Decimal.from(1.5)); + (await this.foo2.exec(this.ctx)).should.equalDecimal(Decimal.from(1.5)); }); it('should execute to overriding valid value', async function () { - (await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) }))).should.eql(Decimal.from(3.0)); + (await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) }))).should.equalDecimal(Decimal.from(3.0)); }); it('should throw when overriding value is wrong type', function () { diff --git a/test/elm/quantity/quantity-test.ts b/test/elm/quantity/quantity-test.ts index 602f5239e..81a4afb99 100644 --- a/test/elm/quantity/quantity-test.ts +++ b/test/elm/quantity/quantity-test.ts @@ -63,7 +63,7 @@ describe('Quantity', () => { const denominator = new Quantity(2.0, 'mg'); const result = numerator.dividedBy(denominator); result.unit.should.equal('1'); - result.value.should.eql(Decimal.from(-2.75)); + result.value.should.equalDecimal(Decimal.from(-2.75)); }); it('should allow for singular time units', () => { diff --git a/test/elm/query/query-test.ts b/test/elm/query/query-test.ts index 2ee9e3cb4..cc25054c5 100644 --- a/test/elm/query/query-test.ts +++ b/test/elm/query/query-test.ts @@ -197,12 +197,12 @@ describe('Sorting', () => { it('should correctly sort quantities asc', async function () { const e = await this.quantityListAsc.exec(this.ctx); e.should.have.length(2); - e[0]['value'].should.eql(Decimal.from(2)); + e[0]['value'].should.equalDecimal(Decimal.from(2)); }); it('should correctly sort quantities', async function () { const e = await this.quantityListSort.exec(this.ctx); - e[0]['N']['value'].should.eql(Decimal.from(2)); + e[0]['N']['value'].should.equalDecimal(Decimal.from(2)); }); it('should be able to sort by a tuple field asc', async function () { diff --git a/test/should-extensions.ts b/test/should-extensions.ts index 2e48408bd..1d29e8026 100644 --- a/test/should-extensions.ts +++ b/test/should-extensions.ts @@ -1,9 +1,11 @@ import should from 'should'; import { Interval } from '../src/datatypes/interval'; +import { Decimal } from '../src/datatypes/decimal'; declare module 'should' { interface Assertion { equalInterval(expected: Interval): this; + equalDecimal(expected: Decimal): this; } } @@ -28,3 +30,12 @@ declare module 'should' { ); normalizedThis.should.eql(normalizedExpected); }); + +(should as any).Assertion.add('equalDecimal', function (this: any, expected: number | bigint | Decimal) { + this.params = { operator: 'to equal Decimal', expected: expected.toString(), obj: this.obj.toString() }; + + this.assert( + this.obj instanceof Decimal && + this.obj.equals(expected) + ); +}); \ No newline at end of file diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql index 85a57481f..cc94b950e 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql @@ -924,19 +924,19 @@ define "Truncated Divide": Tuple{ output: 2.0 }, "TruncatedDivide10d1ByNeg3D1Quantity": Tuple{ - skipped: 'Truncated divide not implemented for Quantity' + skipped: 'Wrong output: The resulting Quantity should have an appropriate unit; \'g\' / \'g\' should be \'1\', not \'g\'. See test Divide1Q1Q which is correct' /* expression: 10.1 'cm' div -3.1 'cm', output: -3.0 'cm' */ }, "TruncatedDivide10By5DQuantity": Tuple{ - skipped: 'Truncated divide not implemented for Quantity' + skipped: 'Wrong output: The resulting Quantity should have an appropriate unit' /* expression: 10.0 'g' div 5.0 'g', output: 2.0 'g' */ }, "TruncatedDivide414By206DQuantity": Tuple{ - skipped: 'Truncated divide not implemented for Quantity' + skipped: 'Wrong output: The resulting Quantity should have an appropriate unit' /* expression: 4.14 'm' div 2.06 'm', output: 2.0 'm' diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json index fe1b271b4..d09ab84b4 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json @@ -26454,7 +26454,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Truncated divide not implemented for Quantity", + "value": "Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See test Divide1Q1Q which is correct", "annotation": [] } } @@ -26488,7 +26488,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Truncated divide not implemented for Quantity", + "value": "Wrong output: The resulting Quantity should have an appropriate unit", "annotation": [] } } @@ -26522,7 +26522,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Truncated divide not implemented for Quantity", + "value": "Wrong output: The resulting Quantity should have an appropriate unit", "annotation": [] } } diff --git a/test/spec-tests/cql/ValueLiteralsAndSelectors.cql b/test/spec-tests/cql/ValueLiteralsAndSelectors.cql index 7addbb153..1bf057dab 100644 --- a/test/spec-tests/cql/ValueLiteralsAndSelectors.cql +++ b/test/spec-tests/cql/ValueLiteralsAndSelectors.cql @@ -253,13 +253,13 @@ define "Decimal": Tuple{ invalid: true }, "Decimal10Pow28ToZeroOneStepDecimalMaxValue": Tuple{ - skipped: 'Wrong answer (null vs big number)' + skipped: 'Wrong answer (null vs big number); intermediate value exceeds max Decimal' /* expression: 10*1000000000000000000000000000.00000000-0.00000001, output: 9999999999999999999999999999.99999999 */ }, "DecimalPos10Pow28ToZeroOneStepDecimalMaxValue": Tuple{ - skipped: 'Wrong answer (null vs big number)' + skipped: 'Wrong answer (null vs big number); intermediate value exceeds max Decimal' /* expression: +10*1000000000000000000000000000.00000000-0.00000001, output: 9999999999999999999999999999.99999999 diff --git a/test/spec-tests/cql/ValueLiteralsAndSelectors.json b/test/spec-tests/cql/ValueLiteralsAndSelectors.json index ff210f475..b4743e7c5 100644 --- a/test/spec-tests/cql/ValueLiteralsAndSelectors.json +++ b/test/spec-tests/cql/ValueLiteralsAndSelectors.json @@ -8284,7 +8284,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (null vs big number)", + "value": "Wrong answer (null vs big number); intermediate value exceeds max Decimal", "annotation": [] } } @@ -8318,7 +8318,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (null vs big number)", + "value": "Wrong answer (null vs big number); intermediate value exceeds max Decimal", "annotation": [] } } diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index e8d2d5152..a939904b0 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -13,6 +13,9 @@ CqlListOperatorsTest.Equal.EqualNullNull Wrong output: Ac 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 CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: Interval[null, null] is not a unit interval, nor is it null +"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See test Divide1Q1Q which is correct +"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10By5DQuantity" Wrong output: The resulting Quantity should have an appropriate unit +"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide414By206DQuantity" Wrong output: The resulting Quantity should have an appropriate unit # Potentially Incorrect Expected Output "CqlStringOperatorsTest.toString tests.DateTimeToString2" Answer does not include timezone offset, but default offset depends on test environment @@ -42,8 +45,8 @@ CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (di CqlTypeOperatorsTest.ToDateTime.ToDateTime1 Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime2 Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime3 Wrong answer (different offsets) -ValueLiteralsAndSelectors.Decimal.Decimal10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number) -ValueLiteralsAndSelectors.Decimal.DecimalPos10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number) +ValueLiteralsAndSelectors.Decimal.Decimal10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number); intermediate value exceeds max Decimal +ValueLiteralsAndSelectors.Decimal.DecimalPos10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number); intermediate value exceeds max Decimal # Unimplemented CqlArithmeticFunctionsTest.HighBoundary HighBoundary not implemented @@ -54,9 +57,6 @@ CqlListOperatorsTest.Descendents Descendents not implemen # Unimplemented (New in CQL 1.5) CqlArithmeticFunctionsTest.Modulo.ModuloQuantity Modulo not implemented for Quantity CqlArithmeticFunctionsTest.Modulo.Modulo10By3Quantity Modulo not implemented for Quantity -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Truncated divide not implemented for Quantity -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10By5DQuantity" Truncated divide not implemented for Quantity -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide414By206DQuantity" Truncated divide not implemented for Quantity # Unimplemented (New in CQL 2.0) CqlListOperatorsTest.Slice Slice not implemented \ No newline at end of file diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index e1bcbf3f1..9809612bf 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -6,6 +6,7 @@ import '../../src/elm/expressions'; // Needed for side-effect import { build } from '../../src/elm/builder'; import { Library } from '../../src/elm/library'; import { Uncertainty } from '../../src/datatypes/uncertainty'; +import { Decimal } from '../../src/datatypes/decimal'; describe('CQL Spec Tests (from XML)', () => { fs.readdirSync(path.join(__dirname, 'cql')).forEach(f => { @@ -53,7 +54,7 @@ describe('CQL Spec Tests (from XML)', () => { } if (testCaseMap.has('expression') && testCaseMap.has('output')) { const ctx = new PatientContext(library); - ctx.getExecutionDateTime().timezoneOffset = 0; + ctx.getExecutionDateTime().timezoneOffset = Decimal.from(0); const actualExp = build(testCaseMap.get('expression')) as any; const actual = await actualExp.execute(ctx); const expectedExp = build(testCaseMap.get('output')) as any; @@ -95,11 +96,17 @@ describe('CQL Spec Tests (from XML)', () => { } catch { should.fail(actual, expected, 'Lists are not equal'); } - } else { + } else if (expected instanceof Decimal) { // 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.equalDecimal(expected); + } + } else { if (actual == null) { should.deepEqual(actual, expected); } else { @@ -121,9 +128,9 @@ describe('CQL Spec Tests (from XML)', () => { } function roundDecimalsWhenApplicable(item: any) { - if (typeof item === 'number') { + if (item instanceof Decimal) { // Round to 8 places since that's the number of places used by expected outputs - item = Math.round(item * 100000000) / 100000000; + item = item.setScale(8); } return item; } diff --git a/test/util/math-test.ts b/test/util/math-test.ts index 16cb165b8..905ac4c17 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -13,8 +13,8 @@ describe('successor', () => { it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); - result.low.should.eql(Decimal.from(1.00000001)); - result.high.should.eql(Decimal.from(2.00000001)); + result.low.should.equalDecimal(Decimal.from(1.00000001)); + result.high.should.equalDecimal(Decimal.from(2.00000001)); }); it('should leave the uncertainty high unchanged when it overflows', () => { @@ -32,8 +32,8 @@ describe('predecessor', () => { it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); - result.low.should.eql(Decimal.from(1.00000001)); - result.high.should.eql(Decimal.from(2.00000001)); + result.low.should.equalDecimal(Decimal.from(1.00000001)); + result.high.should.equalDecimal(Decimal.from(2.00000001)); }); it('should leave the uncertainty low unchanged when it underflows', () => { diff --git a/test/util/units-test.ts b/test/util/units-test.ts index b3c046065..9cf5ea45c 100644 --- a/test/util/units-test.ts +++ b/test/util/units-test.ts @@ -109,38 +109,38 @@ describe('checkUnit', () => { describe('convertUnit', () => { it('should convert compatible units', () => { - convertUnit(Decimal.from(18), '[in_i]', '[ft_i]').should.eql(Decimal.from(1.5)); + convertUnit(Decimal.from(18), '[in_i]', '[ft_i]').should.equalDecimal(Decimal.from(1.5)); }); it('should return same value for same units', () => { - convertUnit(Decimal.from(18), '[in_i]', '[in_i]').should.eql(Decimal.from(18)); + convertUnit(Decimal.from(18), '[in_i]', '[in_i]').should.equalDecimal(Decimal.from(18)); }); it('should consider empty as 1 during conversion', () => { - convertUnit(Decimal.from(18), '', '').should.eql(Decimal.from(18)); - convertUnit(Decimal.from(18), null, null).should.eql(Decimal.from(18)); - convertUnit(Decimal.from(18), '', null).should.eql(Decimal.from(18)); - convertUnit(Decimal.from(18), null, '').should.eql(Decimal.from(18)); + convertUnit(Decimal.from(18), '', '').should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(18), null, null).should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(18), '', null).should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(18), null, '').should.equalDecimal(Decimal.from(18)); }); it('should support CQL date units during conversion', () => { - convertUnit(Decimal.from(18), 'months', 'years').should.eql(Decimal.from(1.5)); - convertUnit(Decimal.from(1.5), 'years', 'months').should.eql(Decimal.from(18)); - convertUnit(Decimal.from(2), 'seconds', 'milliseconds').should.eql(Decimal.from(2000)); - convertUnit(Decimal.from(2000), 'milliseconds', 'seconds').should.eql(Decimal.from(2)); + convertUnit(Decimal.from(18), 'months', 'years').should.equalDecimal(Decimal.from(1.5)); + convertUnit(Decimal.from(1.5), 'years', 'months').should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(2), 'seconds', 'milliseconds').should.equalDecimal(Decimal.from(2000)); + convertUnit(Decimal.from(2000), 'milliseconds', 'seconds').should.equalDecimal(Decimal.from(2)); }); it('should truncate precision to 8 decimals by default', () => { const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]'); - result.should.eql(Decimal.from("0.00018939")); + result.should.equalDecimal(Decimal.from("0.00018939")); }); - it('should note truncate precision to 8 decimals when adjustPrecision is false', () => { - const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]', false); - result.should.not.eql(Decimal.from("0.00018939")); - result.toString().length.should.be.greaterThan(10); - result.toString().should.startWith('0.000189393939393'); - }); + // it('should not truncate precision to 8 decimals when adjustPrecision is false', () => { + // const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]', false); + // result.should.not.equalDecimal(Decimal.from("0.00018939")); + // result.toString().length.should.be.greaterThan(10); + // result.toString().should.startWith('0.000189393939393'); + // }); it('should return undefined for incompatible units', () => { should(convertUnit(Decimal.from(18), '[in_i]', '[in_i]2')).be.undefined(); @@ -148,34 +148,35 @@ describe('convertUnit', () => { }); describe('normalizeUnitsWhenPossible', () => { + it('should keep same units', () => { - normalizeUnitsWhenPossible(10, 'm', 1, 'm').should.eql([10, 'm', 1, 'm']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'm']); }); it('should convert compatible units, preferring smaller units', () => { - normalizeUnitsWhenPossible(10, 'cm', 1, 'm').should.eql([10, 'cm', 100, 'cm']); - normalizeUnitsWhenPossible(1, 'm', 10, 'cm').should.eql([100, 'cm', 10, 'cm']); + normalizeUnitsWhenPossible(Decimal.from(10), 'cm', Decimal.from(1), 'm').should.eql([Decimal.from(10), 'cm', Decimal.from(100), 'cm']); + normalizeUnitsWhenPossible(Decimal.from(1), 'm', Decimal.from(10), 'cm').should.eql([Decimal.from(100), 'cm', Decimal.from(10), 'cm']); }); it('should treat null or empty string units as 1', () => { - normalizeUnitsWhenPossible(10, null, 1, '').should.eql([10, '1', 1, '1']); - normalizeUnitsWhenPossible(1, '', 10, null).should.eql([1, '1', 10, '1']); + normalizeUnitsWhenPossible(Decimal.from(10), null, Decimal.from(1), '').should.eql([Decimal.from(10), '1', Decimal.from(1), '1']); + normalizeUnitsWhenPossible(Decimal.from(1), '', Decimal.from(10), null).should.eql([Decimal.from(1), '1', Decimal.from(10), '1']); }); it('should normalize CQL date units and return CQL date units', () => { - normalizeUnitsWhenPossible(10, 'year', 12, 'month').should.eql([120, 'month', 12, 'month']); + normalizeUnitsWhenPossible(Decimal.from(10), 'year', Decimal.from(12), 'month').should.eql([Decimal.from(120), 'month', Decimal.from(12), 'month']); }); it('should return CQL date units when UCUM units are passed in', () => { - normalizeUnitsWhenPossible(10, 'a_g', 12, 'mo_g').should.eql([120, 'mo_g', 12, 'mo_g']); + normalizeUnitsWhenPossible(Decimal.from(10), 'a_g', Decimal.from(12), 'mo_g').should.eql([Decimal.from(120), 'mo_g', Decimal.from(12), 'mo_g']); }); it('should not convert units of different dimensions', () => { - normalizeUnitsWhenPossible(10, 'm', 1, 'm2').should.eql([10, 'm', 1, 'm2']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm2').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'm2']); }); it('should not convert incompatible units', () => { - normalizeUnitsWhenPossible(10, 'm', 1, 'mg').should.eql([10, 'm', 1, 'mg']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'mg').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'mg']); }); }); From 9b3d4bce5cccb44bbedcb39e1124c5877f60efe7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 20 Aug 2026 13:34:37 -0400 Subject: [PATCH 03/62] CQL Decimal improvements, checkpoint 3 --- src/datatypes/decimal.ts | 32 ++++----- src/datatypes/interval.ts | 5 +- src/datatypes/quantity.ts | 10 ++- src/datatypes/uncertainty.ts | 2 +- src/elm/aggregate.ts | 93 +++++++++++++------------- src/elm/arithmetic.ts | 63 +++++++---------- src/elm/interval.ts | 57 ++++++---------- src/elm/type.ts | 6 +- src/util/comparison.ts | 4 +- src/util/immutableUtil.ts | 12 +++- src/util/math.ts | 48 +++++++------ src/util/units.ts | 1 - test/datatypes/date-test.ts | 4 +- test/datatypes/interval-test.ts | 54 ++++++++++++--- test/elm/aggregate/aggregate-test.ts | 34 +++------- test/elm/arithmetic/arithmetic-test.ts | 38 ++++++++--- test/elm/interval/interval-test.ts | 19 ++++-- test/elm/parameters/parameters-test.ts | 32 ++++++--- test/should-extensions.ts | 18 +++-- test/spec-tests/spec-test.ts | 3 - test/util/math-test.ts | 10 ++- test/util/units-test.ts | 66 +++++++++++++++--- 22 files changed, 350 insertions(+), 261 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 55b60c82a..8e77a9e38 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -1,4 +1,3 @@ - import { Decimal as DecimalJS } from 'decimal.js'; // Default precision is set to 30 significant figures. (Not decimal places) @@ -44,28 +43,25 @@ export class Decimal { return this.setScale(CQL_IMPLICIT_SCALE, CQL_IMPLICIT_ROUNDING); } - private applyWrapper( - operation: (value: any) => DecimalJS, - other: DecimalInput - ): Decimal { + private applyWrapper(operation: (value: any) => DecimalJS, other: DecimalInput): Decimal { const operand = other instanceof Decimal ? other.value : other; return new Decimal(operation.call(this.value, operand)); } - add(other: DecimalInput) : Decimal { + add(other: DecimalInput): Decimal { return this.applyWrapper(this.value.add, other); } - subtract(other: DecimalInput) : Decimal { + subtract(other: DecimalInput): Decimal { return this.applyWrapper(this.value.minus, other); } - multiplyBy(other: DecimalInput) : Decimal { + multiplyBy(other: DecimalInput): Decimal { return this.applyWrapper(this.value.times, other); } - divideBy(other: DecimalInput) : Decimal { + divideBy(other: DecimalInput): Decimal { if (toNumber(other) === 0) { throw new RangeError('Cannot divide a decimal by zero'); } @@ -82,7 +78,7 @@ export class Decimal { compareTo(other: DecimalInput) { if (other instanceof Decimal) { - return this.value.comparedTo(other.value) + return this.value.comparedTo(other.value); } return this.value.comparedTo(other); } @@ -94,7 +90,7 @@ export class Decimal { greaterThanOrEquals(other: DecimalInput) { return this.compareTo(other) >= 0; } - + lessThan(other: DecimalInput) { return this.compareTo(other) < 0; } @@ -123,19 +119,19 @@ export class Decimal { return new Decimal(this.value.abs()); } - truncate() : number { + truncate(): number { return this.value.truncated().toNumber(); } - truncated() : Decimal { + truncated(): Decimal { return new Decimal(this.value.truncated()); } - ceil() : number { + ceil(): number { return this.value.ceil().toNumber(); } - floor() : number { + floor(): number { return this.value.floor().toNumber(); } @@ -177,7 +173,7 @@ export class Decimal { if (!Number.isInteger(scale) || scale < 0) { throw new RangeError('Decimal scale must be a non-negative integer'); } - + return new Decimal(this.value.toDecimalPlaces(scale, roundingMode)); } @@ -203,8 +199,8 @@ export class Decimal { } } -export const MAX_DECIMAL_STRING = "99999999999999999999.99999999"; -export const MIN_DECIMAL_STRING = "-99999999999999999999.99999999"; +export const MAX_DECIMAL_STRING = '99999999999999999999.99999999'; +export const MIN_DECIMAL_STRING = '-99999999999999999999.99999999'; export const MAX_DECIMAL_VALUE = Decimal.from(MAX_DECIMAL_STRING); export const MIN_DECIMAL_VALUE = Decimal.from(MIN_DECIMAL_STRING); diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index 064e3460f..06045d031 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -20,7 +20,6 @@ import { ELM_QUANTITY_TYPE, ELM_ANY_TYPE } from '../util/elmTypes'; -import { MIN_FLOAT_VALUE } from '../util/limits'; import { Quantity } from './quantity'; import { Decimal, MIN_DECIMAL_VALUE } from './decimal'; @@ -780,8 +779,8 @@ export class Interval { toString() { const start = this.lowClosed ? '[' : '('; const end = this.highClosed ? ']' : ')'; - const lowString = this.low == null ? "null" : this.low.toString(); - const highString = this.high == null ? "null" : this.high.toString(); + const lowString = this.low == null ? 'null' : this.low.toString(); + const highString = this.high == null ? 'null' : this.high.toString(); return start + lowString + ', ' + highString + end; } } diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index 62c56b7ec..d62110136 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -1,5 +1,5 @@ import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; -import { decimalAdjust, add, subtract, isValidDecimal, overflowsOrUnderflows } from '../util/math'; +import { add, subtract, isValidDecimal, overflowsOrUnderflows } from '../util/math'; import { Decimal } from './decimal'; import { checkUnit, @@ -16,7 +16,7 @@ export class Quantity { value?: Decimal | string | number | bigint, public unit?: any ) { - if (value == null || typeof value === 'number' && isNaN(value)) { + if (value == null || (typeof value === 'number' && isNaN(value))) { throw new Error('Cannot create a quantity with an undefined value'); } this.value = Decimal.from(value).normalized(); @@ -114,7 +114,11 @@ export class Quantity { } dividedBy(other: any) { - if (other == null || other === 0 || (other.value != null && Decimal.from(other.value).equals(0))) { + if ( + other == null || + other === 0 || + (other.value != null && Decimal.from(other.value).equals(0)) + ) { return null; } else if (!other.isQuantity) { // convert it to a quantity w/ unit 1 diff --git a/src/datatypes/uncertainty.ts b/src/datatypes/uncertainty.ts index e986a581f..8a089e217 100644 --- a/src/datatypes/uncertainty.ts +++ b/src/datatypes/uncertainty.ts @@ -143,7 +143,7 @@ export class Uncertainty { if (typeof a.before === 'function') { return a.before(b, precision); - } else if (a.isDecimal) { + } else if (a.isDecimal) { return a.lessThan(b); } else { return a < b; diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index e94784810..56ec1c620 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -6,7 +6,7 @@ import { Context } from '../runtime/context'; import { Exception } from '../datatypes/exception'; import { greaterThan, lessThan } from '../util/comparison'; import { build } from './builder'; -import { overflowsOrUnderflows } from '../util/math'; +import { overflowsOrUnderflows, finalizeNumericResult } from '../util/math'; import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; class AggregateExpression extends Expression { @@ -18,28 +18,6 @@ class AggregateExpression extends Expression { } } -function hasDecimals(values: any[]) { - return values.some(value => value && value.isDecimal); -} - -function isDecimal(value: any): value is Decimal { - return value != null && value.isDecimal; -} - -function sumDecimals(values: Decimal[]) { - return values.reduce((sum, value) => sum.add(value)); -} - -function productDecimals(values: Decimal[]) { - return values.reduce((product, value) => product.multiplyBy(value)); -} - -function decimalResult(value: number, values: any[], resultTypeName?: string) { - return hasDecimals(values) || resultTypeName === ELM_DECIMAL_TYPE - ? Decimal.from(value).normalized() - : value; -} - export class Count extends AggregateExpression { constructor(json: any) { super(json); @@ -76,12 +54,16 @@ export class Sum extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const sum = sumDecimals(getValuesFromQuantities(items)); + const sum = sumOfDecimals(getValuesFromQuantities(items)); return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : new Quantity(sum, items[0].unit); } else { - const sum = hasDecimals(items) - ? sumDecimals(items.map(Decimal.from)) - : items.reduce((x: any, y: any) => x + y); + let sum; + if (hasDecimals(items)) { + sum = sumOfDecimals(items.map(Decimal.from)); + } else { + sum = items.reduce((x: any, y: any) => x + y); + } + sum = finalizeNumericResult(sum); return overflowsOrUnderflows(sum, this.resultTypeName) ? null : sum; } } @@ -177,11 +159,11 @@ export class Avg extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const sum = sumDecimals(getValuesFromQuantities(items)); + const sum = sumOfDecimals(getValuesFromQuantities(items)); return new Quantity(sum.divideBy(items.length), items[0].unit); } else { // return type is always Decimal, so just map everything to Decimals - return sumDecimals(items.map(Decimal.from)).divideBy(items.length).normalized(); + return sumOfDecimals(items.map(Decimal.from)).divideBy(items.length).normalized(); } } } @@ -206,14 +188,17 @@ export class Median extends AggregateExpression { return null; } - if (!hasOnlyQuantities(items)) { - return hasDecimals(items) - ? medianOfDecimals(items.map(Decimal.from)) - : decimalResult(medianOfNumbers(items), items, this.resultTypeName); + if (hasOnlyQuantities(items)) { + const median = medianOfDecimals(getValuesFromQuantities(items)); + return new Quantity(median, items[0].unit); + } + + if (hasDecimals(items)) { + const decimals = items.map(Decimal.from); + return finalizeNumericResult(medianOfDecimals(decimals)); } - const median = medianOfDecimals(getValuesFromQuantities(items)); - return new Quantity(median, items[0].unit); + return medianOfNumbers(items); } } @@ -240,7 +225,7 @@ export class Mode extends AggregateExpression { if (hasOnlyQuantities(filtered)) { const values = getValuesFromQuantities(filtered); - let mode = this.mode(values); + const mode = this.mode(values); if (mode.length === 1) { return new Quantity(mode[0], items[0].unit); } else { @@ -362,16 +347,19 @@ export class Product extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const product = productDecimals(getValuesFromQuantities(items)); + const product = productOfDecimals(getValuesFromQuantities(items)); // Units are not multiplied for the geometric product return overflowsOrUnderflows(product, ELM_DECIMAL_TYPE) ? null : new Quantity(product, items[0].unit); } else { - const product = hasDecimals(items) - ? productDecimals(items.map(Decimal.from)) - : items.reduce((x: number, y: number) => x * y); - const result = isDecimal(product) ? product : decimalResult(product, items, this.resultTypeName); + let result; + if (hasDecimals(items)) { + result = productOfDecimals(items.map(Decimal.from)); + } else { + result = items.reduce((x: number, y: number) => x * y); + } + result = finalizeNumericResult(result); return overflowsOrUnderflows(result, this.resultTypeName) ? null : result; } } @@ -399,12 +387,13 @@ export class GeometricMean extends AggregateExpression { } if (hasOnlyQuantities(items)) { - const product = productDecimals(getValuesFromQuantities(items)); + const product = productOfDecimals(getValuesFromQuantities(items)); const geoMean = product.power(1.0 / items.length); return new Quantity(geoMean, items[0].unit); } else { - return productDecimals(items.map(Decimal.from)) - .power(1.0 / items.length).normalized(); + return productOfDecimals(items.map(Decimal.from)) + .power(1.0 / items.length) + .normalized(); } } } @@ -458,6 +447,10 @@ export class AnyTrue extends AggregateExpression { } } +function hasDecimals(values: any[]) { + return values.some(value => value && value.isDecimal); +} + function processQuantities(values: any[]) { const items = removeNulls(values); if (hasOnlyQuantities(items)) { @@ -502,7 +495,13 @@ function medianOfNumbers(numbers: number[]) { function medianOfDecimals(decimals: Decimal[]) { const items = [...decimals].sort((a, b) => a.compareTo(b)); const middle = Math.floor(items.length / 2); - return items.length % 2 === 1 - ? items[middle] - : items[middle - 1].add(items[middle]).divideBy(2); + return items.length % 2 === 1 ? items[middle] : items[middle - 1].add(items[middle]).divideBy(2); +} + +function sumOfDecimals(values: Decimal[]) { + return values.reduce((sum, value) => sum.add(value)); +} + +function productOfDecimals(values: Decimal[]) { + return values.reduce((product, value) => product.multiplyBy(value)); } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index c14a01eca..3b3170384 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -22,30 +22,7 @@ import { ELM_LONG_TYPE, ELM_TIME_TYPE } from '../util/elmTypes'; -import { - MAX_INT_VALUE, - MAX_LONG_VALUE, - MIN_INT_VALUE, - MIN_LONG_VALUE -} from '../util/limits'; - -function finalizeNumericResult(result: any, type?: string) { - - if (result instanceof Decimal) { - return result.normalized(); - } else if (result instanceof Quantity) { - return new Quantity(result.value.normalized(), result.unit); - } else if (result instanceof Uncertainty) { - if (result.low instanceof Quantity || result.low instanceof Decimal) { - result.low = finalizeNumericResult(result.low); - } - if (result.high instanceof Quantity || result.high instanceof Decimal) { - result.high = finalizeNumericResult(result.high); - } - } - - return result; -} +import { MAX_INT_VALUE, MAX_LONG_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from '../util/limits'; export class Add extends Expression { constructor(json: any) { @@ -59,7 +36,7 @@ export class Add extends Expression { } const sum = MathUtil.add(args[0], args[1], this.resultTypeName); - return finalizeNumericResult(sum, this.resultTypeName); + return MathUtil.finalizeNumericResult(sum, this.resultTypeName); } } @@ -75,7 +52,7 @@ export class Subtract extends Expression { } const difference = MathUtil.subtract(args[0], args[1], this.resultTypeName); - return finalizeNumericResult(difference, this.resultTypeName); + return MathUtil.finalizeNumericResult(difference, this.resultTypeName); } } @@ -91,7 +68,7 @@ export class Multiply extends Expression { } let [x, y] = args; - + if (x.isUncertainty && !y.isUncertainty) { y = new Uncertainty(y, y); } else if (y.isUncertainty && !x.isUncertainty) { @@ -105,7 +82,10 @@ export class Multiply extends Expression { if (x.low.isQuantity) { product = new Uncertainty(doMultiplication(x.low, y.low), doMultiplication(x.high, y.high)); } else { - product = new Uncertainty(MathUtil.multiply(x.low, y.low), MathUtil.multiply(x.high, y.high)); + product = new Uncertainty( + MathUtil.multiply(x.low, y.low), + MathUtil.multiply(x.high, y.high) + ); } } else { product = MathUtil.multiply(x, y); @@ -114,8 +94,8 @@ export class Multiply extends Expression { if (MathUtil.overflowsOrUnderflows(product, this.resultTypeName)) { return null; } - - return finalizeNumericResult(product, this.resultTypeName); + + return MathUtil.finalizeNumericResult(product, this.resultTypeName); } } @@ -163,7 +143,7 @@ export class Divide extends Expression { if (MathUtil.overflowsOrUnderflows(quotient, this.resultTypeName)) { return null; } - return finalizeNumericResult(quotient, this.resultTypeName); + return MathUtil.finalizeNumericResult(quotient, this.resultTypeName); } } @@ -177,8 +157,8 @@ export class TruncatedDivide extends Expression { if (args == null || args.some((x: any) => x == null)) { return null; } - - let [x, y] = args; + + const [x, y] = args; let quotient; if (x.isQuantity) { quotient = doDivision(x, y); @@ -189,7 +169,10 @@ export class TruncatedDivide extends Expression { quotient = MathUtil.divide(x, y); // MathUtil.divide performs truncated division for Integers and Longs implicitly - if (quotient != null && (x.isDecimal || y.isDecimal || this.resultTypeName === ELM_DECIMAL_TYPE)) { + if ( + quotient != null && + (x.isDecimal || y.isDecimal || this.resultTypeName === ELM_DECIMAL_TYPE) + ) { quotient = (quotient as Decimal).truncated(); } } @@ -215,14 +198,13 @@ export class Modulo extends Expression { let modulo: number | bigint | Decimal; const [x, y] = args; try { - modulo = - x.isDecimal || y.isDecimal ? Decimal.from(x).modulo(y) : x % y; + modulo = x.isDecimal || y.isDecimal ? Decimal.from(x).modulo(y) : x % y; } catch { // modulo divide by zero results in null according to specification return null; } - return MathUtil.decimalLongOrNull(finalizeNumericResult(modulo, this.resultTypeName)) + return MathUtil.decimalLongOrNull(MathUtil.finalizeNumericResult(modulo, this.resultTypeName)); } } @@ -439,7 +421,12 @@ export class Power extends Expression { } function doPower(x: any, y: any) { - if (x.isDecimal || y.isDecimal || (typeof y == 'number' && y < 0) || (typeof y === 'bigint' && y < 0n)) { + if ( + x.isDecimal || + y.isDecimal || + (typeof y == 'number' && y < 0) || + (typeof y === 'bigint' && y < 0n) + ) { // Decimal values or negative powers always produce Decimal result return Decimal.from(x).power(y); } diff --git a/src/elm/interval.ts b/src/elm/interval.ts index 14a109f44..234d2ae4a 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -623,11 +623,7 @@ export class Expand extends Expression { return null; } - const results = this.makeDecimalIntervalList( - low_value, - high_value, - per_value - ); + const results = this.makeDecimalIntervalList(low_value, high_value, per_value); for (const itvl of results) { itvl.low = new Quantity(itvl.low, result_units); @@ -636,31 +632,27 @@ export class Expand extends Expression { return results; } - expandIntegerInterval(interval: any, per: any) { + expandIntegerInterval(interval: any, per: any) { if (per.unit !== '1' && per.unit !== '') { return null; } const low = interval.lowClosed ? interval.low : successor(interval.low); const high = interval.highClosed ? interval.high : predecessor(interval.high); - return this.makeDecimalIntervalList( - low, high, per.value - ); + return this.makeDecimalIntervalList(low, high, per.value); } - expandDecimalInterval(interval: any, per: any) { + expandDecimalInterval(interval: any, per: any) { if (per.unit !== '1' && per.unit !== '') { return null; } const low = interval.lowClosed ? interval.low : successor(interval.low); const high = interval.highClosed ? interval.high : predecessor(interval.high); - return this.makeDecimalIntervalList( - low, high, per.value - ); + return this.makeDecimalIntervalList(low, high, per.value); } - expandLongInterval(interval: any, per: any) { + expandLongInterval(interval: any, per: any) { if (per.unit !== '1' && per.unit !== '') { return null; } @@ -668,35 +660,32 @@ export class Expand extends Expression { const low = interval.lowClosed ? interval.low : successor(interval.low); const high = interval.highClosed ? interval.high : predecessor(interval.high); - return this.makeDecimalIntervalList( - low, high, per.value - ); + return this.makeDecimalIntervalList(low, high, per.value); } - makeDecimalIntervalList( - low: any, - high: any, - perValue: any - ) { + makeDecimalIntervalList(low: any, high: any, perValue: any) { // If the per value is a decimal, 8 decimal places are appropriate // Integers should have 0 Decimal places const perIsIntegral = perValue.isInteger(); - const decimalPrecision = perIsIntegral ? 0 : 8; + const decimalPrecision = perIsIntegral ? 0 : 8; // For the purposes of this function, we'll perform all the arithmetic using Decimals, // then convert the results back to the required type if necessary - let makeInterval: Function; + let makeInterval: (l: Decimal, h: Decimal) => dtivl.Interval; if (!perIsIntegral) { // If per is not an integer value, then regardless of the original point types, the values will be Decimals makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l, h, true, true); } else if (typeof low === 'bigint' || typeof high === 'bigint') { - makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toLong(), h.toLong(), true, true); + makeInterval = (l: Decimal, h: Decimal) => + new dtivl.Interval(l.toLong(), h.toLong(), true, true); } else if (typeof low === 'number' || typeof high === 'number') { - makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); + makeInterval = (l: Decimal, h: Decimal) => + new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); } else { // per is an integer but the original bounds of the interval were Decimal. // TODO: for now just make them integers - makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); + makeInterval = (l: Decimal, h: Decimal) => + new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); } // treat everything as a Decimal, convert back later if needed @@ -843,7 +832,9 @@ function collapseIntervals(intervals: any, perWidth: any) { a.high = b.high; } } else if ( - perWidth.value.greaterThanOrEquals(a.high != null ? a.high.durationBetween(b.low, perWidth.unit).high : undefined) + perWidth.value.greaterThanOrEquals( + a.high != null ? a.high.durationBetween(b.low, perWidth.unit).high : undefined + ) ) { a.high = b.high; } else { @@ -860,13 +851,12 @@ function collapseIntervals(intervals: any, perWidth: any) { a = b; } } else { - const distance = subtract(b.low, a.high); // TODO: perWidth.value is a Decimal, but distance could be anything // lessThanOrEquals requires that its args be the same type // so I guess for now, make distance a Decimal const distanceDecimal = Decimal.from(distance); - const withinPerWidth = lessThanOrEquals(distanceDecimal, perWidth.value); + const withinPerWidth = lessThanOrEquals(distanceDecimal, perWidth.value); if (withinPerWidth) { if (greaterThan(b.high, a.high) || b.high == null) { a.high = b.high; @@ -882,10 +872,3 @@ function collapseIntervals(intervals: any, perWidth: any) { return collapsedIntervals; } } - -function truncateDecimal(decimal: any, decimalPlaces: number) { - // like parseFloat().toFixed() but floor rather than round - // Needed for when per precision is less than the interval input precision - const re = new RegExp('^-?\\d+(?:.\\d{0,' + (decimalPlaces || -1) + '})?'); - return Decimal.from(decimal.toString().match(re)[0]); -} diff --git a/src/elm/type.ts b/src/elm/type.ts index 2215be8b4..c68982d1c 100644 --- a/src/elm/type.ts +++ b/src/elm/type.ts @@ -6,7 +6,7 @@ import { Concept } from '../datatypes/clinical'; import { Interval as dtInterval } from '../datatypes/interval'; import { Quantity, parseQuantity } from '../datatypes/quantity'; import { Decimal } from '../datatypes/decimal'; -import { isValidDecimal, isValidInteger, isValidLong, limitDecimalPrecision } from '../util/math'; +import { isValidDecimal, isValidInteger, isValidLong } from '../util/math'; import { normalizeMillisecondsField } from '../util/util'; import { Ratio } from '../datatypes/ratio'; import { @@ -166,7 +166,7 @@ export class ToDecimal extends Expression { const arg = await this.execArgs(ctx); if (arg != null) { if (arg.isUncertainty) { - const low = Decimal.from(arg.low).normalized() + const low = Decimal.from(arg.low).normalized(); const high = Decimal.from(arg.high).normalized(); return new Uncertainty(low, high); } else { @@ -175,7 +175,7 @@ export class ToDecimal extends Expression { if (isValidDecimal(decimal)) { return decimal.normalized(); } - } catch (_e) { + } catch { return null; } } diff --git a/src/util/comparison.ts b/src/util/comparison.ts index 467bb2e82..ce1cf55ab 100644 --- a/src/util/comparison.ts +++ b/src/util/comparison.ts @@ -47,9 +47,9 @@ export function lessThan(a: any, b: any, precision?: any) { export function lessThanOrEquals(a: any, b: any, precision?: any) { if (areNumbers(a, b) || areBigInts(a, b) || areStrings(a, b)) { return a <= b; - }else if (areDecimals(a, b)) { + } else if (areDecimals(a, b)) { return a.lessThanOrEquals(b); - } else if (areDateTimesOrQuantities(a, b)) { + } else if (areDateTimesOrQuantities(a, b)) { return a.sameOrBefore(b, precision); } else if (isUncertainty(a)) { return a.lessThanOrEquals(b, precision); diff --git a/src/util/immutableUtil.ts b/src/util/immutableUtil.ts index d57e80772..14d6c7d01 100644 --- a/src/util/immutableUtil.ts +++ b/src/util/immutableUtil.ts @@ -1,6 +1,14 @@ import * as ucum from '@lhncbc/ucum-lhc'; import { type Collection, Map as ImmutableMap, Seq as ImmutableSeq } from 'immutable'; -import { Code, DateTime, Decimal, Interval, Quantity, Ratio, Uncertainty } from '../datatypes/datatypes'; +import { + Code, + DateTime, + Decimal, + Interval, + Quantity, + Ratio, + Uncertainty +} from '../datatypes/datatypes'; import { decimalAdjust } from './math'; import { convertUnit } from './units'; @@ -95,7 +103,7 @@ export const toNormalizedKey = (js: any): NormalizedKey => { if (!baseUnitKey) { // No units found - normalization not possible and use provided values return ImmutableMap({ - value: js.value ? toNormalizedKey(js.value) : null, + value: js.value ? toNormalizedKey(js.value) : null, unit: js.unit ?? null, __instance: js.constructor }); diff --git a/src/util/math.ts b/src/util/math.ts index d70db1bc3..62216c002 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -9,11 +9,7 @@ import { MAX_TIME_VALUE } from '../datatypes/datetime'; -import { - Decimal, - MAX_DECIMAL_VALUE, - MIN_DECIMAL_VALUE -} from '../datatypes/decimal'; +import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../datatypes/decimal'; import { Uncertainty } from '../datatypes/uncertainty'; import { @@ -25,12 +21,7 @@ import { ELM_TIME_TYPE, ELM_QUANTITY_TYPE } from './elmTypes'; -import { - MAX_INT_VALUE, - MAX_LONG_VALUE, - MIN_INT_VALUE, - MIN_LONG_VALUE -} from './limits'; +import { MAX_INT_VALUE, MAX_LONG_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from './limits'; import { convertToCQLDateUnit, normalizeUnitsWhenPossible } from './units'; export function overflowsOrUnderflows(value: any, type?: string): boolean { @@ -67,10 +58,10 @@ export function overflowsOrUnderflows(value: any, type?: string): boolean { return true; } } else if (typeof value === 'number') { - if (!isValidInteger(value)) { - return true; - } - } else if (value.isDecimal) { + if (!isValidInteger(value)) { + return true; + } + } else if (value.isDecimal) { if (!isValidDecimal(value)) { return true; } @@ -236,13 +227,13 @@ export function divide(a: any, b: any, type?: string) { const quotient = Math.trunc(a / b); return overflowsOrUnderflows(quotient, ELM_INTEGER_TYPE) ? null : quotient; } - + throw new Error('Unsupported argument types.'); } -export function limitDecimalPrecision( - val?: T -): T | undefined { +export function limitDecimalPrecision< + T extends number | bigint | Quantity | Uncertainty | Decimal | undefined +>(val?: T): T | undefined { if (val == null) { return val; } else if (typeof val === 'number') { @@ -454,8 +445,25 @@ export function decimalOrNull(value: any) { export function decimalLongOrNull(value: any) { return (typeof value === 'number' && Number.isFinite(value)) || - ((value && value.isDecimal) && isValidDecimal(value)) || + (value && value.isDecimal && isValidDecimal(value)) || (typeof value === 'bigint' && isValidLong(value)) ? value : null; } + +export function finalizeNumericResult(result: any, _type?: string) { + if (result instanceof Decimal) { + return result.normalized(); + } else if (result instanceof Quantity) { + return new Quantity(result.value.normalized(), result.unit); + } else if (result instanceof Uncertainty) { + if (result.low instanceof Quantity || result.low instanceof Decimal) { + result.low = finalizeNumericResult(result.low); + } + if (result.high instanceof Quantity || result.high instanceof Decimal) { + result.high = finalizeNumericResult(result.high); + } + } + + return result; +} diff --git a/src/util/units.ts b/src/util/units.ts index 688ef2f6f..20abc8435 100644 --- a/src/util/units.ts +++ b/src/util/units.ts @@ -1,5 +1,4 @@ import * as ucum from '@lhncbc/ucum-lhc'; -import { decimalAdjust } from './math'; import { Decimal } from '../datatypes/decimal'; const utils = ucum.UcumLhcUtils.getInstance(); diff --git a/test/datatypes/date-test.ts b/test/datatypes/date-test.ts index 90080282f..dd8150016 100644 --- a/test/datatypes/date-test.ts +++ b/test/datatypes/date-test.ts @@ -898,7 +898,9 @@ describe('Date.getDateTime', () => { dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); - dateTime.timezoneOffset.should.equalDecimal(Decimal.from((new jsDate().getTimezoneOffset() / 60) * -1)); + dateTime.timezoneOffset.should.equalDecimal( + Decimal.from((new jsDate().getTimezoneOffset() / 60) * -1) + ); }); it('should return a DateTime without a timeZoneOffset when a null timeZoneOffset is passed in', () => { diff --git a/test/datatypes/interval-test.ts b/test/datatypes/interval-test.ts index 57f1e15de..7772a8ac1 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -132,7 +132,9 @@ describe('Interval', () => { }); it('should return the point size for Decimal intervals', () => { - new Interval(Decimal.from(0.5), Decimal.from(9.5)).getPointSize().should.equalDecimal(Decimal.from(0.00000001)); + new Interval(Decimal.from(0.5), Decimal.from(9.5)) + .getPointSize() + .should.equalDecimal(Decimal.from(0.00000001)); }); it('should return the point size for Quantity intervals', () => { @@ -164,7 +166,9 @@ describe('Interval', () => { it('should return successor of low for intervals with open low', () => { d.zeroToHundred.openClosed.start().should.equal(1); - d.zeroPointFiveToNinePointFive.openClosed.start().should.equalDecimal(Decimal.from("0.50000001")); + d.zeroPointFiveToNinePointFive.openClosed + .start() + .should.equalDecimal(Decimal.from('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')); @@ -177,7 +181,9 @@ describe('Interval', () => { 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.equalDecimal(MIN_DECIMAL_VALUE); + d.zeroPointFiveToNinePointFive.withNullStart.closed + .start() + .should.equalDecimal(MIN_DECIMAL_VALUE); d.zeroToHundredMg.withNullStart.closed .start() .should.eql(new Quantity(MIN_DECIMAL_VALUE, 'mg')); @@ -203,7 +209,9 @@ describe('Interval', () => { .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, Decimal.from(9.5))); d.zeroToHundredMg.withNullStart.openClosed .start() - .should.eql(new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(100, 'mg'))); + .should.eql( + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(100, 'mg')) + ); d.all2012date.withNullStart.openClosed .start() .should.eql(new Uncertainty(MIN_DATE_VALUE, Date.parse('2012-12-31'))); @@ -275,7 +283,10 @@ describe('Interval', () => { new Interval(null, null, false, false, ELM_QUANTITY_TYPE) .start() .should.eql( - new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) + new Uncertainty( + new Quantity(MIN_DECIMAL_VALUE, '1'), + new Quantity(MAX_DECIMAL_VALUE, '1') + ) ); new Interval(null, null, false, false, ELM_DATETIME_TYPE) .start() @@ -405,7 +416,10 @@ describe('Interval', () => { new Interval(null, null, false, false, ELM_QUANTITY_TYPE) .end() .should.eql( - new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, '1'), new Quantity(MAX_DECIMAL_VALUE, '1')) + new Uncertainty( + new Quantity(MIN_DECIMAL_VALUE, '1'), + new Quantity(MAX_DECIMAL_VALUE, '1') + ) ); new Interval(null, null, false, false, ELM_DATETIME_TYPE) .end() @@ -7002,10 +7016,16 @@ describe('DecimalInterval', () => { }); it('should calculate width and size outside the Integer range', () => { - const interval = new Interval(Decimal.from(0.0), Decimal.from(3000000000.0), true, true, ELM_DECIMAL_TYPE); + const interval = new Interval( + Decimal.from(0.0), + Decimal.from(3000000000.0), + true, + true, + ELM_DECIMAL_TYPE + ); - interval.width().should.equalDecimal(Decimal.from("3000000000.0")); - interval.size().should.equalDecimal(Decimal.from("3000000000.00000001")); + interval.width().should.equalDecimal(Decimal.from('3000000000.0')); + interval.size().should.equalDecimal(Decimal.from('3000000000.00000001')); }); it('should close open decimal uncertainty endpoints using decimal point size', () => { @@ -7025,13 +7045,25 @@ describe('DecimalInterval', () => { it('should use decimal point size for meetsBefore decimal uncertainty bounds', () => { const earlier = new Interval(Decimal.from(1), Decimal.from(1.99999999)); - const later = new Interval(new Uncertainty(Decimal.from(2), Decimal.from(2)), null, true, false, ELM_DECIMAL_TYPE); + const later = new Interval( + new Uncertainty(Decimal.from(2), Decimal.from(2)), + null, + true, + false, + ELM_DECIMAL_TYPE + ); earlier.meetsBefore(later).should.be.true(); }); it('should use decimal point size for meetsAfter decimal uncertainty bounds', () => { - const earlier = new Interval(null, new Uncertainty(Decimal.from(1), Decimal.from(1)), false, true, ELM_DECIMAL_TYPE); + const earlier = new Interval( + null, + new Uncertainty(Decimal.from(1), Decimal.from(1)), + false, + true, + ELM_DECIMAL_TYPE + ); const later = new Interval(Decimal.from(1.00000001), Decimal.from(2)); later.meetsAfter(earlier).should.be.true(); diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 6adc191e6..22292ffdb 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -98,11 +98,7 @@ describe('Sum', () => { }); it('should be able to sum quantities up to max decimal value', async function () { - validateQuantity( - await this.quantities_at_max_value.exec(this.ctx), - MAX_DECIMAL_VALUE, - 'ml' - ); + validateQuantity(await this.quantities_at_max_value.exec(this.ctx), MAX_DECIMAL_VALUE, 'ml'); }); it('should return null when overflowing the max quantity value', async function () { @@ -110,11 +106,7 @@ describe('Sum', () => { }); it('should be able to sum quantities down to min decimal value', async function () { - validateQuantity( - await this.quantities_at_min_value.exec(this.ctx), - MIN_DECIMAL_VALUE, - 'ml' - ); + validateQuantity(await this.quantities_at_min_value.exec(this.ctx), MIN_DECIMAL_VALUE, 'ml'); }); it('should return null when underflowing the min quantity value', async function () { @@ -480,13 +472,13 @@ describe('StdDev', () => { setup(this, data); }); it('should be able to find Standard Dev of a list ', async function () { - (await this.std.exec(this.ctx)).should.equalDecimal(Decimal.from("1.58113883")); + (await this.std.exec(this.ctx)).should.equalDecimal(Decimal.from('1.58113883')); }); it('should be able to find Standard Dev of a list of like quantities', async function () { - validateQuantity(await this.std_q.exec(this.ctx), "1.58113883", 'ml'); + validateQuantity(await this.std_q.exec(this.ctx), '1.58113883', 'ml'); }); it('should be able to find Standard Dev of a list of related quantities', async function () { - validateQuantity(await this.q_diff_units.exec(this.ctx), "1.58113883", 'ml'); + validateQuantity(await this.q_diff_units.exec(this.ctx), '1.58113883', 'ml'); }); it('should be null if some are numbers and some are quantities', async function () { should(await this.numbersAndQuantities.exec(this.ctx)).be.null(); @@ -501,13 +493,13 @@ describe('PopulationStdDev', () => { setup(this, data); }); it('should be able to find Population Standard Dev of a list ', async function () { - (await this.dev.exec(this.ctx)).should.equalDecimal(Decimal.from("1.41421356")); + (await this.dev.exec(this.ctx)).should.equalDecimal(Decimal.from('1.41421356')); }); it('should be able to find Population Standard Dev of a list of quantities', async function () { - validateQuantity(await this.dev_q.exec(this.ctx), "1.41421356", 'ml'); + validateQuantity(await this.dev_q.exec(this.ctx), '1.41421356', 'ml'); }); it('should be able to find Population Standard Dev of a list of related quantities', async function () { - validateQuantity(await this.q_diff_units.exec(this.ctx), "1.41421356", 'ml'); + validateQuantity(await this.q_diff_units.exec(this.ctx), '1.41421356', 'ml'); }); it('should be null if some are numbers and some are quantities', async function () { should(await this.numbersAndQuantities.exec(this.ctx)).be.null(); @@ -567,9 +559,7 @@ describe('Product', () => { }); it('should return decimal product up to max decimal value', async function () { - (await this.decimals_at_max_value_product.exec(this.ctx)).should.eql( - MAX_DECIMAL_VALUE - ); + (await this.decimals_at_max_value_product.exec(this.ctx)).should.eql(MAX_DECIMAL_VALUE); }); it('should return null when decimal product overflows max decimal value', async function () { @@ -577,9 +567,7 @@ describe('Product', () => { }); it('should return decimal product down to min decimal value', async function () { - (await this.decimals_at_min_value_product.exec(this.ctx)).should.eql( - MIN_DECIMAL_VALUE - ); + (await this.decimals_at_min_value_product.exec(this.ctx)).should.eql(MIN_DECIMAL_VALUE); }); it('should return null when decimal product underflows min decimal value', async function () { @@ -662,7 +650,7 @@ describe('GeometricMean', () => { }); it('should return value when pass in list that contains nulls', async function () { - (await this.null_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from("1.41421356")); + (await this.null_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from('1.41421356')); }); it('should return null when list is all null', async function () { diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 774aa91bd..1671c64c5 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -26,7 +26,11 @@ import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/data const data = require('./data'); -const validateQuantity = function (object: any, expectedValue: number | Decimal, expectedUnit: string) { +const validateQuantity = function ( + object: any, + expectedValue: number | Decimal, + expectedUnit: string +) { object.isQuantity.should.be.true(); const q = new Quantity(expectedValue, expectedUnit); q.equals(object).should.be.true('Expected ' + object + ' to equal ' + q); @@ -255,7 +259,7 @@ describe('Divide', () => { it('should divide uncertainty by uncertainty', async function () { const result = await this.divideUncertainties.exec(this.ctx); - result.low.should.equalDecimal(Decimal.from("0.42857143")); // 6/14 + result.low.should.equalDecimal(Decimal.from('0.42857143')); // 6/14 result.high.should.equalDecimal(Decimal.from(9)); }); @@ -537,12 +541,12 @@ describe('Ln', () => { }); it('should be able to return the natural log of a number', async function () { - const log4 = Decimal.from("1.3862943611198906").normalized(); + const log4 = Decimal.from('1.3862943611198906').normalized(); (await this.ln.exec(this.ctx)).should.equalDecimal(log4); }); it('should be able to return the natural log of a long', async function () { - const log4 = Decimal.from("1.3862943611198906").normalized(); + const log4 = Decimal.from('1.3862943611198906').normalized(); (await this.lnFourLong.exec(this.ctx)).should.equalDecimal(log4); }); }); @@ -752,7 +756,7 @@ describe('Predecessor', () => { }); it('should be able to get Real Predecessor', async function () { - (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from("2.19999999")); + (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from('2.19999999')); }); it('should return null for Predecessor greater than Integer Max value', async function () { @@ -1011,12 +1015,16 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but more than max integer and near JavaScript max safe number - should(await this.integerDivideNearOverflow.exec(this.ctx)).equalDecimal(Decimal.from(8589934588000000)); + should(await this.integerDivideNearOverflow.exec(this.ctx)).equalDecimal( + Decimal.from(8589934588000000) + ); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but less than min integer and near JavaScript min safe number - should(await this.integerDivideNearUnderflow.exec(this.ctx)).equalDecimal(Decimal.from(-8589934592000000)); + should(await this.integerDivideNearUnderflow.exec(this.ctx)).equalDecimal( + Decimal.from(-8589934592000000) + ); }); it('should return null for Divide By Zero', async function () { @@ -1118,12 +1126,16 @@ describe('OutOfBounds', () => { // note that all division in CQL (except truncated division) is really decimal division // note also that MAX_LONG_VALUE is (2^63)-1, // 9223372036854775807 = 7^2 * 73 * 127 * 337 * 92737 * 649657 - should(await this.longDivideNearOverflow.exec(this.ctx)).equalDecimal(Decimal.from(99457304386111n)); + should(await this.longDivideNearOverflow.exec(this.ctx)).equalDecimal( + Decimal.from(99457304386111n) + ); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but near JavaScript min safe number - should(await this.longDivideNearUnderflow.exec(this.ctx)).equalDecimal(Decimal.from(-9007199254740992n)); + should(await this.longDivideNearUnderflow.exec(this.ctx)).equalDecimal( + Decimal.from(-9007199254740992n) + ); }); it('should return null for Divide By Zero', async function () { @@ -1257,11 +1269,15 @@ describe('OutOfBounds', () => { }); it('should return value for successor near overflow', async function () { - should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equalDecimal(MAX_DECIMAL_VALUE); + should(await this.decimalSuccessorNearOverflow.exec(this.ctx)).equalDecimal( + MAX_DECIMAL_VALUE + ); }); it('should return value for predecessor near underflow', async function () { - should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equalDecimal(MIN_DECIMAL_VALUE); + should(await this.decimalPredecessorNearUnderflow.exec(this.ctx)).equalDecimal( + MIN_DECIMAL_VALUE + ); }); }); diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 78757f286..791b951d9 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -1686,9 +1686,13 @@ describe('Size', () => { it('should calculate the size of real intervals', async function () { // define RealSize: Size(Interval[1.23, 4.56]) - (await this.realSize.exec(this.ctx)).should.equalDecimal(Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE)); + (await this.realSize.exec(this.ctx)).should.equalDecimal( + Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE) + ); // define RealOpenSize: Size(Interval(1.23, 4.56)) - (await this.realOpenSize.exec(this.ctx)).should.equalDecimal(Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE)); + (await this.realOpenSize.exec(this.ctx)).should.equalDecimal( + Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE) + ); }); it('should calculate the size of infinite intervals', async function () { @@ -1758,7 +1762,9 @@ describe('Start', () => { it('should return the minimum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(Decimal.from(5)); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal( + Decimal.from(5) + ); }); it('should return the minimum possible Integer', async function () { @@ -1808,7 +1814,9 @@ describe('End', () => { it('should return the maximum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(Decimal.from(5)); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal( + Decimal.from(5) + ); }); it('should return the maximum possible Integer', async function () { @@ -3490,9 +3498,6 @@ describe('QuantityIntervalExpand', () => { }); it('returns null when per zero, not applicable, or mismatch interval', async function () { - - console.log('debuggger') - // define perZero: expand { Interval[2 'g', 4 'g'] } per 0 'g' let a = await this.perZero.exec(this.ctx); should.not.exist(a); diff --git a/test/elm/parameters/parameters-test.ts b/test/elm/parameters/parameters-test.ts index dc2e354a9..b450a217e 100644 --- a/test/elm/parameters/parameters-test.ts +++ b/test/elm/parameters/parameters-test.ts @@ -100,7 +100,9 @@ describe('DecimalParameterTypes', () => { }); it('should execute to provided valid value', async function () { - (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.equalDecimal(Decimal.from(3.0)); + (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.equalDecimal( + Decimal.from(3.0) + ); }); it('should throw when provided value is wrong type', function () { @@ -112,7 +114,9 @@ describe('DecimalParameterTypes', () => { }); it('should execute to overriding valid value', async function () { - (await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) }))).should.equalDecimal(Decimal.from(3.0)); + ( + await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) })) + ).should.equalDecimal(Decimal.from(3.0)); }); it('should throw when overriding value is wrong type', function () { @@ -130,7 +134,9 @@ describe('IntegerParameterTypes', () => { }); it('should throw when provided value is wrong type', function () { - should(() => this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.5) }))).throw(/.*wrong type.*/); + should(() => this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.5) }))).throw( + /.*wrong type.*/ + ); }); it('should execute to default value', async function () { @@ -142,7 +148,9 @@ describe('IntegerParameterTypes', () => { }); it('should throw when overriding value is wrong type', function () { - should(() => this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.5) }))).throw(/.*wrong type.*/); + should(() => this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.5) }))).throw( + /.*wrong type.*/ + ); }); }); @@ -424,9 +432,11 @@ describe('IntervalParameterTypes', () => { }); it('should throw when interval contains a wrong point type', async function () { - should(() => this.foo.exec(this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }))).throw( - /.*wrong type.*/ - ); + should(() => + this.foo.exec( + this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }) + ) + ).throw(/.*wrong type.*/); }); it('should execute to default value', async function () { @@ -444,9 +454,11 @@ describe('IntervalParameterTypes', () => { }); it('should throw when overriding interval contains a wrong point type', async function () { - should(() => this.foo2.exec(this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }))).throw( - /.*wrong type.*/ - ); + should(() => + this.foo2.exec( + this.ctx.withParameters({ FooP: new Interval(Decimal.from(1.5), Decimal.from(5.5)) }) + ) + ).throw(/.*wrong type.*/); }); }); diff --git a/test/should-extensions.ts b/test/should-extensions.ts index 1d29e8026..f57ba3890 100644 --- a/test/should-extensions.ts +++ b/test/should-extensions.ts @@ -31,11 +31,15 @@ declare module 'should' { normalizedThis.should.eql(normalizedExpected); }); -(should as any).Assertion.add('equalDecimal', function (this: any, expected: number | bigint | Decimal) { - this.params = { operator: 'to equal Decimal', expected: expected.toString(), obj: this.obj.toString() }; +(should as any).Assertion.add( + 'equalDecimal', + function (this: any, expected: number | bigint | Decimal) { + this.params = { + operator: 'to equal Decimal', + expected: expected.toString(), + obj: this.obj.toString() + }; - this.assert( - this.obj instanceof Decimal && - this.obj.equals(expected) - ); -}); \ No newline at end of file + this.assert(this.obj instanceof Decimal && this.obj.equals(expected)); + } +); diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index 9809612bf..b68768ded 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -45,9 +45,6 @@ describe('CQL Spec Tests (from XML)', () => { } suite.expression.element.forEach((t: any) => { it(`should properly evaluate ${t.name}`, async function () { - if (t.name === 'beans') { - debugger; - } const testCaseMap = convertTupleToMap(t.value); if (testCaseMap.has('skipped')) { this.skip(); diff --git a/test/util/math-test.ts b/test/util/math-test.ts index 905ac4c17..5071fd60d 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -12,7 +12,10 @@ describe('successor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); + const result = successor( + new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), + ELM_DECIMAL_TYPE + ); result.low.should.equalDecimal(Decimal.from(1.00000001)); result.high.should.equalDecimal(Decimal.from(2.00000001)); }); @@ -31,7 +34,10 @@ describe('predecessor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), ELM_DECIMAL_TYPE); + const result = successor( + new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), + ELM_DECIMAL_TYPE + ); result.low.should.equalDecimal(Decimal.from(1.00000001)); result.high.should.equalDecimal(Decimal.from(2.00000001)); }); diff --git a/test/util/units-test.ts b/test/util/units-test.ts index 9cf5ea45c..3550a6f25 100644 --- a/test/util/units-test.ts +++ b/test/util/units-test.ts @@ -132,7 +132,7 @@ describe('convertUnit', () => { it('should truncate precision to 8 decimals by default', () => { const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]'); - result.should.equalDecimal(Decimal.from("0.00018939")); + result.should.equalDecimal(Decimal.from('0.00018939')); }); // it('should not truncate precision to 8 decimals when adjustPrecision is false', () => { @@ -148,35 +148,79 @@ describe('convertUnit', () => { }); describe('normalizeUnitsWhenPossible', () => { - it('should keep same units', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'm']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm').should.eql([ + Decimal.from(10), + 'm', + Decimal.from(1), + 'm' + ]); }); it('should convert compatible units, preferring smaller units', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'cm', Decimal.from(1), 'm').should.eql([Decimal.from(10), 'cm', Decimal.from(100), 'cm']); - normalizeUnitsWhenPossible(Decimal.from(1), 'm', Decimal.from(10), 'cm').should.eql([Decimal.from(100), 'cm', Decimal.from(10), 'cm']); + normalizeUnitsWhenPossible(Decimal.from(10), 'cm', Decimal.from(1), 'm').should.eql([ + Decimal.from(10), + 'cm', + Decimal.from(100), + 'cm' + ]); + normalizeUnitsWhenPossible(Decimal.from(1), 'm', Decimal.from(10), 'cm').should.eql([ + Decimal.from(100), + 'cm', + Decimal.from(10), + 'cm' + ]); }); it('should treat null or empty string units as 1', () => { - normalizeUnitsWhenPossible(Decimal.from(10), null, Decimal.from(1), '').should.eql([Decimal.from(10), '1', Decimal.from(1), '1']); - normalizeUnitsWhenPossible(Decimal.from(1), '', Decimal.from(10), null).should.eql([Decimal.from(1), '1', Decimal.from(10), '1']); + normalizeUnitsWhenPossible(Decimal.from(10), null, Decimal.from(1), '').should.eql([ + Decimal.from(10), + '1', + Decimal.from(1), + '1' + ]); + normalizeUnitsWhenPossible(Decimal.from(1), '', Decimal.from(10), null).should.eql([ + Decimal.from(1), + '1', + Decimal.from(10), + '1' + ]); }); it('should normalize CQL date units and return CQL date units', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'year', Decimal.from(12), 'month').should.eql([Decimal.from(120), 'month', Decimal.from(12), 'month']); + normalizeUnitsWhenPossible(Decimal.from(10), 'year', Decimal.from(12), 'month').should.eql([ + Decimal.from(120), + 'month', + Decimal.from(12), + 'month' + ]); }); it('should return CQL date units when UCUM units are passed in', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'a_g', Decimal.from(12), 'mo_g').should.eql([Decimal.from(120), 'mo_g', Decimal.from(12), 'mo_g']); + normalizeUnitsWhenPossible(Decimal.from(10), 'a_g', Decimal.from(12), 'mo_g').should.eql([ + Decimal.from(120), + 'mo_g', + Decimal.from(12), + 'mo_g' + ]); }); it('should not convert units of different dimensions', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm2').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'm2']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'm2').should.eql([ + Decimal.from(10), + 'm', + Decimal.from(1), + 'm2' + ]); }); it('should not convert incompatible units', () => { - normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'mg').should.eql([Decimal.from(10), 'm', Decimal.from(1), 'mg']); + normalizeUnitsWhenPossible(Decimal.from(10), 'm', Decimal.from(1), 'mg').should.eql([ + Decimal.from(10), + 'm', + Decimal.from(1), + 'mg' + ]); }); }); From e47383f37bb0690a3a6812ea93b9722949b1b2a3 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 20 Aug 2026 13:38:25 -0400 Subject: [PATCH 04/62] fix package-lock --- package-lock.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/package-lock.json b/package-lock.json index e3c125fad..4de37c4a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1062,6 +1062,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1079,6 +1082,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1096,6 +1102,9 @@ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1113,6 +1122,9 @@ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1130,6 +1142,9 @@ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1147,6 +1162,9 @@ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1164,6 +1182,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1181,6 +1202,9 @@ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ From b77728e47d9a7576ef24f4a55f21267e3b855084 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 20 Aug 2026 13:44:30 -0400 Subject: [PATCH 05/62] actually fix package-lock --- package-lock.json | 630 ++++++++++++++++++++++++---------------------- 1 file changed, 330 insertions(+), 300 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4de37c4a3..4e391eb81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,14 +109,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -239,13 +239,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.7" + "@babel/types": "^7.29.8" }, "bin": { "parser": "bin/babel-parser.js" @@ -270,18 +270,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz", + "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", + "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", + "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/types": "^7.29.8", "debug": "^4.3.1" }, "engines": { @@ -289,9 +289,9 @@ } }, "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", "dev": true, "license": "MIT", "dependencies": { @@ -310,9 +310,9 @@ "license": "MIT" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", "cpu": [ "ppc64" ], @@ -327,9 +327,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", "cpu": [ "arm" ], @@ -344,9 +344,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", "cpu": [ "arm64" ], @@ -361,9 +361,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", "cpu": [ "x64" ], @@ -378,9 +378,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", "cpu": [ "arm64" ], @@ -395,9 +395,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", "cpu": [ "x64" ], @@ -412,9 +412,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", "cpu": [ "arm64" ], @@ -429,9 +429,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", "cpu": [ "x64" ], @@ -446,9 +446,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", "cpu": [ "arm" ], @@ -463,9 +463,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", "cpu": [ "arm64" ], @@ -480,9 +480,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", "cpu": [ "ia32" ], @@ -497,9 +497,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", "cpu": [ "loong64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", "cpu": [ "mips64el" ], @@ -531,9 +531,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", "cpu": [ "ppc64" ], @@ -548,9 +548,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", "cpu": [ "riscv64" ], @@ -565,9 +565,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", "cpu": [ "s390x" ], @@ -582,9 +582,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", "cpu": [ "x64" ], @@ -599,9 +599,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", "cpu": [ "arm64" ], @@ -616,9 +616,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", "cpu": [ "x64" ], @@ -633,9 +633,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", "cpu": [ "arm64" ], @@ -650,9 +650,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", "cpu": [ "x64" ], @@ -667,9 +667,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", "cpu": [ "arm64" ], @@ -684,9 +684,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", "cpu": [ "x64" ], @@ -701,9 +701,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", "cpu": [ "arm64" ], @@ -718,9 +718,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", "cpu": [ "ia32" ], @@ -735,9 +735,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", "cpu": [ "x64" ], @@ -848,20 +848,10 @@ "node": ">=8" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", "dev": true, "license": "MIT", "engines": { @@ -1799,9 +1789,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.10.38", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.38.tgz", - "integrity": "sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw==", + "version": "2.11.16", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.16.tgz", + "integrity": "sha512-H/bNPUFHewJHyCTdjn1n3Pit5+2GmWT6mmeHImPX+8MA9NA6b67jO4gYmi4jTbCJb2otq34KMZnovndDPqJwhQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -1832,9 +1822,9 @@ "license": "ISC" }, "node_modules/browserslist": { - "version": "4.28.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", - "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==", + "version": "4.28.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz", + "integrity": "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==", "dev": true, "funding": [ { @@ -1852,11 +1842,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.38", - "caniuse-lite": "^1.0.30001799", - "electron-to-chromium": "^1.5.376", - "node-releases": "^2.0.48", - "update-browserslist-db": "^1.2.3" + "baseline-browser-mapping": "^2.11.12", + "caniuse-lite": "^1.0.30001809", + "electron-to-chromium": "^1.5.402", + "node-releases": "^2.0.53", + "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" @@ -1892,9 +1882,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001799", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz", - "integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==", + "version": "1.0.30001809", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001809.tgz", + "integrity": "sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==", "dev": true, "funding": [ { @@ -1938,6 +1928,18 @@ "node": ">=6" } }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, "node_modules/coffeescript": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.7.0.tgz", @@ -1978,6 +1980,13 @@ "dev": true, "license": "MIT" }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -2062,7 +2071,7 @@ }, "node_modules/decimal.js": { "version": "10.6.0", - "resolved": "https://artifacts.mitre.org:443/artifactory/api/npm/node-npm/decimal.js/-/decimal.js-10.6.0.tgz", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", "license": "MIT" }, @@ -2093,9 +2102,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.376", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.376.tgz", - "integrity": "sha512-cUVA7/RvbFTEuw/i3obUwDTRIXojaxkResf+ibByPFxjc6XK3VNtcQXV0NSbAlJ0FMjcJGgftVVB4Qo184EXvA==", + "version": "1.5.411", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.411.tgz", + "integrity": "sha512-gglkxzokjHfawpGxq75XdBV2/l3BAPzrsMs70qgaZdTW5rpV1tC4MdgJVP9fN126bODA4ZJQkn1wryEzJyQXIg==", "dev": true, "license": "ISC" }, @@ -2114,9 +2123,9 @@ "license": "MIT" }, "node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2127,32 +2136,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" } }, "node_modules/escalade": { @@ -2620,16 +2629,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-source-maps/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/istanbul-reports": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", @@ -2862,9 +2861,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.48", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.48.tgz", - "integrity": "sha512-1uz8041X6LoI6ZSdZacM9lVY28vuzDlSKitnpbSNK0RfKoIJkX29NBPVEFXhnuSuEOA9Ww0xnPJ+ILWbGAv8DA==", + "version": "2.0.53", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.53.tgz", + "integrity": "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==", "dev": true, "license": "MIT", "engines": { @@ -2913,25 +2912,6 @@ "node": "20 || >=22" } }, - "node_modules/nyc/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/nyc/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true, - "license": "MIT" - }, "node_modules/nyc/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -2988,75 +2968,6 @@ "node": ">=8" } }, - "node_modules/nyc/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/oxlint": { "version": "1.79.0", "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.79.0.tgz", @@ -3357,21 +3268,6 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/readdirp": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", @@ -3416,6 +3312,16 @@ "dev": true, "license": "ISC" }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/rimraf": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", @@ -3436,10 +3342,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, "node_modules/sax": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.4.tgz", - "integrity": "sha512-1n3r/tGXO6b6VXMdFT54SHzT9ytu9yr7TaELowdYpMqY/Ao7EnlQGmAQ1+RatX7Tkkdm6hONI2owqNx2aZj5Sw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz", + "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -3447,9 +3359,9 @@ } }, "node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -3460,9 +3372,9 @@ } }, "node_modules/serialize-javascript": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.5.tgz", - "integrity": "sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.0.tgz", + "integrity": "sha512-RNEqWOyhhUQYN9V1GfHwu9AR/g+NTciH6Z5u3/no6X3/w+04J2lVDL+svFQVXgXrEGBMG2puMVN3gq2SNGuTGw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -3593,6 +3505,16 @@ "url": "https://opencollective.com/sinon" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spawn-wrap": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-3.0.0.tgz", @@ -3639,6 +3561,15 @@ "integrity": "sha512-3HXId/0W8sktQnQM6rOZf2LuDDMbakMgAjpViLk758/h0br+iGqZFFfUxxJSqEvGvT742PyFr4v/TBXUtowdCg==", "license": "BSD-3-Clause" }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/string-to-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string-to-stream/-/string-to-stream-1.1.1.tgz", @@ -3738,22 +3669,6 @@ "node": "20 || >=22" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/tsx": { "version": "4.23.12", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.12.tgz", @@ -3846,9 +3761,9 @@ "license": "MIT" }, "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.1.tgz", + "integrity": "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==", "dev": true, "funding": [ { @@ -3912,6 +3827,21 @@ "dev": true, "license": "Apache-2.0" }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", @@ -3953,6 +3883,13 @@ "integrity": "sha512-8zci48uUQyfqynGDSkUMD7FCJB96hwLnlZOXlgs1l3TX+LW27t3psSWKUxC0fxVgA86i8tL4NwGcY1h/6t3ESg==", "license": "ISC" }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -3960,6 +3897,99 @@ "dev": true, "license": "ISC" }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", From ffc8949637027564f983acaa279d96a424430848 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 25 Aug 2026 11:30:34 -0400 Subject: [PATCH 06/62] Skip interval expand tests for now --- src/elm/interval.ts | 10 ---------- test/elm/interval/interval-test.ts | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/elm/interval.ts b/src/elm/interval.ts index 234d2ae4a..c3c4922d2 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -707,16 +707,6 @@ export class Expand extends Expression { const perUnitSize = perIsIntegral ? 1 : 0.00000001; - // TODO: this supports one test case but it's not clear if the test case is correct - // if ( - // low === high && - // Number.isInteger(low) && - // Number.isInteger(high) && - // !Number.isInteger(perValue) - // ) { - // high = parseFloat((high + 1).toFixed(decimalPrecision)); - // } - let current_low = low; const results = []; diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 791b951d9..4a1660041 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -3599,7 +3599,15 @@ describe('IntegerIntervalExpand', () => { should.not.exist(a); }); - it('produces a more precise value for output intervals', async function () { + it.skip('produces a more precise value for output intervals', async function () { + // This example from the spec is incorrect. + // Skip for now until we have more clarity on what the expected result should be + // https://jira.hl7.org/browse/FHIR-58705 and + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Interval.20Expand.20example/with/619051021 + // Note that as of this writing the produced result is { } (empty list) + // which I believe is the correct result. + // But an empty list doesn't clearly show the intent of the test. + // define PerDecimalMorePrecise: expand { Interval[10, 10] } per 0.1 const a = await this.perDecimalMorePrecise.exec(this.ctx); // JavaScript truncates 10.0 to 10. @@ -3673,7 +3681,15 @@ describe('LongIntervalExpand', () => { should.not.exist(a); }); - it('produces a more precise value for output intervals', async function () { + it.skip('produces a more precise value for output intervals', async function () { + // This example from the spec is incorrect. + // Skip for now until we have more clarity on what the expected result should be + // https://jira.hl7.org/browse/FHIR-58705 and + // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Interval.20Expand.20example/with/619051021 + // Note that as of this writing the produced result is { } (empty list) + // which I believe is the correct result. + // But an empty list doesn't clearly show the intent of the test. + const a = await this.longPerDecimalMorePrecise.exec(this.ctx); prettyList(a).should.equal( '{ [10, 10.09999999], [10.1, 10.19999999], [10.2, 10.29999999], [10.3, 10.39999999], [10.4, 10.49999999], [10.5, 10.59999999], [10.6, 10.69999999], [10.7, 10.79999999], [10.8, 10.89999999], [10.9, 10.99999999] }' From fbc1f989c8edb22eedd3e59631c6f3ca850c4d70 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 25 Aug 2026 12:51:43 -0400 Subject: [PATCH 07/62] fix test-server --- src/cql.ts | 3 +++ test-server/src/convert/convert.ts | 14 ++++++++++---- test-server/src/convert/cqlTypes.ts | 8 ++++---- test-server/tests/convert/convert.test.ts | 5 +++-- test-server/tests/convert/cqlTypes.test.ts | 7 ++++--- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/cql.ts b/src/cql.ts index 33d47d829..e76b08e9f 100644 --- a/src/cql.ts +++ b/src/cql.ts @@ -22,6 +22,7 @@ import { Concept, Date, DateTime, + Decimal, Interval, Quantity, Ratio, @@ -54,6 +55,7 @@ export { Concept, Date, DateTime, + Decimal, Interval, Quantity, Ratio, @@ -81,6 +83,7 @@ export default { Concept, Date, DateTime, + Decimal, Interval, Quantity, Ratio, diff --git a/test-server/src/convert/convert.ts b/test-server/src/convert/convert.ts index e74fc54ad..412d22b50 100644 --- a/test-server/src/convert/convert.ts +++ b/test-server/src/convert/convert.ts @@ -15,6 +15,7 @@ import { Concept, Date as CqlDate, DateTime as CqlDateTime, + Decimal as CqlDecimal, Quantity as CqlQuantity, Ratio as CqlRatio, Interval, @@ -170,9 +171,9 @@ function toLongParameter(name: string, result: number): ParametersParameter { return { name, valueString: String(result) }; } -function toDecimalParameter(name: string, result: number): ParametersParameter { +function toDecimalParameter(name: string, result: CqlDecimal | number): ParametersParameter { // TODO: use the quantity-precision extension to communicate precision of the value - return { name, valueDecimal: result }; + return { name, valueDecimal: result instanceof CqlDecimal ? result.toNumber() : result }; } function toDateParameter(name: string, result: CqlDate) { @@ -302,15 +303,20 @@ function toChoiceParameter(name: string, result: any, typeSpecifier: AnyTypeSpec return { name }; } -function toFhirQuantity(val: CqlQuantity | number, isIntegerOrLong = false): FhirQuantity { +function toFhirQuantity( + val: CqlQuantity | CqlDecimal | number, + isIntegerOrLong = false +): FhirQuantity { let fq: FhirQuantity; if (typeof val === 'number') { fq = { value: val, system: 'http://unitsofmeasure.org', code: '1' }; } else if (typeof val === 'bigint') { fq = { value: Number(val), system: 'http://unitsofmeasure.org', code: '1' }; + } else if (val instanceof CqlDecimal) { + fq = { value: val.toNumber(), system: 'http://unitsofmeasure.org', code: '1' }; } else { const cq = val as CqlQuantity; - fq = { value: cq.value } as FhirQuantity; + fq = { value: cq.value.toNumber() }; if (cq.unit != null) { fq.unit = fq.code = cq.unit; if ( diff --git a/test-server/src/convert/cqlTypes.ts b/test-server/src/convert/cqlTypes.ts index dfdba0fae..ebc895803 100644 --- a/test-server/src/convert/cqlTypes.ts +++ b/test-server/src/convert/cqlTypes.ts @@ -6,6 +6,7 @@ import { TupleTypeSpecifier, TupleElementDefinition, AnyTypeSpecifier, + Decimal, Interval } from '../../..'; import { ELM_ANY_TYPE } from '../../../lib/util/elmTypes'; @@ -60,11 +61,10 @@ export function guessSpecifierType(val: any): AnyTypeSpecifier | undefined { return typeHierarchy[0]; } else if (typeof val === 'boolean') { return { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Boolean' }; - } else if (typeof val === 'number' && Math.floor(val) === val) { - // It could still be a decimal, but we have to just take our best guess! - return { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Integer' }; - } else if (typeof val === 'number') { + } else if (val instanceof Decimal) { return { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Decimal' }; + } else if (typeof val === 'number') { + return { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Integer' }; } else if (typeof val === 'string') { return { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}String' }; } else if (val.isConcept) { diff --git a/test-server/tests/convert/convert.test.ts b/test-server/tests/convert/convert.test.ts index a4cdf96c6..0cdcc5161 100644 --- a/test-server/tests/convert/convert.test.ts +++ b/test-server/tests/convert/convert.test.ts @@ -6,6 +6,7 @@ import { Concept, Date as CqlDate, DateTime, + Decimal, Interval, IntervalTypeSpecifier, ListTypeSpecifier, @@ -66,7 +67,7 @@ describe('convert.toParameters', () => { }); it('converts decimal to valueDecimal', () => { - expect(toParameters(3.14159, 'System.Decimal')).toEqual({ + expect(toParameters(Decimal.from('3.14159'), 'System.Decimal')).toEqual({ resourceType: 'Parameters', parameter: [ { extension: cqlTypeExt('System.Decimal'), name: 'return', valueDecimal: 3.14159 } @@ -686,7 +687,7 @@ describe('convert.toParameters', () => { }); it('guesses type when no type is passed in and converts value (Decimal example)', () => { - expect(toParameters(1.25)).toEqual({ + expect(toParameters(Decimal.from('1.25'))).toEqual({ resourceType: 'Parameters', parameter: [ { diff --git a/test-server/tests/convert/cqlTypes.test.ts b/test-server/tests/convert/cqlTypes.test.ts index 5c8ec76df..7a9dcdb8c 100644 --- a/test-server/tests/convert/cqlTypes.test.ts +++ b/test-server/tests/convert/cqlTypes.test.ts @@ -11,6 +11,7 @@ import { Concept, Date as CqlDate, DateTime, + Decimal, Interval, IntervalTypeSpecifier, ListTypeSpecifier, @@ -137,7 +138,7 @@ describe('guessSpecifierType', () => { type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Integer' } as NamedTypeSpecifier); - expect(guessSpecifierType(3.14)).toEqual({ + expect(guessSpecifierType(Decimal.from('3.14'))).toEqual({ type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Decimal' } as NamedTypeSpecifier); @@ -178,7 +179,7 @@ describe('guessSpecifierType', () => { }); it('returns the correct type for Uncertainty values', () => { - const spec = guessSpecifierType(new Uncertainty(1.5, 2.5))!; + const spec = guessSpecifierType(new Uncertainty(Decimal.from(1.5), Decimal.from(2.5)))!; expect(spec).toEqual({ type: 'NamedTypeSpecifier', name: '{urn:hl7-org:elm-types:r1}Decimal' @@ -194,7 +195,7 @@ describe('guessSpecifierType', () => { }); it('returns ListTypeSpecifier with Choice for arrays with mixed types', () => { - const spec = guessSpecifierType([1, 2.5, true])!; + const spec = guessSpecifierType([1, Decimal.from(2.5), true])!; expect(spec).toEqual({ type: 'ListTypeSpecifier', elementType: { From fdf0c52457b813943d226ef044b22b754c1932d6 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 11:53:34 -0400 Subject: [PATCH 08/62] clean up some TODOs --- src/datatypes/decimal.ts | 12 +++--- src/datatypes/interval.ts | 11 +---- src/datatypes/quantity.ts | 5 +-- src/elm/aggregate.ts | 24 +++++++---- src/elm/arithmetic.ts | 59 +++++++++++--------------- src/elm/interval.ts | 50 +++++++++++++--------- src/util/math.ts | 36 ++++++++-------- test/elm/arithmetic/arithmetic-test.ts | 5 +-- 8 files changed, 99 insertions(+), 103 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 8e77a9e38..53c6b66e5 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -9,7 +9,7 @@ export type DecimalInput = Decimal | string | number | bigint; export type DecimalRoundingMode = DecimalJS.Rounding; -const MIN_FLOAT_PRECISION_VALUE = DecimalJS.pow(10, -8); +const MIN_PRECISION_VALUE = DecimalJS.pow(10, -8); const CQL_IMPLICIT_SCALE = 8; const CQL_IMPLICIT_ROUNDING = DecimalJS.ROUND_HALF_UP; @@ -43,6 +43,8 @@ export class Decimal { return this.setScale(CQL_IMPLICIT_SCALE, CQL_IMPLICIT_ROUNDING); } + // Helper function to reduce repeated boilerplate. + // Apply the given function with the given operand, and wrap the result in a Decimal. private applyWrapper(operation: (value: any) => DecimalJS, other: DecimalInput): Decimal { const operand = other instanceof Decimal ? other.value : other; @@ -104,11 +106,11 @@ export class Decimal { } successor() { - return new Decimal(this.value.add(MIN_FLOAT_PRECISION_VALUE)); + return new Decimal(this.value.add(MIN_PRECISION_VALUE)); } predecessor() { - return new Decimal(this.value.minus(MIN_FLOAT_PRECISION_VALUE)); + return new Decimal(this.value.minus(MIN_PRECISION_VALUE)); } negate() { @@ -186,8 +188,8 @@ export class Decimal { } toLong() { - // TODO - return BigInt(this.toString()); + // note that this is permissive and converts non-integral values + return BigInt(this.value.truncated().toString()); } toString() { diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index 06045d031..2ec03243e 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -21,7 +21,6 @@ import { ELM_ANY_TYPE } from '../util/elmTypes'; import { Quantity } from './quantity'; -import { Decimal, MIN_DECIMAL_VALUE } from './decimal'; export class Interval { constructor( @@ -703,15 +702,7 @@ export class Interval { // https://cql.hl7.org/R2/09-b-cqlreference.html#size getPointSize() { // "... point-size is determined by successor of minimum T - minimum T" - let minValue = minValueForType(this.pointType, getQuantityInstanceForMinMax(this)); - - // due to floating point issues in JS, we must use 0.0 for Decimal/Quantity instead of min - // TODO: remove this when changing to decimal.js - if (minValue === MIN_DECIMAL_VALUE) { - minValue = Decimal.from(0.0); - } else if ((minValue as any)?.isQuantity) { - minValue = new Quantity(0.0, (minValue as Quantity)?.unit); - } + const minValue = minValueForType(this.pointType, getQuantityInstanceForMinMax(this)); if (minValue != null) { if ((minValue as any).isDate || (minValue as any).isDatetime || (minValue as any).isTime) { diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index d62110136..190cc1e4e 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -1,4 +1,3 @@ -import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; import { add, subtract, isValidDecimal, overflowsOrUnderflows } from '../util/math'; import { Decimal } from './decimal'; import { @@ -135,7 +134,7 @@ export class Quantity { const resultUnit = getQuotientOfUnits(unit1, unit2); // Check for invalid unit or value - if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { + if (resultUnit == null || overflowsOrUnderflows(resultValue)) { return null; } return new Quantity(resultValue, resultUnit); @@ -159,7 +158,7 @@ export class Quantity { const resultUnit = getProductOfUnits(unit1, unit2); // Check for invalid unit or value - if (resultUnit == null || overflowsOrUnderflows(resultValue, ELM_DECIMAL_TYPE)) { + if (resultUnit == null || overflowsOrUnderflows(resultValue)) { return null; } return new Quantity(resultValue, resultUnit); diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 56ec1c620..7d233f2ed 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -7,7 +7,6 @@ import { Exception } from '../datatypes/exception'; import { greaterThan, lessThan } from '../util/comparison'; import { build } from './builder'; import { overflowsOrUnderflows, finalizeNumericResult } from '../util/math'; -import { ELM_DECIMAL_TYPE } from '../util/elmTypes'; class AggregateExpression extends Expression { source: any; @@ -55,7 +54,7 @@ export class Sum extends AggregateExpression { if (hasOnlyQuantities(items)) { const sum = sumOfDecimals(getValuesFromQuantities(items)); - return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : new Quantity(sum, items[0].unit); + return overflowsOrUnderflows(sum) ? null : new Quantity(sum, items[0].unit); } else { let sum; if (hasDecimals(items)) { @@ -64,7 +63,7 @@ export class Sum extends AggregateExpression { sum = items.reduce((x: any, y: any) => x + y); } sum = finalizeNumericResult(sum); - return overflowsOrUnderflows(sum, this.resultTypeName) ? null : sum; + return overflowsOrUnderflows(sum) ? null : sum; } } } @@ -290,10 +289,13 @@ export class StdDev extends AggregateExpression { if (hasOnlyQuantities(items)) { const values = getValuesFromQuantities(items); const stdDev = this.standardDeviation(values); + if (stdDev === null) { + return null; + } return new Quantity(stdDev, items[0].unit); } else { const standardDeviation = this.standardDeviation(items.map(Decimal.from)); - return standardDeviation?.normalized(); // TODO: review function signatures. always return Decimal makes sense but is it correct? + return standardDeviation?.normalized(); } } @@ -305,6 +307,14 @@ export class StdDev extends AggregateExpression { } stats(list: Decimal[]) { + if (list.length === 1) { + return { + standard_variance: null, + population_variance: Decimal.from(0), + standard_deviation: null, + population_deviation: Decimal.from(0) + }; + } const sum = list.reduce((x, y) => x.add(y), Decimal.from(0)); const mean = sum.divideBy(list.length); @@ -349,9 +359,7 @@ export class Product extends AggregateExpression { if (hasOnlyQuantities(items)) { const product = productOfDecimals(getValuesFromQuantities(items)); // Units are not multiplied for the geometric product - return overflowsOrUnderflows(product, ELM_DECIMAL_TYPE) - ? null - : new Quantity(product, items[0].unit); + return overflowsOrUnderflows(product) ? null : new Quantity(product, items[0].unit); } else { let result; if (hasDecimals(items)) { @@ -360,7 +368,7 @@ export class Product extends AggregateExpression { result = items.reduce((x: number, y: number) => x * y); } result = finalizeNumericResult(result); - return overflowsOrUnderflows(result, this.resultTypeName) ? null : result; + return overflowsOrUnderflows(result) ? null : result; } } } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index 3b3170384..72f00c8be 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -91,7 +91,7 @@ export class Multiply extends Expression { product = MathUtil.multiply(x, y); } - if (MathUtil.overflowsOrUnderflows(product, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(product)) { return null; } @@ -123,7 +123,6 @@ export class Divide extends Expression { quotient = doDivision(x, y); } else if (x.isUncertainty && y.isUncertainty) { let low, high; - // TODO change this section back if (x.low.isQuantity) { low = doDivision(x.low, y.high); high = doDivision(x.high, y.low); @@ -140,7 +139,7 @@ export class Divide extends Expression { return null; } - if (MathUtil.overflowsOrUnderflows(quotient, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(quotient)) { return null; } return MathUtil.finalizeNumericResult(quotient, this.resultTypeName); @@ -177,7 +176,7 @@ export class TruncatedDivide extends Expression { } } - if (MathUtil.overflowsOrUnderflows(quotient, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(quotient)) { return null; } return quotient; @@ -265,19 +264,13 @@ export class Abs extends Expression { return new Quantity(arg.value.abs(), arg.unit); } else if (typeof arg === 'bigint') { const absoluteValue = arg < 0n ? -arg : arg; - return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) - ? null - : absoluteValue; + return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; } else if (arg.isDecimal) { const absoluteValue = arg.abs(); - return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) - ? null - : absoluteValue; + return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; } else { const absoluteValue = Math.abs(arg); - return MathUtil.overflowsOrUnderflows(absoluteValue, this.resultTypeName) - ? null - : absoluteValue; + return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; } } } @@ -295,19 +288,13 @@ export class Negate extends Expression { return new Quantity(arg.value.negate(), arg.unit); } else if (typeof arg === 'bigint') { const negatedValue = arg * -1n; - return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) - ? null - : negatedValue; + return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; } else if (arg.isDecimal) { const negatedValue = arg.negate(); - return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) - ? null - : negatedValue; + return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; } else { const negatedValue = arg * -1; - return MathUtil.overflowsOrUnderflows(negatedValue, this.resultTypeName) - ? null - : negatedValue; + return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; } } } @@ -343,8 +330,11 @@ export class Ln extends Expression { } try { - const ln = Decimal.from(arg).ln().normalized(); - return MathUtil.decimalOrNull(ln); + const ln = Decimal.from(arg).ln(); + if (MathUtil.overflowsOrUnderflows(ln)) { + return null; + } + return MathUtil.finalizeNumericResult(ln); } catch { return null; } @@ -369,10 +359,10 @@ export class Exp extends Expression { return null; } - if (MathUtil.overflowsOrUnderflows(power, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(power)) { return null; } - return power; + return MathUtil.finalizeNumericResult(power); } } @@ -389,7 +379,7 @@ export class Log extends Expression { try { const log = Decimal.from(args[0]).log(args[1]); - return MathUtil.decimalOrNull(log); + return MathUtil.finalizeNumericResult(log); } catch { return null; } @@ -406,14 +396,13 @@ export class Power extends Expression { if (args == null || args.some((x: any) => x == null)) { return null; } - // TODO: cql spec shows the return type is always Decimal, but that's not true - const [x, y] = args; - const power = doPower(x, y); - // Note: The resultTypeName may be wrong if the exponent is a negative number. Math.overflowsOrUnderflows - // already accounts for this possibility by only considering it an integer if Number.isInteger(value). + // Note: The resultTypeName may be wrong if the exponent is a negative number. // E.g., CQL-to-ELM says 10^-1 is an Integer result type, but the correct result is a 0.1 (a Decimal) - if (MathUtil.overflowsOrUnderflows(power, this.resultTypeName)) { + // doPower handles this scenario + const power = doPower(args[0], args[1]); + + if (MathUtil.overflowsOrUnderflows(power)) { return null; } return power; @@ -525,7 +514,7 @@ export class Successor extends Expression { } } - if (MathUtil.overflowsOrUnderflows(successor, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(successor)) { return null; } return successor; @@ -554,7 +543,7 @@ export class Predecessor extends Expression { } } - if (MathUtil.overflowsOrUnderflows(predecessor, this.resultTypeName)) { + if (MathUtil.overflowsOrUnderflows(predecessor)) { return null; } return predecessor; diff --git a/src/elm/interval.ts b/src/elm/interval.ts index c3c4922d2..b48b26775 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -2,7 +2,7 @@ import { Expression } from './expression'; import { MAX_DATETIME_VALUE, MIN_DATETIME_VALUE } from '../datatypes/datetime'; import { Quantity } from '../datatypes/quantity'; import { add, successor, predecessor, subtract } from '../util/math'; -import { greaterThan, lessThan, lessThanOrEquals } from '../util/comparison'; +import { greaterThan, lessThan } from '../util/comparison'; import { convertUnit, compareUnits, convertToCQLDateUnit } from '../util/units'; import * as dtivl from '../datatypes/interval'; import { Context } from '../runtime/context'; @@ -10,6 +10,7 @@ import { build } from './builder'; import { IntervalTypeSpecifier, NamedTypeSpecifier } from '../types/type-specifiers.interfaces'; import { ELM_ANY_TYPE, ELM_NAMED_TYPE_SPECIFIER } from '../util/elmTypes'; import { Decimal } from '../datatypes/decimal'; +import { MAX_INT_VALUE, MIN_INT_VALUE } from '../util/limits'; export class Interval extends Expression { lowClosed: boolean; @@ -670,27 +671,38 @@ export class Expand extends Expression { const decimalPrecision = perIsIntegral ? 0 : 8; // For the purposes of this function, we'll perform all the arithmetic using Decimals, - // then convert the results back to the required type if necessary - let makeInterval: (l: Decimal, h: Decimal) => dtivl.Interval; + // then convert the results back to the required type as necessary + const origLow = low; + const origHigh = high; + + low = Decimal.from(low); + high = Decimal.from(high); + + let convertBound: (d: Decimal) => Decimal | number | bigint = d => d.toInteger(); if (!perIsIntegral) { // If per is not an integer value, then regardless of the original point types, the values will be Decimals - makeInterval = (l: Decimal, h: Decimal) => new dtivl.Interval(l, h, true, true); - } else if (typeof low === 'bigint' || typeof high === 'bigint') { - makeInterval = (l: Decimal, h: Decimal) => - new dtivl.Interval(l.toLong(), h.toLong(), true, true); - } else if (typeof low === 'number' || typeof high === 'number') { - makeInterval = (l: Decimal, h: Decimal) => - new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); + convertBound = d => d; + } else if (typeof origLow === 'bigint' || typeof origHigh === 'bigint') { + convertBound = d => d.toLong(); + } else if (typeof origLow === 'number' || typeof origHigh === 'number') { + convertBound = d => d.toInteger(); } else { // per is an integer but the original bounds of the interval were Decimal. - // TODO: for now just make them integers - makeInterval = (l: Decimal, h: Decimal) => - new dtivl.Interval(l.toInteger(), h.toInteger(), true, true); + // Make the resulting intervals either Long or Integer based on the original bounds. + if ( + low.lessThan(MIN_INT_VALUE) || + low.greaterThan(MAX_INT_VALUE) || + high.lessThan(MIN_INT_VALUE) || + high.greaterThan(MAX_INT_VALUE) + ) { + convertBound = d => d.toLong(); + } else { + convertBound = d => d.toInteger(); + } } - // treat everything as a Decimal, convert back later if needed - low = Decimal.from(low); - high = Decimal.from(high); + const makeInterval = (l: Decimal, h: Decimal) => + new dtivl.Interval(convertBound(l), convertBound(h), true, true); // If the interval boundaries are more precise than the per quantity, the // more precise values will be truncated to the precision specified by the @@ -842,11 +854,7 @@ function collapseIntervals(intervals: any, perWidth: any) { } } else { const distance = subtract(b.low, a.high); - // TODO: perWidth.value is a Decimal, but distance could be anything - // lessThanOrEquals requires that its args be the same type - // so I guess for now, make distance a Decimal - const distanceDecimal = Decimal.from(distance); - const withinPerWidth = lessThanOrEquals(distanceDecimal, perWidth.value); + const withinPerWidth = perWidth.value.greaterThanOrEquals(distance); if (withinPerWidth) { if (greaterThan(b.high, a.high) || b.high == null) { a.high = b.high; diff --git a/src/util/math.ts b/src/util/math.ts index 62216c002..06d9dcb4f 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -24,7 +24,7 @@ import { import { MAX_INT_VALUE, MAX_LONG_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from './limits'; import { convertToCQLDateUnit, normalizeUnitsWhenPossible } from './units'; -export function overflowsOrUnderflows(value: any, type?: string): boolean { +export function overflowsOrUnderflows(value: any): boolean { if (value == null) { return false; } @@ -66,7 +66,7 @@ export function overflowsOrUnderflows(value: any, type?: string): boolean { return true; } } else if (value.isUncertainty) { - return overflowsOrUnderflows(value.low, type) || overflowsOrUnderflows(value.high, type); + return overflowsOrUnderflows(value.low) || overflowsOrUnderflows(value.high); } return false; } @@ -126,15 +126,15 @@ export function add(a: any, b: any, type?: string): any { if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { const sum = Decimal.from(a).add(Decimal.from(b)); - return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : sum; + return overflowsOrUnderflows(sum) ? null : sum; } if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { const sum = BigInt(a) + BigInt(b); - return overflowsOrUnderflows(sum, ELM_LONG_TYPE) ? null : sum; + return overflowsOrUnderflows(sum) ? null : sum; } if (typeof a === 'number' && typeof b === 'number') { const sum = a + b; - return overflowsOrUnderflows(sum, ELM_INTEGER_TYPE) ? null : sum; + return overflowsOrUnderflows(sum) ? null : sum; } if (a?.isQuantity && b?.isQuantity) { const [aValue, aUnit, bValue, bUnit] = normalizeUnitsWhenPossible( @@ -147,7 +147,7 @@ export function add(a: any, b: any, type?: string): any { return null; } const sum = aValue.add(bValue); - return overflowsOrUnderflows(sum, ELM_DECIMAL_TYPE) ? null : new Quantity(sum, aUnit); + return overflowsOrUnderflows(sum) ? null : new Quantity(sum, aUnit); } if (b?.isQuantity && (a?.isDate || a?.isDateTime || (a?.isTime && a.isTime()))) { const unit = convertToCQLDateUnit(b.unit) || b.unit; @@ -188,15 +188,15 @@ export function subtract(a: any, b: any, type?: string): any { export function multiply(a: any, b: any, type?: string) { if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { const product = Decimal.from(a).multiplyBy(b); - return overflowsOrUnderflows(product, ELM_DECIMAL_TYPE) ? null : product; + return overflowsOrUnderflows(product) ? null : product; } if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { const product = BigInt(a) * BigInt(b); - return overflowsOrUnderflows(product, ELM_LONG_TYPE) ? null : product; + return overflowsOrUnderflows(product) ? null : product; } if (typeof a === 'number' && typeof b === 'number') { const product = a * b; - return overflowsOrUnderflows(product, ELM_INTEGER_TYPE) ? null : product; + return overflowsOrUnderflows(product) ? null : product; } throw new Error('Unsupported argument types.'); @@ -209,7 +209,7 @@ export function divide(a: any, b: any, type?: string) { return null; } const quotient = Decimal.from(a).divideBy(b); - return overflowsOrUnderflows(quotient, ELM_DECIMAL_TYPE) ? null : quotient; + return overflowsOrUnderflows(quotient) ? null : quotient; } if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { if (b === 0 || b === 0n) { @@ -217,7 +217,7 @@ export function divide(a: any, b: any, type?: string) { } // BigInt division is inherently truncated, eg 10n / 3n = 3n const quotient = BigInt(a) / BigInt(b); - return overflowsOrUnderflows(quotient, ELM_LONG_TYPE) ? null : quotient; + return overflowsOrUnderflows(quotient) ? null : quotient; } if (typeof a === 'number' && typeof b === 'number') { if (b === 0) { @@ -225,7 +225,7 @@ export function divide(a: any, b: any, type?: string) { } // here we need to truncate manually to ensure the value is an integer const quotient = Math.trunc(a / b); - return overflowsOrUnderflows(quotient, ELM_INTEGER_TYPE) ? null : quotient; + return overflowsOrUnderflows(quotient) ? null : quotient; } throw new Error('Unsupported argument types.'); @@ -254,7 +254,7 @@ export function limitDecimalPrecision< export class OverFlowException extends Exception {} -export function successor(val: any, type?: string, precision?: string): any { +export function successor(val: any, _type?: string, precision?: string): any { if (typeof val === 'number') { if (val >= MAX_INT_VALUE) { throw new OverFlowException(); @@ -295,12 +295,12 @@ export function successor(val: any, type?: string, precision?: string): any { // For uncertainties, if the high is the max val, don't increment it const high = (() => { try { - return successor(val.high, type, precision); + return successor(val.high, undefined, precision); } catch { return val.high; } })(); - return new Uncertainty(successor(val.low, type, precision), high); + return new Uncertainty(successor(val.low, undefined, precision), high); } else if (val && val.isQuantity) { const succ = val.clone(); succ.value = successor(val.value, ELM_DECIMAL_TYPE); @@ -310,7 +310,7 @@ export function successor(val: any, type?: string, precision?: string): any { } } -export function predecessor(val: any, type?: string, precision?: string): any { +export function predecessor(val: any, _type?: string, precision?: string): any { if (typeof val === 'number') { if (val <= MIN_INT_VALUE) { throw new OverFlowException(); @@ -351,12 +351,12 @@ export function predecessor(val: any, type?: string, precision?: string): any { // For uncertainties, if the low is the min val, don't decrement it const low = ((): any => { try { - return predecessor(val.low, type, precision); + return predecessor(val.low, undefined, precision); } catch { return val.low; } })(); - return new Uncertainty(low, predecessor(val.high, type, precision)); + return new Uncertainty(low, predecessor(val.high, undefined, precision)); } else if (val && val.isQuantity) { const pred = val.clone(); pred.value = predecessor(val.value, ELM_DECIMAL_TYPE); diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 1671c64c5..b05c6b580 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -345,9 +345,8 @@ describe('Power', () => { should(await this.twoLongExpMaxLong.exec(this.ctx)).be.null(); }); - // TODO: Unskip this test when we properly handle negative Long exponents that can't be safely converted to Number - it.skip('should return an infinitesimally small number when the exponent is the minimum Long value', async function () { - (await this.twoLongExpMinLong.exec(this.ctx)).should.be(0.0); + it('should return an infinitesimally small number when the exponent is the minimum Long value', async function () { + (await this.twoLongExpMinLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.0)); }); }); From d66fad57286a42ae8935c99c4f4171d9353ee101 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 11:57:21 -0400 Subject: [PATCH 09/62] remove now-unnecessary param in successor/predecessor --- src/datatypes/interval.ts | 21 +++++++++------------ src/elm/arithmetic.ts | 4 ++-- src/util/math.ts | 16 ++++++++-------- test/util/math-test.ts | 19 ++++++------------- 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index 2ec03243e..120b0b31d 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -518,10 +518,10 @@ export class Interval { this.pointType === ELM_DATETIME_TYPE || this.pointType === ELM_TIME_TYPE ) { - return this.start()?.sameAs(successor(other.end(), other.pointType, precision), precision); + return this.start()?.sameAs(successor(other.end(), precision), precision); } - return cmp.equals(this.start(), successor(other.end(), other.pointType)); + return cmp.equals(this.start(), successor(other.end())); } catch { return false; } @@ -543,13 +543,10 @@ export class Interval { this.pointType === ELM_DATETIME_TYPE || this.pointType === ELM_TIME_TYPE ) { - return this.end()?.sameAs( - predecessor(other.start(), other.pointType, precision), - precision - ); + return this.end()?.sameAs(predecessor(other.start(), precision), precision); } - return cmp.equals(this.end(), predecessor(other.start(), other.pointType)); + return cmp.equals(this.end(), predecessor(other.start())); } catch { return false; } @@ -577,7 +574,7 @@ export class Interval { // "If the low boundary of the interval is closed and non-null, this operator returns the low // value of the interval... If the low boundary of the interval is open and non-null, this // operator returns the successor of the low value of the interval." - return this.lowClosed ? this.low : successor(this.low, this.pointType); + return this.lowClosed ? this.low : successor(this.low); } // https://cql.hl7.org/R2/09-b-cqlreference.html#end @@ -602,7 +599,7 @@ export class Interval { // "If the high boundary of the interval is closed and non-null, this operator returns the high // value of the interval... If the high boundary of the interval is open and non-null, this // operator returns the predecessor of the high value of the interval." - return this.highClosed ? this.high : predecessor(this.high, this.pointType); + return this.highClosed ? this.high : predecessor(this.high); } // https://cql.hl7.org/R2/09-b-cqlreference.html#starts @@ -712,7 +709,7 @@ export class Interval { // E.g., point size of Interval[@2012-01, @2012-12] is 1 month, not 1 ms. return new Quantity(1, (this.low ?? this.high).getPrecision()); } - return subtract(successor(minValue, this.pointType), minValue, this.pointType); + return subtract(successor(minValue), minValue, this.pointType); } throw new Error('Point type of interval cannot be determined.'); @@ -743,7 +740,7 @@ export class Interval { if (this.lowClosed && this.low == null) { low = minValueForType(this.pointType, quantityInstance); } else if (!this.lowClosed && this.low != null) { - low = successor(this.low, this.pointType); + low = successor(this.low); } else { low = this.low; } @@ -751,7 +748,7 @@ export class Interval { if (this.highClosed && this.high == null) { high = maxValueForType(this.pointType, quantityInstance); } else if (!this.highClosed && this.high != null) { - high = predecessor(this.high, this.pointType); + high = predecessor(this.high); } else { high = this.high; } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index 72f00c8be..2c3b85e9b 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -507,7 +507,7 @@ export class Successor extends Expression { try { // MathUtil.successor throws on overflow, and the exception is used in // the logic for evaluating `meets`, so it can't be changed to just return null - successor = MathUtil.successor(arg, this.resultTypeName); + successor = MathUtil.successor(arg); } catch (e) { if (e instanceof MathUtil.OverFlowException) { return null; @@ -536,7 +536,7 @@ export class Predecessor extends Expression { try { // MathUtil.predecessor throws on underflow, and the exception is used in // the logic for evaluating `meets`, so it can't be changed to just return null - predecessor = MathUtil.predecessor(arg, this.resultTypeName); + predecessor = MathUtil.predecessor(arg); } catch (e) { if (e instanceof MathUtil.OverFlowException) { return null; diff --git a/src/util/math.ts b/src/util/math.ts index 06d9dcb4f..365a749b8 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -254,7 +254,7 @@ export function limitDecimalPrecision< export class OverFlowException extends Exception {} -export function successor(val: any, _type?: string, precision?: string): any { +export function successor(val: any, precision?: string): any { if (typeof val === 'number') { if (val >= MAX_INT_VALUE) { throw new OverFlowException(); @@ -295,22 +295,22 @@ export function successor(val: any, _type?: string, precision?: string): any { // For uncertainties, if the high is the max val, don't increment it const high = (() => { try { - return successor(val.high, undefined, precision); + return successor(val.high, precision); } catch { return val.high; } })(); - return new Uncertainty(successor(val.low, undefined, precision), high); + return new Uncertainty(successor(val.low, precision), high); } else if (val && val.isQuantity) { const succ = val.clone(); - succ.value = successor(val.value, ELM_DECIMAL_TYPE); + succ.value = successor(val.value); return succ; } else if (val == null) { return null; } } -export function predecessor(val: any, _type?: string, precision?: string): any { +export function predecessor(val: any, precision?: string): any { if (typeof val === 'number') { if (val <= MIN_INT_VALUE) { throw new OverFlowException(); @@ -351,15 +351,15 @@ export function predecessor(val: any, _type?: string, precision?: string): any { // For uncertainties, if the low is the min val, don't decrement it const low = ((): any => { try { - return predecessor(val.low, undefined, precision); + return predecessor(val.low, precision); } catch { return val.low; } })(); - return new Uncertainty(low, predecessor(val.high, undefined, precision)); + return new Uncertainty(low, predecessor(val.high, precision)); } else if (val && val.isQuantity) { const pred = val.clone(); - pred.value = predecessor(val.value, ELM_DECIMAL_TYPE); + pred.value = predecessor(val.value); return pred; } else if (val == null) { return null; diff --git a/test/util/math-test.ts b/test/util/math-test.ts index 5071fd60d..a6e6d3629 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -2,48 +2,41 @@ import { Uncertainty } from '../../src/datatypes/uncertainty'; import { MAX_FLOAT_VALUE, MIN_FLOAT_VALUE } from '../../src/util/limits'; import { Decimal } from '../../src/datatypes/decimal'; import { predecessor, successor } from '../../src/util/math'; -import { ELM_DECIMAL_TYPE, ELM_INTEGER_TYPE } from '../../src/util/elmTypes'; describe('successor', () => { it('should preserve integers in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0), ELM_INTEGER_TYPE); + const result = successor(new Uncertainty(1.0, 2.0)); result.low.should.equal(2); result.high.should.equal(3); }); it('should preserve decimals in an Uncertainty', () => { - const result = successor( - new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), - ELM_DECIMAL_TYPE - ); + const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); result.low.should.equalDecimal(Decimal.from(1.00000001)); result.high.should.equalDecimal(Decimal.from(2.00000001)); }); it('should leave the uncertainty high unchanged when it overflows', () => { - const result = successor(new Uncertainty(Decimal.from(1), MAX_FLOAT_VALUE), ELM_DECIMAL_TYPE); + const result = successor(new Uncertainty(Decimal.from(1), MAX_FLOAT_VALUE)); result.should.eql(new Uncertainty(Decimal.from(1.00000001), MAX_FLOAT_VALUE)); }); }); describe('predecessor', () => { it('should preserve integers in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0), ELM_INTEGER_TYPE); + const result = successor(new Uncertainty(1.0, 2.0)); result.low.should.equal(2); result.high.should.equal(3); }); it('should preserve decimals in an Uncertainty', () => { - const result = successor( - new Uncertainty(Decimal.from(1.0), Decimal.from(2.0)), - ELM_DECIMAL_TYPE - ); + const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); result.low.should.equalDecimal(Decimal.from(1.00000001)); result.high.should.equalDecimal(Decimal.from(2.00000001)); }); it('should leave the uncertainty low unchanged when it underflows', () => { - const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(2)), ELM_DECIMAL_TYPE); + const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(2))); result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(1.99999999))); }); }); From cb3c83f7602b8dacbda696b076e7cfc30ca056ea Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 15:15:26 -0400 Subject: [PATCH 10/62] additional cleanup and fixes --- src/datatypes/decimal.ts | 28 ++-- src/elm/aggregate.ts | 120 +++++++++--------- src/elm/arithmetic.ts | 89 ++++++------- src/elm/interval.ts | 45 ++----- src/elm/type.ts | 30 +++++ src/util/math.ts | 25 ++-- test/datatypes/decimal-test.ts | 6 +- test/elm/convert/convert-test.ts | 10 +- test/elm/convert/data.cql | 2 +- test/elm/convert/data.js | 6 +- test/elm/instance/instance-test.ts | 4 +- test/elm/interval/interval-test.ts | 46 +++---- .../spec-tests/cql/CqlStringOperatorsTest.cql | 4 +- .../cql/CqlStringOperatorsTest.json | 53 +------- test/spec-tests/skip-list.txt | 1 + 15 files changed, 201 insertions(+), 268 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 53c6b66e5..5d0a99ec0 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -64,15 +64,14 @@ export class Decimal { } divideBy(other: DecimalInput): Decimal { - if (toNumber(other) === 0) { + if (Decimal.from(other).equals(0)) { throw new RangeError('Cannot divide a decimal by zero'); } return this.applyWrapper(this.value.dividedBy, other); } modulo(other: DecimalInput) { - const divisor = toNumber(other); - if (divisor === 0) { + if (Decimal.from(other).equals(0)) { throw new RangeError('Cannot calculate decimal modulo by zero'); } return this.applyWrapper(this.value.mod, other); @@ -180,6 +179,7 @@ export class Decimal { } toInteger() { + // note that this is permissive and converts non-integral values return this.truncate(); } @@ -193,7 +193,16 @@ export class Decimal { } toString() { - return this.value.toString(); + // decimal.js toString can return exponential notation, + // toFixed always returns normal notation + // CQL spec expects format (-)?#0.0# + // https://cql.hl7.org/R2/09-b-cqlreference.html#tostring + // meaning, optional minus sign, at least one digit, decimal point, at least one digit + // (# means any number of digits, including none; 0 means a digit must appear) + // a regex for this is -?\d+\.\d+ + // so Decimal.from(1).toString() --> "1.0" + const places = Math.max(1, this.value.decimalPlaces()); + return this.value.toFixed(places); } toJSON() { @@ -206,14 +215,3 @@ export const MIN_DECIMAL_STRING = '-99999999999999999999.99999999'; export const MAX_DECIMAL_VALUE = Decimal.from(MAX_DECIMAL_STRING); export const MIN_DECIMAL_VALUE = Decimal.from(MIN_DECIMAL_STRING); - -function toNumber(value: DecimalInput) { - if (value instanceof Decimal) { - return value.toNumber(); - } - if (typeof value === 'string' && value.trim() === '') { - // Number() and Number('') return 0 instead of NaN, so catch that case - return NaN; - } - return Number(value); -} diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 7d233f2ed..fe72381f7 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -1,12 +1,25 @@ import { Expression } from './expression'; -import { typeIsArray, allTrue, anyTrue, removeNulls, numerical_sort } from '../util/util'; -import { Quantity } from '../datatypes/datatypes'; +import { typeIsArray, allTrue, anyTrue, removeNulls } from '../util/util'; +import { doAddition, Quantity } from '../datatypes/datatypes'; import { Decimal } from '../datatypes/decimal'; import { Context } from '../runtime/context'; import { Exception } from '../datatypes/exception'; import { greaterThan, lessThan } from '../util/comparison'; import { build } from './builder'; -import { overflowsOrUnderflows, finalizeNumericResult } from '../util/math'; +import * as MathUtil from '../util/math'; + +function finalizeAggregateResult(result: any, firstItem: any) { + if (result == null) { + return null; + } + const finalized = MathUtil.finalizeNumericResult(result); + const bounded = MathUtil.overflowsOrUnderflows(finalized) ? null : finalized; + if (bounded && firstItem instanceof Quantity && !(bounded instanceof Quantity)) { + return new Quantity(bounded, firstItem.unit); + } else { + return bounded; + } +} class AggregateExpression extends Expression { source: any; @@ -52,19 +65,18 @@ export class Sum extends AggregateExpression { return null; } + let sum; if (hasOnlyQuantities(items)) { - const sum = sumOfDecimals(getValuesFromQuantities(items)); - return overflowsOrUnderflows(sum) ? null : new Quantity(sum, items[0].unit); + // note doAddition is Quantity addition + sum = items.reduce(doAddition); } else { - let sum; if (hasDecimals(items)) { sum = sumOfDecimals(items.map(Decimal.from)); } else { sum = items.reduce((x: any, y: any) => x + y); } - sum = finalizeNumericResult(sum); - return overflowsOrUnderflows(sum) ? null : sum; } + return finalizeAggregateResult(sum, items[0]); } } @@ -157,13 +169,17 @@ export class Avg extends AggregateExpression { return null; } + let decimals; if (hasOnlyQuantities(items)) { - const sum = sumOfDecimals(getValuesFromQuantities(items)); - return new Quantity(sum.divideBy(items.length), items[0].unit); + decimals = getValuesFromQuantities(items); } else { // return type is always Decimal, so just map everything to Decimals - return sumOfDecimals(items.map(Decimal.from)).divideBy(items.length).normalized(); + decimals = items.map(Decimal.from); } + const sum = sumOfDecimals(decimals); + const avg = finalizeAggregateResult(sum.divideBy(items.length), items[0]); + + return finalizeAggregateResult(avg, items[0]); } } @@ -187,17 +203,22 @@ export class Median extends AggregateExpression { return null; } + let decimals; if (hasOnlyQuantities(items)) { - const median = medianOfDecimals(getValuesFromQuantities(items)); - return new Quantity(median, items[0].unit); + decimals = getValuesFromQuantities(items); + } else { + // Note that the Median signature is Median(argument List) Decimal + // because median on a list of even number of items takes the average of the 2 middle items + // so we can treat all the input as decimals + decimals = items.map(Decimal.from); } - if (hasDecimals(items)) { - const decimals = items.map(Decimal.from); - return finalizeNumericResult(medianOfDecimals(decimals)); - } + const sorted = [...decimals].sort((a, b) => a.compareTo(b)); + const middle = Math.floor(items.length / 2); + const median = + items.length % 2 === 1 ? sorted[middle] : sorted[middle - 1].add(sorted[middle]).divideBy(2); - return medianOfNumbers(items); + return finalizeAggregateResult(median, items[0]); } } @@ -285,18 +306,15 @@ export class StdDev extends AggregateExpression { if (items.length === 0) { return null; } - + let values; if (hasOnlyQuantities(items)) { - const values = getValuesFromQuantities(items); - const stdDev = this.standardDeviation(values); - if (stdDev === null) { - return null; - } - return new Quantity(stdDev, items[0].unit); + values = getValuesFromQuantities(items); } else { - const standardDeviation = this.standardDeviation(items.map(Decimal.from)); - return standardDeviation?.normalized(); + values = items.map(Decimal.from); } + + const stdDev = this.standardDeviation(values); + return finalizeAggregateResult(stdDev, items[0]); } standardDeviation(list: Decimal[]) { @@ -356,20 +374,16 @@ export class Product extends AggregateExpression { return null; } + let product; if (hasOnlyQuantities(items)) { - const product = productOfDecimals(getValuesFromQuantities(items)); - // Units are not multiplied for the geometric product - return overflowsOrUnderflows(product) ? null : new Quantity(product, items[0].unit); + product = productOfDecimals(getValuesFromQuantities(items)); + } else if (hasDecimals(items)) { + product = productOfDecimals(items.map(Decimal.from)); } else { - let result; - if (hasDecimals(items)) { - result = productOfDecimals(items.map(Decimal.from)); - } else { - result = items.reduce((x: number, y: number) => x * y); - } - result = finalizeNumericResult(result); - return overflowsOrUnderflows(result) ? null : result; + product = items.reduce((x: number, y: number) => x * y); } + + return finalizeAggregateResult(product, items[0]); } } @@ -394,15 +408,16 @@ export class GeometricMean extends AggregateExpression { return null; } + let decimals; if (hasOnlyQuantities(items)) { - const product = productOfDecimals(getValuesFromQuantities(items)); - const geoMean = product.power(1.0 / items.length); - return new Quantity(geoMean, items[0].unit); + decimals = getValuesFromQuantities(items); } else { - return productOfDecimals(items.map(Decimal.from)) - .power(1.0 / items.length) - .normalized(); + decimals = items.map(Decimal.from); } + const product = productOfDecimals(decimals); + const oneOverLength = Decimal.from(1).divideBy(items.length); + const geoMean = product.power(oneOverLength); + return finalizeAggregateResult(geoMean, items[0]); } } @@ -489,23 +504,6 @@ function convertAllUnits(arr: any[]) { return arr.map(q => q.convertUnit(arr[0].unit)); } -function medianOfNumbers(numbers: number[]) { - const items = numerical_sort(numbers, 'asc'); - if (items.length % 2 === 1) { - // Odd number of items - return items[(items.length - 1) / 2]; - } else { - // Even number of items - return (items[items.length / 2 - 1] + items[items.length / 2]) / 2; - } -} - -function medianOfDecimals(decimals: Decimal[]) { - const items = [...decimals].sort((a, b) => a.compareTo(b)); - const middle = Math.floor(items.length / 2); - return items.length % 2 === 1 ? items[middle] : items[middle - 1].add(items[middle]).divideBy(2); -} - function sumOfDecimals(values: Decimal[]) { return values.reduce((sum, value) => sum.add(value)); } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index 2c3b85e9b..9f37e676a 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -24,6 +24,14 @@ import { } from '../util/elmTypes'; import { MAX_INT_VALUE, MAX_LONG_VALUE, MIN_INT_VALUE, MIN_LONG_VALUE } from '../util/limits'; +function finalizeArithmeticResult(result: T): T | null { + if (result == null) { + return null; + } + const finalized = MathUtil.finalizeNumericResult(result); + return MathUtil.overflowsOrUnderflows(finalized) ? null : finalized; +} + export class Add extends Expression { constructor(json: any) { super(json); @@ -36,7 +44,7 @@ export class Add extends Expression { } const sum = MathUtil.add(args[0], args[1], this.resultTypeName); - return MathUtil.finalizeNumericResult(sum, this.resultTypeName); + return finalizeArithmeticResult(sum); } } @@ -52,7 +60,7 @@ export class Subtract extends Expression { } const difference = MathUtil.subtract(args[0], args[1], this.resultTypeName); - return MathUtil.finalizeNumericResult(difference, this.resultTypeName); + return finalizeArithmeticResult(difference); } } @@ -91,11 +99,7 @@ export class Multiply extends Expression { product = MathUtil.multiply(x, y); } - if (MathUtil.overflowsOrUnderflows(product)) { - return null; - } - - return MathUtil.finalizeNumericResult(product, this.resultTypeName); + return finalizeArithmeticResult(product); } } @@ -139,10 +143,7 @@ export class Divide extends Expression { return null; } - if (MathUtil.overflowsOrUnderflows(quotient)) { - return null; - } - return MathUtil.finalizeNumericResult(quotient, this.resultTypeName); + return finalizeArithmeticResult(quotient); } } @@ -176,10 +177,7 @@ export class TruncatedDivide extends Expression { } } - if (MathUtil.overflowsOrUnderflows(quotient)) { - return null; - } - return quotient; + return finalizeArithmeticResult(quotient); } } @@ -203,7 +201,7 @@ export class Modulo extends Expression { return null; } - return MathUtil.decimalLongOrNull(MathUtil.finalizeNumericResult(modulo, this.resultTypeName)); + return finalizeArithmeticResult(modulo); } } @@ -260,18 +258,18 @@ export class Abs extends Expression { const arg = await this.execArgs(ctx); if (arg == null) { return null; - } else if (arg.isQuantity) { - return new Quantity(arg.value.abs(), arg.unit); + } + let absoluteValue; + if (arg.isQuantity) { + absoluteValue = new Quantity(arg.value.abs(), arg.unit); } else if (typeof arg === 'bigint') { - const absoluteValue = arg < 0n ? -arg : arg; - return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; + absoluteValue = arg < 0n ? -arg : arg; } else if (arg.isDecimal) { - const absoluteValue = arg.abs(); - return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; + absoluteValue = arg.abs(); } else { - const absoluteValue = Math.abs(arg); - return MathUtil.overflowsOrUnderflows(absoluteValue) ? null : absoluteValue; + absoluteValue = Math.abs(arg); } + return finalizeArithmeticResult(absoluteValue); } } @@ -284,18 +282,18 @@ export class Negate extends Expression { const arg = await this.execArgs(ctx); if (arg == null) { return null; - } else if (arg.isQuantity) { - return new Quantity(arg.value.negate(), arg.unit); + } + let negatedValue; + if (arg.isQuantity) { + negatedValue = new Quantity(arg.value.negate(), arg.unit); } else if (typeof arg === 'bigint') { - const negatedValue = arg * -1n; - return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; + negatedValue = arg * -1n; } else if (arg.isDecimal) { - const negatedValue = arg.negate(); - return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; + negatedValue = arg.negate(); } else { - const negatedValue = arg * -1; - return MathUtil.overflowsOrUnderflows(negatedValue) ? null : negatedValue; + negatedValue = arg * -1; } + return finalizeArithmeticResult(negatedValue); } } @@ -331,10 +329,7 @@ export class Ln extends Expression { try { const ln = Decimal.from(arg).ln(); - if (MathUtil.overflowsOrUnderflows(ln)) { - return null; - } - return MathUtil.finalizeNumericResult(ln); + return finalizeArithmeticResult(ln); } catch { return null; } @@ -359,10 +354,7 @@ export class Exp extends Expression { return null; } - if (MathUtil.overflowsOrUnderflows(power)) { - return null; - } - return MathUtil.finalizeNumericResult(power); + return finalizeArithmeticResult(power); } } @@ -379,7 +371,7 @@ export class Log extends Expression { try { const log = Decimal.from(args[0]).log(args[1]); - return MathUtil.finalizeNumericResult(log); + return finalizeArithmeticResult(log); } catch { return null; } @@ -402,10 +394,7 @@ export class Power extends Expression { // doPower handles this scenario const power = doPower(args[0], args[1]); - if (MathUtil.overflowsOrUnderflows(power)) { - return null; - } - return power; + return finalizeArithmeticResult(power); } } @@ -514,10 +503,7 @@ export class Successor extends Expression { } } - if (MathUtil.overflowsOrUnderflows(successor)) { - return null; - } - return successor; + return finalizeArithmeticResult(successor); } } @@ -543,9 +529,6 @@ export class Predecessor extends Expression { } } - if (MathUtil.overflowsOrUnderflows(predecessor)) { - return null; - } - return predecessor; + return finalizeArithmeticResult(predecessor); } } diff --git a/src/elm/interval.ts b/src/elm/interval.ts index b48b26775..cea2cf1a7 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -474,18 +474,12 @@ export class Expand extends Expression { if (['time', 'date', 'datetime'].includes(type)) { expandFunction = this.expandDTishInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.getPrecision()); - } else if (type === 'quantity') { + } else if (['integer', 'long', 'decimal'].includes(type)) { + expandFunction = this.expandNumericInterval; + defaultPer = (_interval: any) => new Quantity(1, '1'); + } else if (['quantity'].includes(type)) { expandFunction = this.expandQuantityInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.unit); - } else if (type === 'integer') { - expandFunction = this.expandIntegerInterval; - defaultPer = (_interval: any) => new Quantity(1, '1'); - } else if (type === 'long') { - expandFunction = this.expandLongInterval; - defaultPer = (_interval: any) => new Quantity(1, '1'); - } else if (type === 'decimal') { - expandFunction = this.expandDecimalInterval; - defaultPer = (_interval: any) => new Quantity(1, '1'); } else { throw new Error('Interval list type not yet supported.'); } @@ -624,7 +618,7 @@ export class Expand extends Expression { return null; } - const results = this.makeDecimalIntervalList(low_value, high_value, per_value); + const results = this.makeNumericIntervalList(low_value, high_value, per_value); for (const itvl of results) { itvl.low = new Quantity(itvl.low, result_units); @@ -633,38 +627,17 @@ export class Expand extends Expression { return results; } - expandIntegerInterval(interval: any, per: any) { + expandNumericInterval(interval: any, per: any) { if (per.unit !== '1' && per.unit !== '') { return null; } const low = interval.lowClosed ? interval.low : successor(interval.low); const high = interval.highClosed ? interval.high : predecessor(interval.high); - return this.makeDecimalIntervalList(low, high, per.value); - } - - expandDecimalInterval(interval: any, per: any) { - if (per.unit !== '1' && per.unit !== '') { - return null; - } - const low = interval.lowClosed ? interval.low : successor(interval.low); - const high = interval.highClosed ? interval.high : predecessor(interval.high); - - return this.makeDecimalIntervalList(low, high, per.value); - } - - expandLongInterval(interval: any, per: any) { - if (per.unit !== '1' && per.unit !== '') { - return null; - } - - const low = interval.lowClosed ? interval.low : successor(interval.low); - const high = interval.highClosed ? interval.high : predecessor(interval.high); - - return this.makeDecimalIntervalList(low, high, per.value); + return this.makeNumericIntervalList(low, high, per.value); } - makeDecimalIntervalList(low: any, high: any, perValue: any) { + makeNumericIntervalList(low: any, high: any, perValue: any) { // If the per value is a decimal, 8 decimal places are appropriate // Integers should have 0 Decimal places const perIsIntegral = perValue.isInteger(); @@ -678,7 +651,7 @@ export class Expand extends Expression { low = Decimal.from(low); high = Decimal.from(high); - let convertBound: (d: Decimal) => Decimal | number | bigint = d => d.toInteger(); + let convertBound: (d: Decimal) => Decimal | number | bigint; if (!perIsIntegral) { // If per is not an integer value, then regardless of the original point types, the values will be Decimals convertBound = d => d; diff --git a/src/elm/type.ts b/src/elm/type.ts index c68982d1c..e7184691d 100644 --- a/src/elm/type.ts +++ b/src/elm/type.ts @@ -96,6 +96,21 @@ export class ToBoolean extends Expression { async exec(ctx: Context) { const arg = await this.execArgs(ctx); if (arg != null) { + if (typeof arg === 'boolean') { + return arg; + } else if (typeof arg === 'number' || typeof arg === 'bigint') { + if (arg == 1) { + return true; + } else if (arg == 0) { + return false; + } + } else if (arg instanceof Decimal) { + if (arg.equals('1.0')) { + return true; + } else if (arg.equals('0.0')) { + return false; + } + } const strArg = arg.toString().toLowerCase(); if (['true', 't', 'yes', 'y', '1'].includes(strArg)) { return true; @@ -157,6 +172,14 @@ export class ToDateTime extends Expression { } } +// Described in the CQL spec as (+|-)?#0(.0#)? +// Meaning an optional polarity indicator, +// followed by any number of digits (including none), +// followed by at least one digit, +// followed optionally by a decimal point, +// at least one digit, and any number of additional digits (including none). +const CQL_DECIMAL_STRING = /^[+-]?\d+(\.\d+)?$/; + export class ToDecimal extends Expression { constructor(json: any) { super(json); @@ -170,6 +193,13 @@ export class ToDecimal extends Expression { const high = Decimal.from(arg.high).normalized(); return new Uncertainty(low, high); } else { + if (typeof arg === 'string' && !CQL_DECIMAL_STRING.test(arg)) { + // reject anything that doesn't match the CQL Decimal format + // In particular, our Decimal.from could be more permissive + // and allow things like "1e8", which is not allowed by the spec + return null; + } + try { const decimal = Decimal.from(arg.toString()); if (isValidDecimal(decimal)) { diff --git a/src/util/math.ts b/src/util/math.ts index 365a749b8..76b090a12 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -439,30 +439,21 @@ export function decimalAdjust(type: MathFn, value: any, exp: any) { return +(value[0] + 'e' + v); } -export function decimalOrNull(value: any) { - return isValidDecimal(value) ? value : null; -} - -export function decimalLongOrNull(value: any) { - return (typeof value === 'number' && Number.isFinite(value)) || - (value && value.isDecimal && isValidDecimal(value)) || - (typeof value === 'bigint' && isValidLong(value)) - ? value - : null; -} - -export function finalizeNumericResult(result: any, _type?: string) { +export function finalizeNumericResult(result: any) { if (result instanceof Decimal) { return result.normalized(); } else if (result instanceof Quantity) { return new Quantity(result.value.normalized(), result.unit); } else if (result instanceof Uncertainty) { - if (result.low instanceof Quantity || result.low instanceof Decimal) { - result.low = finalizeNumericResult(result.low); + let low = result.low; + if (low instanceof Quantity || low instanceof Decimal) { + low = finalizeNumericResult(low); } - if (result.high instanceof Quantity || result.high instanceof Decimal) { - result.high = finalizeNumericResult(result.high); + let high = result.high; + if (high instanceof Quantity || high instanceof Decimal) { + high = finalizeNumericResult(high); } + return new Uncertainty(low, high); } return result; diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 54e693207..1622b5034 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -13,10 +13,10 @@ describe('Decimal', () => { const value = Decimal.from('1.5').subtract('0.5'); value.compareTo('1').should.equal(0); - value.add(2).toString().should.equal('3'); - value.multiplyBy(2).toString().should.equal('2'); + value.add(2).toString().should.equal('3.0'); + value.multiplyBy(2).toString().should.equal('2.0'); value.divideBy(2).toString().should.equal('0.5'); - Decimal.from(3).modulo(2).toString().should.equal('1'); + Decimal.from(3).modulo(2).toString().should.equal('1.0'); }); it('should provide an explicit scale and JSON representation', () => { diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index 7e0ac943a..a5f7cc01d 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -173,15 +173,15 @@ describe('FromQuantity', () => { }); it('should convert "10 \'A\'" to "10 \'A\'"', async function () { - (await this.quantityStr.exec(this.ctx)).should.equal("10 'A'"); + (await this.quantityStr.exec(this.ctx)).should.equal("10.0 'A'"); }); it('should convert "+10 \'A\'" to "10 \'A\'"', async function () { - (await this.posQuantityStr.exec(this.ctx)).should.equal("10 'A'"); + (await this.posQuantityStr.exec(this.ctx)).should.equal("10.0 'A'"); }); it('should convert "-10 \'A\'" to "10 \'A\'"', async function () { - (await this.negQuantityStr.exec(this.ctx)).should.equal("-10 'A'"); + (await this.negQuantityStr.exec(this.ctx)).should.equal("-10.0 'A'"); }); it('should convert "10 \'A\'" to "10 \'A\'"', async function () { @@ -357,7 +357,7 @@ describe('ToDecimal', () => { }); it('should truncate decimal to 8 digits after decimal point', async function () { - (await this.tooPrecise.exec(this.ctx)).should.equalDecimal(Decimal.from(0.44444444)); + (await this.tooPrecise.exec(this.ctx)).should.equalDecimal(Decimal.from('0.44444444')); }); it('should be null for decimal that is above max decimal value', async function () { @@ -372,7 +372,7 @@ describe('ToDecimal', () => { should.not.exist(await this.nullDecimal.exec(this.ctx)); }); - it.skip('should be null if wrong format (+.1)', async function () { + it('should be null if wrong format (+.1)', async function () { // TODO: parseFloat is more forgiving than the CQL spec, so this does get converted should(await this.wrongFormat.exec(this.ctx)).be.null(); }); diff --git a/test/elm/convert/data.cql b/test/elm/convert/data.cql index eb64cd79f..35c249ba4 100644 --- a/test/elm/convert/data.cql +++ b/test/elm/convert/data.cql @@ -76,7 +76,7 @@ define foo: 'bar' define NoSign: ToDecimal('0.0') define PositiveSign: ToDecimal('+1.1') define NegativeSign: ToDecimal('-1.1') -define TooPrecise: ToDecimal('.444444444') +define TooPrecise: ToDecimal('0.444444444') define TooLargeDec: ToDecimal('444444444444444444444444444444') define TooSmallDec: ToDecimal('-444444444444444444444444444444') define NullDecimal: ToDecimal((null as String)) diff --git a/test/elm/convert/data.js b/test/elm/convert/data.js index 4c259f550..bc8abadd2 100644 --- a/test/elm/convert/data.js +++ b/test/elm/convert/data.js @@ -3849,7 +3849,7 @@ context Patient define NoSign: ToDecimal('0.0') define PositiveSign: ToDecimal('+1.1') define NegativeSign: ToDecimal('-1.1') -define TooPrecise: ToDecimal('.444444444') +define TooPrecise: ToDecimal('0.444444444') define TooLargeDec: ToDecimal('444444444444444444444444444444') define TooSmallDec: ToDecimal('-444444444444444444444444444444') define NullDecimal: ToDecimal((null as String)) @@ -4104,7 +4104,7 @@ module.exports['ToDecimal'] = { }, { "r" : "245", "s" : [ { - "value" : [ "'.444444444'" ] + "value" : [ "'0.444444444'" ] } ] }, { "value" : [ ")" ] @@ -4128,7 +4128,7 @@ module.exports['ToDecimal'] = { "localId" : "245", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : ".444444444", + "value" : "0.444444444", "annotation" : [ ] } } diff --git a/test/elm/instance/instance-test.ts b/test/elm/instance/instance-test.ts index 722e7ca05..7197a395e 100644 --- a/test/elm/instance/instance-test.ts +++ b/test/elm/instance/instance-test.ts @@ -16,8 +16,8 @@ describe('Instance', () => { q.unit.should.eql('a'); const decimal12 = Decimal.from(12); q.value.should.eql(decimal12); - q.toString().should.equal("12 'a'"); - (await this.val.exec(this.ctx)).should.eql(decimal12); + q.toString().should.equal("12.0 'a'"); + (await this.val.exec(this.ctx)).should.equalDecimal(decimal12); }); it('should be able to construct a Code', async function () { diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 4a1660041..20bceedd0 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -3394,83 +3394,83 @@ describe('QuantityIntervalExpand', () => { it('expands single intervals', async function () { // define ClosedSingleGPerG: expand { Interval[2 'g', 4 'g'] } per 1 'g' let a = await this.closedSingleGPerG.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); // define ClosedSingleGPerGDecimal: expand { Interval[2.1 'g', 4.1 'g'] } per 1 'g' a = await this.closedSingleGPerGDecimal.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); // define ClosedSingleGPerMG: expand { Interval[2 'g', 2.003 'g'] } per 1 'mg' a = await this.closedSingleGPerMG.exec(this.ctx); prettyList(a).should.equal( - "{ [2000 'mg', 2000 'mg'], [2001 'mg', 2001 'mg'], [2002 'mg', 2002 'mg'], [2003 'mg', 2003 'mg'] }" + "{ [2000.0 'mg', 2000.0 'mg'], [2001.0 'mg', 2001.0 'mg'], [2002.0 'mg', 2002.0 'mg'], [2003.0 'mg', 2003.0 'mg'] }" ); // define ClosedSingleMGPerGTrunc: expand { Interval[2999 'mg', 4200 'mg'] } per 1 'g' a = await this.closedSingleMGPerGTrunc.exec(this.ctx); - prettyList(a).should.equal("{ [2999 'mg', 3998 'mg'] }"); + prettyList(a).should.equal("{ [2999.0 'mg', 3998.0 'mg'] }"); // define ClosedSingleMGPerMGTrunc: expand { Interval[2000 'mg', 4500 'mg'] } per 800 'mg' a = await this.closedSingleMGPerMGTrunc.exec(this.ctx); prettyList(a).should.equal( - "{ [2000 'mg', 2799 'mg'], [2800 'mg', 3599 'mg'], [3600 'mg', 4399 'mg'] }" + "{ [2000.0 'mg', 2799.0 'mg'], [2800.0 'mg', 3599.0 'mg'], [3600.0 'mg', 4399.0 'mg'] }" ); // define ClosedSingleMGPerMGDecimal: expand { Interval[2000.01 'mg', 4500 'mg'] } per 800 'mg' a = await this.closedSingleMGPerMGDecimal.exec(this.ctx); prettyList(a).should.equal( - "{ [2000 'mg', 2799 'mg'], [2800 'mg', 3599 'mg'], [3600 'mg', 4399 'mg'] }" + "{ [2000.0 'mg', 2799.0 'mg'], [2800.0 'mg', 3599.0 'mg'], [3600.0 'mg', 4399.0 'mg'] }" ); }); it('expands lists of multiple intervals', async function () { // define NullInList: expand { Interval[2 'g', 4 'g'], null } per 1 'g' let a = await this.nullInList.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); // define Overlapping: expand { Interval[2 'g', 4 'g'], Interval[3 'g', 5 'g'] } per 1 'g' a = await this.overlapping.exec(this.ctx); prettyList(a).should.equal( - "{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'], [5 'g', 5 'g'] }" + "{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'], [5.0 'g', 5.0 'g'] }" ); // define NonOverlapping: expand { Interval[2 'g', 4 'g'], Interval[6 'g', 6 'g'] } per 1 'g' a = await this.nonOverlapping.exec(this.ctx); prettyList(a).should.equal( - "{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'], [6 'g', 6 'g'] }" + "{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'], [6.0 'g', 6.0 'g'] }" ); }); it('expands interval using the first items units if no per provided', async function () { // define NoPerDefaultM: expand { Interval[2 'm', 400 'cm'] } let a = await this.noPerDefaultM.exec(this.ctx); - prettyList(a).should.equal("{ [2 'm', 2 'm'], [3 'm', 3 'm'], [4 'm', 4 'm'] }"); + prettyList(a).should.equal("{ [2.0 'm', 2.0 'm'], [3.0 'm', 3.0 'm'], [4.0 'm', 4.0 'm'] }"); // define NoPerDefaultG: expand { Interval[2 'g', 4 'g'] } a = await this.noPerDefaultG.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); }); it('expands interval with open ends', async function () { // define OpenStart: expand { Interval(2 'g', 4 'g'] } per 1 'g' let a = await this.openStart.exec(this.ctx); - prettyList(a).should.equal("{ [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); // define OpenEnd: expand { Interval[2 'g', 4 'g') } per 1 'g' a = await this.openEnd.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'] }"); // define OpenBoth: expand { Interval(2 'g', 4 'g') } per 1 'g' a = await this.openBoth.exec(this.ctx); - prettyList(a).should.equal("{ [3 'g', 3 'g'] }"); + prettyList(a).should.equal("{ [3.0 'g', 3.0 'g'] }"); // define OpenBothDecimal: expand { Interval(2.1 'g', 4.1 'g') } per 1 'g' a = await this.openBothDecimal.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); // define OpenBothDecimalTrunc: expand { Interval(2.1 'g', 4.101 'g') } per 1 'g' a = await this.openBothDecimalTrunc.exec(this.ctx); - prettyList(a).should.equal("{ [2 'g', 2 'g'], [3 'g', 3 'g'], [4 'g', 4 'g'] }"); + prettyList(a).should.equal("{ [2.0 'g', 2.0 'g'], [3.0 'g', 3.0 'g'], [4.0 'g', 4.0 'g'] }"); }); it('returns an empty list if we get an empty list or if there are no results', async function () { @@ -3705,7 +3705,7 @@ describe('DecimalIntervalExpand', () => { it('expands single intervals', async function () { // define ClosedSingle: expand { Interval[2, 5] } per 1.5 '1' let a = await this.closedSingle.exec(this.ctx); - prettyList(a).should.equal('{ [2, 3.49999999], [3.5, 4.99999999] }'); + prettyList(a).should.equal('{ [2.0, 3.49999999], [3.5, 4.99999999] }'); // define ClosedSingle1: expand { Interval[2.5, 10] } per 2 '1' a = await this.closedSingle1.exec(this.ctx); @@ -3714,22 +3714,22 @@ describe('DecimalIntervalExpand', () => { // define ClosedSingle2: expand { Interval[2, 4.5] } per 0.5 '1' a = await this.closedSingle2.exec(this.ctx); prettyList(a).should.equal( - '{ [2, 2.49999999], [2.5, 2.99999999], [3, 3.49999999], [3.5, 3.99999999], [4, 4.49999999] }' + '{ [2.0, 2.49999999], [2.5, 2.99999999], [3.0, 3.49999999], [3.5, 3.99999999], [4.0, 4.49999999] }' ); }); it('expands lists of multiple intervals', async function () { // define NullInList: expand { Interval[2, 5], null } per 1.5 '1' let a = await this.nullInList.exec(this.ctx); - prettyList(a).should.equal('{ [2, 3.49999999], [3.5, 4.99999999] }'); + prettyList(a).should.equal('{ [2.0, 3.49999999], [3.5, 4.99999999] }'); // define Overlapping: expand { Interval[2, 5], Interval[4, 7] } per 1.5 '1' a = await this.overlapping.exec(this.ctx); - prettyList(a).should.equal('{ [2, 3.49999999], [3.5, 4.99999999], [5, 6.49999999] }'); + prettyList(a).should.equal('{ [2.0, 3.49999999], [3.5, 4.99999999], [5.0, 6.49999999] }'); // define NonOverlapping: expand { Interval[2, 4], Interval[6, 8] } per 1.5 '1' a = await this.nonOverlapping.exec(this.ctx); - prettyList(a).should.equal('{ [2, 3.49999999], [6, 7.49999999] }'); + prettyList(a).should.equal('{ [2.0, 3.49999999], [6.0, 7.49999999] }'); }); it('expands interval using default per of 1', async function () { @@ -3741,11 +3741,11 @@ describe('DecimalIntervalExpand', () => { it('expands interval with open ends', async function () { // define OpenStart: expand { Interval(2, 5] } per 1.5 '1' let a = await this.openStart.exec(this.ctx); - prettyList(a).should.equal('{ [3, 4.49999999] }'); + prettyList(a).should.equal('{ [3.0, 4.49999999] }'); // define OpenEnd: expand { Interval[2, 5) } per 1.5 '1' a = await this.openEnd.exec(this.ctx); - prettyList(a).should.equal('{ [2, 3.49999999] }'); + prettyList(a).should.equal('{ [2.0, 3.49999999] }'); // define OpenBoth: expand { Interval(2, 5) } per 1.5 '1' (await this.openBoth.exec(this.ctx)).should.be.empty(); diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.cql b/test/spec-tests/cql/CqlStringOperatorsTest.cql index fbc62f47d..12054e0e6 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.cql +++ b/test/spec-tests/cql/CqlStringOperatorsTest.cql @@ -350,9 +350,11 @@ define "Upper": Tuple{ define "toString tests": Tuple{ "QuantityToString": Tuple{ + skipped: 'Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side' + /* expression: ToString(125 'cm'), output: '125 \'cm\'' - }, + */ }, "DateTimeToString1": Tuple{ expression: ToString(DateTime(2000, 1, 1)), output: '2000-01-01' diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.json b/test/spec-tests/cql/CqlStringOperatorsTest.json index 430bcf316..1fd5e49e9 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.json +++ b/test/spec-tests/cql/CqlStringOperatorsTest.json @@ -10087,16 +10087,7 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", @@ -10227,16 +10218,7 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", @@ -10363,16 +10345,7 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", @@ -10384,28 +10357,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "ToString", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "annotation": [], - "signature": [], - "operand": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 125, - "unit": "cm", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "125 'cm'", + "value": "Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side", "annotation": [] } } diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index a939904b0..6e8072e7b 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -16,6 +16,7 @@ CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: In "CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See test Divide1Q1Q which is correct "CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10By5DQuantity" Wrong output: The resulting Quantity should have an appropriate unit "CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide414By206DQuantity" Wrong output: The resulting Quantity should have an appropriate unit +"CqlStringOperatorsTest.toString tests.QuantityToString" Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side # Potentially Incorrect Expected Output "CqlStringOperatorsTest.toString tests.DateTimeToString2" Answer does not include timezone offset, but default offset depends on test environment From 8993bf88f6f56f2b20a1019e86e3feeee39c8b5e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 15:31:58 -0400 Subject: [PATCH 11/62] additional cleanup --- src/elm/aggregate.ts | 16 ++++++++++------ src/elm/arithmetic.ts | 7 ++++++- src/util/immutableUtil.ts | 6 ++---- src/util/math.ts | 23 ----------------------- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index fe72381f7..6d9e91536 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -177,8 +177,7 @@ export class Avg extends AggregateExpression { decimals = items.map(Decimal.from); } const sum = sumOfDecimals(decimals); - const avg = finalizeAggregateResult(sum.divideBy(items.length), items[0]); - + const avg = sum.divideBy(items.length); return finalizeAggregateResult(avg, items[0]); } } @@ -414,10 +413,15 @@ export class GeometricMean extends AggregateExpression { } else { decimals = items.map(Decimal.from); } - const product = productOfDecimals(decimals); - const oneOverLength = Decimal.from(1).divideBy(items.length); - const geoMean = product.power(oneOverLength); - return finalizeAggregateResult(geoMean, items[0]); + + try { + const product = productOfDecimals(decimals); + const oneOverLength = Decimal.from(1).divideBy(items.length); + const geoMean = product.power(oneOverLength); + return finalizeAggregateResult(geoMean, items[0]); + } catch { + return null; + } } } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index 9f37e676a..c0d7f796a 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -392,7 +392,12 @@ export class Power extends Expression { // Note: The resultTypeName may be wrong if the exponent is a negative number. // E.g., CQL-to-ELM says 10^-1 is an Integer result type, but the correct result is a 0.1 (a Decimal) // doPower handles this scenario - const power = doPower(args[0], args[1]); + let power; + try { + power = doPower(args[0], args[1]); + } catch { + return null; + } return finalizeArithmeticResult(power); } diff --git a/src/util/immutableUtil.ts b/src/util/immutableUtil.ts index 14d6c7d01..adeada848 100644 --- a/src/util/immutableUtil.ts +++ b/src/util/immutableUtil.ts @@ -9,7 +9,6 @@ import { Ratio, Uncertainty } from '../datatypes/datatypes'; -import { decimalAdjust } from './math'; import { convertUnit } from './units'; const ucumUtilInstance = ucum.UcumLhcUtils.getInstance(); @@ -108,12 +107,11 @@ export const toNormalizedKey = (js: any): NormalizedKey => { __instance: js.constructor }); } else { - // Unit was found - convert to baseUnit and normalize + // Unit was found - convert to baseUnit const baseUnitKeyCode = baseUnitKey[0].csCode_; const conversionValue = convertUnit(js.value, js.unit, baseUnitKeyCode); - const finalValue = conversionValue ? decimalAdjust('round', conversionValue, -8) : null; return ImmutableMap({ - value: finalValue ? toNormalizedKey(finalValue) : null, + value: conversionValue ? toNormalizedKey(conversionValue) : null, unit: baseUnitKeyCode ?? null, __instance: js.constructor }); diff --git a/src/util/math.ts b/src/util/math.ts index 76b090a12..48d913c00 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -416,29 +416,6 @@ export function minValueForType(type: string, quantityInstance?: Quantity) { return null; } -type MathFn = keyof typeof Math; - -export function decimalAdjust(type: MathFn, value: any, exp: any) { - //If the exp is undefined or zero... - if (typeof exp === 'undefined' || +exp === 0) { - return (Math[type] as (x: number) => number)(value); - } - value = +value; - exp = +exp; - //If the value is not a number or the exp is not an integer... - if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { - return NaN; - } - //Shift - value = value.toString().split('e'); - let v = value[1] ? +value[1] - exp : -exp; - value = (Math[type] as (x: number) => number)(+(value[0] + 'e' + v)); - //Shift back - value = value.toString().split('e'); - v = value[1] ? +value[1] + exp : exp; - return +(value[0] + 'e' + v); -} - export function finalizeNumericResult(result: any) { if (result instanceof Decimal) { return result.normalized(); From b7cb9e6c33ca2a400b2aa5be9c5428c43ee84932 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 15:51:37 -0400 Subject: [PATCH 12/62] new tests added by codex --- test/datatypes/decimal-test.ts | 11 + test/elm/aggregate/aggregate-test.ts | 26 + test/elm/aggregate/data.cql | 8 + test/elm/aggregate/data.js | 853 +++++++++++++++++++++---- test/elm/arithmetic/arithmetic-test.ts | 16 + test/elm/arithmetic/data.cql | 5 + test/elm/arithmetic/data.js | 336 +++++++++- test/elm/convert/convert-test.ts | 21 + test/elm/convert/data.cql | 9 + test/elm/convert/data.js | 433 ++++++++++++- test/util/immutableUtil-test.ts | 8 + test/util/math-test.ts | 21 +- 12 files changed, 1626 insertions(+), 121 deletions(-) diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 1622b5034..053584fd3 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -24,6 +24,13 @@ describe('Decimal', () => { JSON.stringify({ value: Decimal.from('1.25') }).should.equal('{"value":"1.25"}'); }); + it('should serialize using fixed-point CQL Decimal notation', () => { + Decimal.from(1).toString().should.equal('1.0'); + Decimal.from('-12.5').toString().should.equal('-12.5'); + Decimal.from('0.00000001').toString().should.equal('0.00000001'); + JSON.stringify({ value: Decimal.from(1) }).should.equal('{"value":"1.0"}'); + }); + it('should provide CQL arithmetic helpers without exposing a number', () => { Decimal.from('-1.9').truncate().should.equal(-1); Decimal.from('1.1').ceil().should.equal(2); @@ -38,4 +45,8 @@ describe('Decimal', () => { (() => Decimal.from('not a number')).should.throw(); (() => Decimal.from(1).divideBy(0)).should.throw(); }); + + it('should not coerce a nonzero Decimal divisor through a JavaScript number', () => { + (() => Decimal.from(1).divideBy('1e-1000')).should.not.throw(); + }); }); diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 22292ffdb..5f946e4cc 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -309,6 +309,10 @@ describe('Avg', () => { (await this.has_null.exec(this.ctx)).should.equalDecimal(Decimal.from(1.5)); }); + it('should normalize repeating Decimal averages at the aggregate boundary', async function () { + (await this.repeating_decimal.exec(this.ctx)).should.equalDecimal(Decimal.from('1.66666667')); + }); + it('should return null for empty list', async function () { should(await this.empty.exec(this.ctx)).be.null(); }); @@ -444,6 +448,11 @@ describe('PopulationVariance', () => { it('should be null if quantity units are not compatible', async function () { should(await this.incompatibleUnitsNull.exec(this.ctx)).be.null(); }); + + it('should return zero for a single-item population variance', async function () { + (await this.single_value.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + validateQuantity(await this.single_value_q.exec(this.ctx), 0, 'ml'); + }); }); describe('Variance', () => { @@ -465,6 +474,10 @@ describe('Variance', () => { it('should be null if quantity units are not compatible', async function () { should(await this.incompatibleUnitsNull.exec(this.ctx)).be.null(); }); + + it('should return null for a single-item sample variance', async function () { + should(await this.single_value.exec(this.ctx)).be.null(); + }); }); describe('StdDev', () => { @@ -486,6 +499,10 @@ describe('StdDev', () => { it('should be null if quantity units are not compatible', async function () { should(await this.incompatibleUnitsNull.exec(this.ctx)).be.null(); }); + + it('should return null for a single-item sample standard deviation', async function () { + should(await this.single_value.exec(this.ctx)).be.null(); + }); }); describe('PopulationStdDev', () => { @@ -507,6 +524,11 @@ describe('PopulationStdDev', () => { it('should be null if quantity units are not compatible', async function () { should(await this.incompatibleUnitsNull.exec(this.ctx)).be.null(); }); + + it('should return zero for a single-item population standard deviation', async function () { + (await this.single_value.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + validateQuantity(await this.single_value_q.exec(this.ctx), 0, 'ml'); + }); }); describe('Product', () => { @@ -660,6 +682,10 @@ describe('GeometricMean', () => { it('should return null when pass in list as null', async function () { should(await this.also_null_geometric_mean.exec(this.ctx)).be.null(); }); + + it('should return null when the geometric mean cannot be represented', async function () { + should(await this.negative_geometric_mean.exec(this.ctx)).be.null(); + }); }); describe('AllTrue', () => { diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index c82e2527e..61eeffe92 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -84,6 +84,7 @@ define not_null_q: Avg({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define has_null_q: Avg({1 'ml',null,null,2 'ml'}) define empty: Avg(List{}) define q_diff_units: Avg({1 'ml',0.002 'l',0.03 'dl',4 'ml',5 'ml'}) +define repeating_decimal: Avg({1.0, 2.0, 2.0}) define NumbersAndQuantities: Avg({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Avg({1 'mg/d', 0.002 '/d'}) @@ -120,6 +121,7 @@ define v_q: Variance({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define q_diff_units: Variance({1.0 'ml',0.002 'l',0.003 'l',0.04 'dl',5.0 'ml'}) define NumbersAndQuantities: Variance({1.0 ,2.0 ,3.0 ,4.0 'ml',5.0 'ml'}) define IncompatibleUnitsNull: Variance({1 'mg/d', 0.002 '/d'}) +define single_value: Variance({2.0}) // @Test: PopulationVariance define v: PopulationVariance({1.0,2.0,3.0,4.0,5.0}) @@ -127,6 +129,8 @@ define v_q: PopulationVariance({1.0 'ml',2.0 'ml',3.0 'ml',4.0 'ml',5.0 'ml'}) define q_diff_units: PopulationVariance({1.0 'ml',0.002 'l',0.003 'l',0.04 'dl',5.0 'ml'}) define NumbersAndQuantities: PopulationVariance({1.0 ,2.0 ,3.0 ,4.0 'ml',5.0 'ml'}) define IncompatibleUnitsNull: PopulationVariance({1 'mg/d', 0.002 '/d'}) +define single_value: PopulationVariance({2.0}) +define single_value_q: PopulationVariance({2.0 'ml'}) // @Test: StdDev define std: StdDev({1,2,3,4,5}) @@ -135,6 +139,7 @@ define q_diff_units: StdDev({1 'ml', 0.002 'l',3 'ml',4 'ml', 0.05 'dl'}) define sq_throw1: StdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'm'}) define NumbersAndQuantities: StdDev({1 ,2 ,3 ,4 'ml',5 }) define IncompatibleUnitsNull: StdDev({1 'mg/d', 0.002 '/d'}) +define single_value: StdDev({2.0}) // @Test: PopulationStdDev define dev: PopulationStdDev({1,2,3,4,5}) @@ -142,6 +147,8 @@ define dev_q: PopulationStdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define q_diff_units: PopulationStdDev({1 'ml', 0.002 'l',3 'ml',4 'ml', 0.05 'dl'}) define NumbersAndQuantities: PopulationStdDev({1 ,2 ,3 ,4 'ml',5 }) define IncompatibleUnitsNull: PopulationStdDev({1 'mg/d', 0.002 '/d'}) +define single_value: PopulationStdDev({2.0}) +define single_value_q: PopulationStdDev({2.0 'ml'}) // @Test: Product define integer_product: Product({5, 4, 5}) @@ -183,6 +190,7 @@ define zero_geometric_mean: GeometricMean({2.0, 8.0, 0}) define null_geometric_mean: GeometricMean({1, 2, null}) define all_nulls: GeometricMean({null, null, null}) define also_null_geometric_mean: GeometricMean(null as List) +define negative_geometric_mean: GeometricMean({-1.0, 4.0}) // @Test: AllTrue define at: AllTrue({true,true,true,true}) diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index 9199f9626..5f063253c 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -8157,6 +8157,7 @@ define not_null_q: Avg({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define has_null_q: Avg({1 'ml',null,null,2 'ml'}) define empty: Avg(List{}) define q_diff_units: Avg({1 'ml',0.002 'l',0.03 'dl',4 'ml',5 'ml'}) +define repeating_decimal: Avg({1.0, 2.0, 2.0}) define NumbersAndQuantities: Avg({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Avg({1 'mg/d', 0.002 '/d'}) */ @@ -8173,7 +8174,7 @@ module.exports['Avg'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "385", + "r" : "401", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8996,8 +8997,8 @@ module.exports['Avg'] = { } }, { "localId" : "363", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "NumbersAndQuantities", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "repeating_decimal", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -9006,46 +9007,130 @@ module.exports['Avg'] = { "s" : { "r" : "363", "s" : [ { - "value" : [ "", "define ", "NumbersAndQuantities", ": " ] + "value" : [ "", "define ", "repeating_decimal", ": " ] }, { - "r" : "380", + "r" : "374", "s" : [ { "value" : [ "Avg", "(" ] }, { "r" : "364", "s" : [ { "r" : "365", + "value" : [ "{", "1.0", ", ", "2.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Avg", + "localId" : "374", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "375", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "376", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "364", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "368", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "369", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "365", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "366", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "367", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "379", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "NumbersAndQuantities", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "379", + "s" : [ { + "value" : [ "", "define ", "NumbersAndQuantities", ": " ] + }, { + "r" : "396", + "s" : [ { + "value" : [ "Avg", "(" ] + }, { + "r" : "380", + "s" : [ { + "r" : "381", "value" : [ "{", "1", " ," ] }, { - "r" : "366", + "r" : "382", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "367", + "r" : "383", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "368", + "r" : "384", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "369", + "r" : "385", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "370", + "r" : "386", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -9060,48 +9145,48 @@ module.exports['Avg'] = { } ], "expression" : { "type" : "Avg", - "localId" : "380", + "localId" : "396", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "381", + "localId" : "397", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "382", + "localId" : "398", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "364", + "localId" : "380", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "374", + "localId" : "390", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "375", + "localId" : "391", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "ToQuantity", - "localId" : "372", + "localId" : "388", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "373", + "localId" : "389", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "365", + "localId" : "381", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -9109,35 +9194,35 @@ module.exports['Avg'] = { } }, { "type" : "Quantity", - "localId" : "366", + "localId" : "382", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "367", + "localId" : "383", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "368", + "localId" : "384", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "369", + "localId" : "385", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "370", + "localId" : "386", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -9146,7 +9231,7 @@ module.exports['Avg'] = { } } }, { - "localId" : "385", + "localId" : "401", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "IncompatibleUnitsNull", "context" : "Patient", @@ -9155,26 +9240,26 @@ module.exports['Avg'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "385", + "r" : "401", "s" : [ { "value" : [ "", "define ", "IncompatibleUnitsNull", ": " ] }, { - "r" : "395", + "r" : "411", "s" : [ { "value" : [ "Avg", "(" ] }, { - "r" : "386", + "r" : "402", "s" : [ { "value" : [ "{" ] }, { - "r" : "387", + "r" : "403", "s" : [ { "value" : [ "1 ", "'mg/d'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "388", + "r" : "404", "s" : [ { "value" : [ "0.002 ", "'/d'" ] } ] @@ -9189,45 +9274,45 @@ module.exports['Avg'] = { } ], "expression" : { "type" : "Avg", - "localId" : "395", + "localId" : "411", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "396", + "localId" : "412", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "397", + "localId" : "413", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "386", + "localId" : "402", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "389", + "localId" : "405", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "390", + "localId" : "406", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "387", + "localId" : "403", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "mg/d", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "388", + "localId" : "404", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "/d", @@ -12193,6 +12278,7 @@ define v_q: Variance({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define q_diff_units: Variance({1.0 'ml',0.002 'l',0.003 'l',0.04 'dl',5.0 'ml'}) define NumbersAndQuantities: Variance({1.0 ,2.0 ,3.0 ,4.0 'ml',5.0 'ml'}) define IncompatibleUnitsNull: Variance({1 'mg/d', 0.002 '/d'}) +define single_value: Variance({2.0}) */ module.exports['Variance'] = { @@ -12207,7 +12293,7 @@ module.exports['Variance'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "309", + "r" : "324", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -12910,6 +12996,76 @@ module.exports['Variance'] = { } ] } } + }, { + "localId" : "324", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "single_value", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "324", + "s" : [ { + "value" : [ "", "define ", "single_value", ": " ] + }, { + "r" : "333", + "s" : [ { + "value" : [ "Variance", "(" ] + }, { + "r" : "325", + "s" : [ { + "r" : "326", + "value" : [ "{", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Variance", + "localId" : "333", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "334", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "335", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "325", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "327", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "328", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "326", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } } ] } } @@ -12924,6 +13080,8 @@ define v_q: PopulationVariance({1.0 'ml',2.0 'ml',3.0 'ml',4.0 'ml',5.0 'ml'}) define q_diff_units: PopulationVariance({1.0 'ml',0.002 'l',0.003 'l',0.04 'dl',5.0 'ml'}) define NumbersAndQuantities: PopulationVariance({1.0 ,2.0 ,3.0 ,4.0 'ml',5.0 'ml'}) define IncompatibleUnitsNull: PopulationVariance({1 'mg/d', 0.002 '/d'}) +define single_value: PopulationVariance({2.0}) +define single_value_q: PopulationVariance({2.0 'ml'}) */ module.exports['PopulationVariance'] = { @@ -12938,7 +13096,7 @@ module.exports['PopulationVariance'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "295", + "r" : "324", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -13607,91 +13765,238 @@ module.exports['PopulationVariance'] = { } ] } } - } ] - } - } -} - -/* StdDev -library TestSnippet version '1' -using Simple version '1.0.0' -context Patient -define std: StdDev({1,2,3,4,5}) -define std_q: StdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) -define q_diff_units: StdDev({1 'ml', 0.002 'l',3 'ml',4 'ml', 0.05 'dl'}) -define sq_throw1: StdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'm'}) -define NumbersAndQuantities: StdDev({1 ,2 ,3 ,4 'ml',5 }) -define IncompatibleUnitsNull: StdDev({1 'mg/d', 0.002 '/d'}) -*/ - -module.exports['StdDev'] = { - "library" : { - "localId" : "0", - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorVersion" : "4.2.0", - "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", - "signatureLevel" : "All" - }, { - "type" : "Annotation", - "t" : [ ], - "s" : { - "r" : "330", - "s" : [ { - "value" : [ "", "library TestSnippet version '1'" ] - } ] - } - } ], - "identifier" : { - "id" : "TestSnippet", - "version" : "1" - }, - "schemaIdentifier" : { - "id" : "urn:hl7-org:elm", - "version" : "r1" - }, - "usings" : { - "def" : [ { - "localId" : "1", - "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1", - "annotation" : [ ] }, { - "localId" : "206", - "localIdentifier" : "Simple", - "uri" : "https://github.com/cqframework/cql-execution/simple", - "version" : "1.0.0", + "localId" : "310", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "single_value", + "context" : "Patient", + "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "206", + "r" : "310", "s" : [ { - "value" : [ "", "using " ] + "value" : [ "", "define ", "single_value", ": " ] }, { + "r" : "319", "s" : [ { - "value" : [ "Simple" ] + "value" : [ "PopulationVariance", "(" ] + }, { + "r" : "311", + "s" : [ { + "r" : "312", + "value" : [ "{", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] } ] - }, { - "value" : [ " version '1.0.0'" ] } ] } - } ] - } ] - }, - "contexts" : { - "def" : [ { - "localId" : "211", - "name" : "Patient", - "annotation" : [ ] - } ] - }, - "statements" : { - "def" : [ { - "localId" : "209", - "name" : "Patient", - "context" : "Patient", - "annotation" : [ ], + } ], + "expression" : { + "type" : "PopulationVariance", + "localId" : "319", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "320", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "321", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "311", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "313", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "314", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "312", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "324", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "single_value_q", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "324", + "s" : [ { + "value" : [ "", "define ", "single_value_q", ": " ] + }, { + "r" : "333", + "s" : [ { + "value" : [ "PopulationVariance", "(" ] + }, { + "r" : "325", + "s" : [ { + "value" : [ "{" ] + }, { + "r" : "326", + "s" : [ { + "value" : [ "2.0 ", "'ml'" ] + } ] + }, { + "value" : [ "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "PopulationVariance", + "localId" : "333", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "334", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "335", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "325", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "327", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "328", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Quantity", + "localId" : "326", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "ml", + "annotation" : [ ] + } ] + } + } + } ] + } + } +} + +/* StdDev +library TestSnippet version '1' +using Simple version '1.0.0' +context Patient +define std: StdDev({1,2,3,4,5}) +define std_q: StdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) +define q_diff_units: StdDev({1 'ml', 0.002 'l',3 'ml',4 'ml', 0.05 'dl'}) +define sq_throw1: StdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'm'}) +define NumbersAndQuantities: StdDev({1 ,2 ,3 ,4 'ml',5 }) +define IncompatibleUnitsNull: StdDev({1 'mg/d', 0.002 '/d'}) +define single_value: StdDev({2.0}) +*/ + +module.exports['StdDev'] = { + "library" : { + "localId" : "0", + "annotation" : [ { + "type" : "CqlToElmInfo", + "translatorVersion" : "4.2.0", + "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", + "signatureLevel" : "All" + }, { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "345", + "s" : [ { + "value" : [ "", "library TestSnippet version '1'" ] + } ] + } + } ], + "identifier" : { + "id" : "TestSnippet", + "version" : "1" + }, + "schemaIdentifier" : { + "id" : "urn:hl7-org:elm", + "version" : "r1" + }, + "usings" : { + "def" : [ { + "localId" : "1", + "localIdentifier" : "System", + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] + }, { + "localId" : "206", + "localIdentifier" : "Simple", + "uri" : "https://github.com/cqframework/cql-execution/simple", + "version" : "1.0.0", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "206", + "s" : [ { + "value" : [ "", "using " ] + }, { + "s" : [ { + "value" : [ "Simple" ] + } ] + }, { + "value" : [ " version '1.0.0'" ] + } ] + } + } ] + } ] + }, + "contexts" : { + "def" : [ { + "localId" : "211", + "name" : "Patient", + "annotation" : [ ] + } ] + }, + "statements" : { + "def" : [ { + "localId" : "209", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], "expression" : { "type" : "SingletonFrom", "localId" : "210", @@ -14476,6 +14781,76 @@ module.exports['StdDev'] = { } ] } } + }, { + "localId" : "345", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "single_value", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "345", + "s" : [ { + "value" : [ "", "define ", "single_value", ": " ] + }, { + "r" : "354", + "s" : [ { + "value" : [ "StdDev", "(" ] + }, { + "r" : "346", + "s" : [ { + "r" : "347", + "value" : [ "{", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "StdDev", + "localId" : "354", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "355", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "356", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "346", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "348", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "349", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "347", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } } ] } } @@ -14490,6 +14865,8 @@ define dev_q: PopulationStdDev({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) define q_diff_units: PopulationStdDev({1 'ml', 0.002 'l',3 'ml',4 'ml', 0.05 'dl'}) define NumbersAndQuantities: PopulationStdDev({1 ,2 ,3 ,4 'ml',5 }) define IncompatibleUnitsNull: PopulationStdDev({1 'mg/d', 0.002 '/d'}) +define single_value: PopulationStdDev({2.0}) +define single_value_q: PopulationStdDev({2.0 'ml'}) */ module.exports['PopulationStdDev'] = { @@ -14504,7 +14881,7 @@ module.exports['PopulationStdDev'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "312", + "r" : "341", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -15212,6 +15589,152 @@ module.exports['PopulationStdDev'] = { } ] } } + }, { + "localId" : "327", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "single_value", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "327", + "s" : [ { + "value" : [ "", "define ", "single_value", ": " ] + }, { + "r" : "336", + "s" : [ { + "value" : [ "PopulationStdDev", "(" ] + }, { + "r" : "328", + "s" : [ { + "r" : "329", + "value" : [ "{", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "PopulationStdDev", + "localId" : "336", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "337", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "338", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "328", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "330", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "331", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "329", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "341", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "single_value_q", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "341", + "s" : [ { + "value" : [ "", "define ", "single_value_q", ": " ] + }, { + "r" : "350", + "s" : [ { + "value" : [ "PopulationStdDev", "(" ] + }, { + "r" : "342", + "s" : [ { + "value" : [ "{" ] + }, { + "r" : "343", + "s" : [ { + "value" : [ "2.0 ", "'ml'" ] + } ] + }, { + "value" : [ "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "PopulationStdDev", + "localId" : "350", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "351", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "352", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "342", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "344", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "345", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Quantity", + "localId" : "343", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "ml", + "annotation" : [ ] + } ] + } + } } ] } } @@ -18205,6 +18728,7 @@ define zero_geometric_mean: GeometricMean({2.0, 8.0, 0}) define null_geometric_mean: GeometricMean({1, 2, null}) define all_nulls: GeometricMean({null, null, null}) define also_null_geometric_mean: GeometricMean(null as List) +define negative_geometric_mean: GeometricMean({-1.0, 4.0}) */ module.exports['GeometricMean'] = { @@ -18219,7 +18743,7 @@ module.exports['GeometricMean'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "307", + "r" : "325", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -18811,6 +19335,103 @@ module.exports['GeometricMean'] = { } } } + }, { + "localId" : "325", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "negative_geometric_mean", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "325", + "s" : [ { + "value" : [ "", "define ", "negative_geometric_mean", ": " ] + }, { + "r" : "337", + "s" : [ { + "value" : [ "GeometricMean", "(" ] + }, { + "r" : "326", + "s" : [ { + "value" : [ "{" ] + }, { + "r" : "327", + "s" : [ { + "r" : "328", + "value" : [ "-", "1.0" ] + } ] + }, { + "r" : "330", + "value" : [ ", ", "4.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "GeometricMean", + "localId" : "337", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "338", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "339", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "326", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "331", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "332", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Negate", + "localId" : "327", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "329", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "328", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + }, { + "type" : "Literal", + "localId" : "330", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.0", + "annotation" : [ ] + } ] + } + } } ] } } diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index b05c6b580..67c861761 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -348,6 +348,17 @@ describe('Power', () => { it('should return an infinitesimally small number when the exponent is the minimum Long value', async function () { (await this.twoLongExpMinLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.0)); }); + + it('should normalize Decimal power results at the ELM boundary', async function () { + (await this.decimalPowerNeedsNormalization.exec(this.ctx)).should.equalDecimal( + Decimal.from('1.52415788') + ); + }); + + it('should return null for Decimal powers that cannot be represented', async function () { + should(await this.negativeFractionalPower.exec(this.ctx)).be.null(); + should(await this.zeroNegativePower.exec(this.ctx)).be.null(); + }); }); describe('MinValue', () => { @@ -636,6 +647,11 @@ describe('Round', () => { (await this.up_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.6)); (await this.down_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.4)); }); + + it('should round negative exact-half values toward positive infinity', async function () { + (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(Decimal.from(-1)); + }); }); describe('Successor', () => { diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 5f621470a..8907b069a 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -82,6 +82,9 @@ define ThreeExpFourReverseMixed: 3L ^ 4 define TenLongExpNegativeOneLong: 10L ^ -1L define TwoLongExpMaxLong: 2L ^ maximum Long define TwoLongExpMinLong: 2L ^ minimum Long +define DecimalPowerNeedsNormalization: 1.23456789 ^ 2.0 +define NegativeFractionalPower: (-1.0) ^ 0.5 +define ZeroNegativePower: 0.0 ^ -1.0 // @Test: MinValue define MinInteger: minimum Integer @@ -144,6 +147,8 @@ define Up: Round(4.56) define Up_percent: Round(4.56,1) define Down: Round(4.49) define Down_percent: Round(4.43,1) +define NegativeHalf: Round(-0.5) +define NegativeOnePointFive: Round(-1.5) // @Test: Ln define ln: Ln(4) diff --git a/test/elm/arithmetic/data.js b/test/elm/arithmetic/data.js index fd1503036..c87f24008 100644 --- a/test/elm/arithmetic/data.js +++ b/test/elm/arithmetic/data.js @@ -5394,6 +5394,9 @@ define ThreeExpFourReverseMixed: 3L ^ 4 define TenLongExpNegativeOneLong: 10L ^ -1L define TwoLongExpMaxLong: 2L ^ maximum Long define TwoLongExpMinLong: 2L ^ minimum Long +define DecimalPowerNeedsNormalization: 1.23456789 ^ 2.0 +define NegativeFractionalPower: (-1.0) ^ 0.5 +define ZeroNegativePower: 0.0 ^ -1.0 */ module.exports['Power'] = { @@ -5408,7 +5411,7 @@ module.exports['Power'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "281", + "r" : "308", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -5988,6 +5991,211 @@ module.exports['Power'] = { "annotation" : [ ] } ] } + }, { + "localId" : "290", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "DecimalPowerNeedsNormalization", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "290", + "s" : [ { + "value" : [ "", "define ", "DecimalPowerNeedsNormalization", ": " ] + }, { + "r" : "291", + "s" : [ { + "r" : "292", + "value" : [ "1.23456789", " ^ ", "2.0" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Power", + "localId" : "291", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "294", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "295", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "292", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.23456789", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "293", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + }, { + "localId" : "298", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "NegativeFractionalPower", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "298", + "s" : [ { + "value" : [ "", "define ", "NegativeFractionalPower", ": " ] + }, { + "r" : "299", + "s" : [ { + "r" : "300", + "s" : [ { + "value" : [ "(" ] + }, { + "r" : "300", + "s" : [ { + "r" : "301", + "value" : [ "-", "1.0" ] + } ] + }, { + "value" : [ ")" ] + } ] + }, { + "r" : "303", + "value" : [ " ^ ", "0.5" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Power", + "localId" : "299", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "304", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "305", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Negate", + "localId" : "300", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "302", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "301", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + }, { + "type" : "Literal", + "localId" : "303", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.5", + "annotation" : [ ] + } ] + } + }, { + "localId" : "308", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "ZeroNegativePower", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "308", + "s" : [ { + "value" : [ "", "define ", "ZeroNegativePower", ": " ] + }, { + "r" : "309", + "s" : [ { + "r" : "310", + "value" : [ "0.0", " ^ " ] + }, { + "r" : "311", + "s" : [ { + "r" : "312", + "value" : [ "-", "1.0" ] + } ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Power", + "localId" : "309", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "314", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "315", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "310", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.0", + "annotation" : [ ] + }, { + "type" : "Negate", + "localId" : "311", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "313", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "312", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + } ] + } } ] } } @@ -8642,6 +8850,8 @@ define Up: Round(4.56) define Up_percent: Round(4.56,1) define Down: Round(4.49) define Down_percent: Round(4.43,1) +define NegativeHalf: Round(-0.5) +define NegativeOnePointFive: Round(-1.5) */ module.exports['Round'] = { @@ -8656,7 +8866,7 @@ module.exports['Round'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "244", + "r" : "267", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8922,6 +9132,128 @@ module.exports['Round'] = { "annotation" : [ ] } } + }, { + "localId" : "256", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "NegativeHalf", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "256", + "s" : [ { + "value" : [ "", "define ", "NegativeHalf", ": " ] + }, { + "r" : "263", + "s" : [ { + "value" : [ "Round", "(" ] + }, { + "r" : "257", + "s" : [ { + "r" : "258", + "value" : [ "-", "0.5" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Round", + "localId" : "263", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "264", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Negate", + "localId" : "257", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "259", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "258", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.5", + "annotation" : [ ] + } + } + } + }, { + "localId" : "267", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "NegativeOnePointFive", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "267", + "s" : [ { + "value" : [ "", "define ", "NegativeOnePointFive", ": " ] + }, { + "r" : "274", + "s" : [ { + "value" : [ "Round", "(" ] + }, { + "r" : "268", + "s" : [ { + "r" : "269", + "value" : [ "-", "1.5" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Round", + "localId" : "274", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "275", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Negate", + "localId" : "268", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "270", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "269", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.5", + "annotation" : [ ] + } + } + } } ] } } diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index a5f7cc01d..92a83bad6 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -376,6 +376,22 @@ describe('ToDecimal', () => { // TODO: parseFloat is more forgiving than the CQL spec, so this does get converted should(await this.wrongFormat.exec(this.ctx)).be.null(); }); + + it('should reject exponent notation and malformed Decimal strings', async function () { + should(await this.exponentNotation.exec(this.ctx)).be.null(); + should(await this.exponentNotationUpper.exec(this.ctx)).be.null(); + should(await this.trailingDecimalPoint.exec(this.ctx)).be.null(); + should(await this.leadingDecimalPoint.exec(this.ctx)).be.null(); + }); + + it('should accept an integer-form Decimal string', async function () { + (await this.integerFormat.exec(this.ctx)).should.equalDecimal(Decimal.from(1)); + }); + + it('should format Decimals in fixed-point notation', async function () { + (await this.decimalToString.exec(this.ctx)).should.equal('1.0'); + (await this.smallDecimalToString.exec(this.ctx)).should.equal('0.00000001'); + }); }); describe('ToInteger', () => { @@ -860,6 +876,11 @@ describe('ConvertsToDecimal', () => { (await this.isFalse.exec(this.ctx)).should.equal(false); }); + it('should reject exponent notation and accept fixed-point Decimal notation', async function () { + (await this.exponentNotation.exec(this.ctx)).should.equal(false); + (await this.decimalFormat.exec(this.ctx)).should.equal(true); + }); + it('should return null for null input', async function () { should(await this.isNull.exec(this.ctx)).be.null(); }); diff --git a/test/elm/convert/data.cql b/test/elm/convert/data.cql index 35c249ba4..68c1742c6 100644 --- a/test/elm/convert/data.cql +++ b/test/elm/convert/data.cql @@ -81,6 +81,13 @@ define TooLargeDec: ToDecimal('444444444444444444444444444444') define TooSmallDec: ToDecimal('-444444444444444444444444444444') define NullDecimal: ToDecimal((null as String)) define WrongFormat: ToDecimal('+.1') +define ExponentNotation: ToDecimal('1e3') +define ExponentNotationUpper: ToDecimal('1E-8') +define TrailingDecimalPoint: ToDecimal('1.') +define LeadingDecimalPoint: ToDecimal('.1') +define IntegerFormat: ToDecimal('+1') +define DecimalToString: ToString(1.0) +define SmallDecimalToString: ToString(0.00000001) // @Test: ToInteger define NoSign: ToInteger('12345') @@ -206,6 +213,8 @@ define IsNull: ConvertsToDateTime(null as DateTime) define IsTrue: ConvertsToDecimal('0.1') define IsFalse: ConvertsToDecimal('foo') define IsNull: ConvertsToDecimal(null as Decimal) +define ExponentNotation: ConvertsToDecimal('1e3') +define DecimalFormat: ConvertsToDecimal('1.0') // @Test: ConvertsToInteger define IsTrue: ConvertsToInteger('101') diff --git a/test/elm/convert/data.js b/test/elm/convert/data.js index bc8abadd2..764975694 100644 --- a/test/elm/convert/data.js +++ b/test/elm/convert/data.js @@ -3854,6 +3854,13 @@ define TooLargeDec: ToDecimal('444444444444444444444444444444') define TooSmallDec: ToDecimal('-444444444444444444444444444444') define NullDecimal: ToDecimal((null as String)) define WrongFormat: ToDecimal('+.1') +define ExponentNotation: ToDecimal('1e3') +define ExponentNotationUpper: ToDecimal('1E-8') +define TrailingDecimalPoint: ToDecimal('1.') +define LeadingDecimalPoint: ToDecimal('.1') +define IntegerFormat: ToDecimal('+1') +define DecimalToString: ToString(1.0) +define SmallDecimalToString: ToString(0.00000001) */ module.exports['ToDecimal'] = { @@ -3868,7 +3875,7 @@ module.exports['ToDecimal'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "285", + "r" : "354", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -4350,6 +4357,330 @@ module.exports['ToDecimal'] = { "annotation" : [ ] } } + }, { + "localId" : "295", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "ExponentNotation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "295", + "s" : [ { + "value" : [ "", "define ", "ExponentNotation", ": " ] + }, { + "r" : "301", + "s" : [ { + "value" : [ "ToDecimal", "(" ] + }, { + "r" : "296", + "s" : [ { + "value" : [ "'1e3'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToDecimal", + "localId" : "301", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "302", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "296", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "1e3", + "annotation" : [ ] + } + } + }, { + "localId" : "305", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "ExponentNotationUpper", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "305", + "s" : [ { + "value" : [ "", "define ", "ExponentNotationUpper", ": " ] + }, { + "r" : "311", + "s" : [ { + "value" : [ "ToDecimal", "(" ] + }, { + "r" : "306", + "s" : [ { + "value" : [ "'1E-8'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToDecimal", + "localId" : "311", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "312", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "306", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "1E-8", + "annotation" : [ ] + } + } + }, { + "localId" : "315", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "TrailingDecimalPoint", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "315", + "s" : [ { + "value" : [ "", "define ", "TrailingDecimalPoint", ": " ] + }, { + "r" : "321", + "s" : [ { + "value" : [ "ToDecimal", "(" ] + }, { + "r" : "316", + "s" : [ { + "value" : [ "'1.'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToDecimal", + "localId" : "321", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "322", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "316", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "1.", + "annotation" : [ ] + } + } + }, { + "localId" : "325", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "LeadingDecimalPoint", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "325", + "s" : [ { + "value" : [ "", "define ", "LeadingDecimalPoint", ": " ] + }, { + "r" : "331", + "s" : [ { + "value" : [ "ToDecimal", "(" ] + }, { + "r" : "326", + "s" : [ { + "value" : [ "'.1'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToDecimal", + "localId" : "331", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "332", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "326", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : ".1", + "annotation" : [ ] + } + } + }, { + "localId" : "335", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "IntegerFormat", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "335", + "s" : [ { + "value" : [ "", "define ", "IntegerFormat", ": " ] + }, { + "r" : "341", + "s" : [ { + "value" : [ "ToDecimal", "(" ] + }, { + "r" : "336", + "s" : [ { + "value" : [ "'+1'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToDecimal", + "localId" : "341", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "342", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "336", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "+1", + "annotation" : [ ] + } + } + }, { + "localId" : "345", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "DecimalToString", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "345", + "s" : [ { + "value" : [ "", "define ", "DecimalToString", ": " ] + }, { + "r" : "350", + "s" : [ { + "r" : "346", + "value" : [ "ToString", "(", "1.0", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToString", + "localId" : "350", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "351", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "346", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + } + }, { + "localId" : "354", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "name" : "SmallDecimalToString", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "354", + "s" : [ { + "value" : [ "", "define ", "SmallDecimalToString", ": " ] + }, { + "r" : "359", + "s" : [ { + "r" : "355", + "value" : [ "ToString", "(", "0.00000001", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ToString", + "localId" : "359", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "360", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "355", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.00000001", + "annotation" : [ ] + } + } } ] } } @@ -10503,6 +10834,8 @@ context Patient define IsTrue: ConvertsToDecimal('0.1') define IsFalse: ConvertsToDecimal('foo') define IsNull: ConvertsToDecimal(null as Decimal) +define ExponentNotation: ConvertsToDecimal('1e3') +define DecimalFormat: ConvertsToDecimal('1.0') */ module.exports['ConvertsToDecimal'] = { @@ -10517,7 +10850,7 @@ module.exports['ConvertsToDecimal'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "234", + "r" : "255", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -10752,6 +11085,102 @@ module.exports['ConvertsToDecimal'] = { } } } + }, { + "localId" : "245", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "name" : "ExponentNotation", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "245", + "s" : [ { + "value" : [ "", "define ", "ExponentNotation", ": " ] + }, { + "r" : "251", + "s" : [ { + "value" : [ "ConvertsToDecimal", "(" ] + }, { + "r" : "246", + "s" : [ { + "value" : [ "'1e3'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ConvertsToDecimal", + "localId" : "251", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "252", + "name" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "246", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "1e3", + "annotation" : [ ] + } + } + }, { + "localId" : "255", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "name" : "DecimalFormat", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "255", + "s" : [ { + "value" : [ "", "define ", "DecimalFormat", ": " ] + }, { + "r" : "261", + "s" : [ { + "value" : [ "ConvertsToDecimal", "(" ] + }, { + "r" : "256", + "s" : [ { + "value" : [ "'1.0'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ConvertsToDecimal", + "localId" : "261", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "262", + "name" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "256", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "1.0", + "annotation" : [ ] + } + } } ] } } diff --git a/test/util/immutableUtil-test.ts b/test/util/immutableUtil-test.ts index f7463ce5c..be3adfb50 100644 --- a/test/util/immutableUtil-test.ts +++ b/test/util/immutableUtil-test.ts @@ -37,6 +37,14 @@ describe('ImmutableUtil Tests', () => { immutableIs(iq2, iq3).should.be.false(); }); + it('should normalize fractional unit conversions without JavaScript-number rounding', () => { + const inches = new Quantity(1, '[in_i]'); + const centimeters = new Quantity('2.54', 'cm'); + + equals(inches, centimeters).should.be.true(); + immutableIs(toNormalizedKey(inches), toNormalizedKey(centimeters)).should.be.true(); + }); + it('should properly match ratios', () => { const r1 = new Ratio(new Quantity(1, 'km'), new Quantity(1, 'h')); const r2 = new Ratio(new Quantity(1000, 'm'), new Quantity(60, 'min')); diff --git a/test/util/math-test.ts b/test/util/math-test.ts index a6e6d3629..56305f115 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -1,7 +1,7 @@ import { Uncertainty } from '../../src/datatypes/uncertainty'; import { MAX_FLOAT_VALUE, MIN_FLOAT_VALUE } from '../../src/util/limits'; import { Decimal } from '../../src/datatypes/decimal'; -import { predecessor, successor } from '../../src/util/math'; +import { finalizeNumericResult, predecessor, successor } from '../../src/util/math'; describe('successor', () => { it('should preserve integers in an Uncertainty', () => { @@ -40,3 +40,22 @@ describe('predecessor', () => { result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(1.99999999))); }); }); + +describe('finalizeNumericResult', () => { + it('should normalize Decimal results to eight places using the implicit rounding mode', () => { + const result = finalizeNumericResult(Decimal.from('1.234567895')); + + result.should.equalDecimal(Decimal.from('1.23456790')); + }); + + it('should return a new normalized Uncertainty without modifying the input', () => { + const input = new Uncertainty(Decimal.from('1.234567895'), Decimal.from('2.345678995')); + const result = finalizeNumericResult(input); + + result.should.not.equal(input); + input.low.should.equalDecimal(Decimal.from('1.234567895')); + input.high.should.equalDecimal(Decimal.from('2.345678995')); + result.low.should.equalDecimal(Decimal.from('1.23456790')); + result.high.should.equalDecimal(Decimal.from('2.34567900')); + }); +}); From 1c075ff9e2896882b88dde82b0e57bee718eaf4a Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 26 Aug 2026 16:36:48 -0400 Subject: [PATCH 13/62] one more round of cleanup --- src/datatypes/decimal.ts | 20 ++-- src/elm/arithmetic.ts | 18 ++- src/elm/literal.ts | 2 +- test/datatypes/decimal-test.ts | 15 +++ test/elm/arithmetic/arithmetic-test.ts | 12 ++ test/elm/arithmetic/data.cql | 3 + test/elm/arithmetic/data.js | 154 ++++++++++++++++++++++++- 7 files changed, 207 insertions(+), 17 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 5d0a99ec0..e72e6eeb9 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -1,24 +1,26 @@ import { Decimal as DecimalJS } from 'decimal.js'; -// Default precision is set to 30 significant figures. (Not decimal places) -// MAX_DECIMAL_VALUE = 99999999999999999999.99999999 is 28 significant figures, -// 30 is just a cleaner number. -DecimalJS.set({ precision: 30 }); +// Use a clone rather than DecimalJS.set because decimal.js configuration is otherwise global. +// This keeps our settings from changing the behavior of other decimal.js instances in +// the same process. +// Precision is significant figures (not decimal places); +// CQL's maximum Decimal value has 28 significant figures, 30 is just a cleaner number. +const CQLDecimalJS = DecimalJS.clone({ precision: 30 }); export type DecimalInput = Decimal | string | number | bigint; export type DecimalRoundingMode = DecimalJS.Rounding; -const MIN_PRECISION_VALUE = DecimalJS.pow(10, -8); +const MIN_PRECISION_VALUE = CQLDecimalJS.pow(10, -8); const CQL_IMPLICIT_SCALE = 8; -const CQL_IMPLICIT_ROUNDING = DecimalJS.ROUND_HALF_UP; +const CQL_IMPLICIT_ROUNDING = CQLDecimalJS.ROUND_HALF_UP; export class Decimal { private value: DecimalJS; private constructor(value: string | number | bigint | DecimalJS) { - this.value = new DecimalJS(value); + this.value = new CQLDecimalJS(value); if (!this.value.isFinite()) { throw new Error('Cannot create a decimal with a non-finite value'); } @@ -167,10 +169,10 @@ export class Decimal { // ROUND_HALF_CEIL "Rounds towards nearest neighbour. If equidistant, rounds towards Infinity" // rounds 0.5 -> 1.0, -0.5 -> 0.0 // https://mikemcl.github.io/decimal.js/#modes - return this.setScale(scale, DecimalJS.ROUND_HALF_CEIL); + return this.setScale(scale, CQLDecimalJS.ROUND_HALF_CEIL); } - setScale(scale: number, roundingMode: DecimalRoundingMode = DecimalJS.ROUND_DOWN) { + setScale(scale: number, roundingMode: DecimalRoundingMode = CQLDecimalJS.ROUND_DOWN) { if (!Number.isInteger(scale) || scale < 0) { throw new RangeError('Decimal scale must be a non-negative integer'); } diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index c0d7f796a..ffff1a73f 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -216,7 +216,8 @@ export class Ceiling extends Expression { return null; } - return arg.isDecimal ? arg.ceil() : Math.ceil(arg); + const ceiling = arg.isDecimal ? arg.ceil() : Math.ceil(arg); + return MathUtil.isValidInteger(ceiling) ? ceiling : null; } } @@ -231,7 +232,8 @@ export class Floor extends Expression { return null; } - return arg.isDecimal ? arg.floor() : Math.floor(arg); + const floor = arg.isDecimal ? arg.floor() : Math.floor(arg); + return MathUtil.isValidInteger(floor) ? floor : null; } } @@ -246,7 +248,15 @@ export class Truncate extends Expression { return null; } - return arg.isDecimal ? arg.truncate() : arg >= 0 ? Math.floor(arg) : Math.ceil(arg); + let truncated; + if (arg.isDecimal) { + truncated = arg.truncate(); + } else if (arg >= 0) { + truncated = Math.floor(arg); + } else { + truncated = Math.ceil(arg); + } + return MathUtil.isValidInteger(truncated) ? truncated : null; } } export class Abs extends Expression { @@ -349,7 +359,7 @@ export class Exp extends Expression { let power; try { - power = Decimal.from(arg).exp().normalized(); + power = Decimal.from(arg).exp(); } catch { return null; } diff --git a/src/elm/literal.ts b/src/elm/literal.ts index dea41feb3..68d0a448c 100644 --- a/src/elm/literal.ts +++ b/src/elm/literal.ts @@ -97,7 +97,7 @@ export class LongLiteral extends Literal { export class DecimalLiteral extends Literal { constructor(json: any) { super(json); - this.value = Decimal.from(this.value); + this.value = Decimal.from(this.value).normalized(); } // Define a simple getter to allow type-checking of this class without instanceof diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 053584fd3..e2682a5ae 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -1,3 +1,4 @@ +import { Decimal as DecimalJS } from 'decimal.js'; import { Decimal } from '../../src/datatypes/decimal'; describe('Decimal', () => { @@ -49,4 +50,18 @@ describe('Decimal', () => { it('should not coerce a nonzero Decimal divisor through a JavaScript number', () => { (() => Decimal.from(1).divideBy('1e-1000')).should.not.throw(); }); + + it('should keep CQL Decimal precision independent from the base decimal.js constructor', () => { + const basePrecision = DecimalJS.precision; + try { + DecimalJS.set({ precision: 5 }); + + const oneThird = Decimal.from(1).divideBy(3); + oneThird.toString().should.equal('0.333333333333333333333333333333'); // we specify precision of 30 = significant figures + + oneThird.normalized().toString().should.equal('0.33333333'); + } finally { + DecimalJS.set({ precision: basePrecision }); + } + }); }); diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 67c861761..092a36c7d 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -517,6 +517,10 @@ describe('Truncate', () => { // NOTE: Truncate returns an integer (not specified to return a Long) (await this.truncTenLong.exec(this.ctx)).should.equal(10); }); + + it('should return null when the result is outside the Integer range', async function () { + should(await this.truncateOverflow.exec(this.ctx)).be.null(); + }); }); describe('Floor', () => { @@ -530,6 +534,10 @@ describe('Floor', () => { // NOTE: Floor returns an Integer (not specified to return a Long) (await this.floorTenLong.exec(this.ctx)).should.equal(10); }); + + it('should return null when the result is outside the Integer range', async function () { + should(await this.floorUnderflow.exec(this.ctx)).be.null(); + }); }); describe('Ceiling', () => { @@ -543,6 +551,10 @@ describe('Ceiling', () => { // Note: Ceiling returns an Integer (not specified to return a Long) (await this.ceilTenLong.exec(this.ctx)).should.equal(10); }); + + it('should return null when the result is outside the Integer range', async function () { + should(await this.ceilingOverflow.exec(this.ctx)).be.null(); + }); }); describe('Ln', () => { diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 8907b069a..7d5e49457 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -123,16 +123,19 @@ define ThreeModZeroDecimal: 3.0 mod 0.0 define Ceil: Ceiling(10.1) define Even: Ceiling(10) define CeilTenLong: Ceiling(10L) +define CeilingOverflow: Ceiling(2147483647.1) // @Test: Floor define flr: Floor(10.1) define Even: Floor(10) define FloorTenLong: Floor(10L) +define FloorUnderflow: Floor(-2147483648.1) // @Test: Truncate define Trunc: Truncate(10.1) define Even: Truncate(10) define TruncTenLong: Truncate(10L) +define TruncateOverflow: Truncate(2147483648.0) // @Test: Abs define Pos: Abs(10) diff --git a/test/elm/arithmetic/data.js b/test/elm/arithmetic/data.js index c87f24008..ccfe850d1 100644 --- a/test/elm/arithmetic/data.js +++ b/test/elm/arithmetic/data.js @@ -7700,6 +7700,7 @@ context Patient define Ceil: Ceiling(10.1) define Even: Ceiling(10) define CeilTenLong: Ceiling(10L) +define CeilingOverflow: Ceiling(2147483647.1) */ module.exports['Ceiling'] = { @@ -7714,7 +7715,7 @@ module.exports['Ceiling'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "238", + "r" : "253", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -7934,6 +7935,48 @@ module.exports['Ceiling'] = { } } } + }, { + "localId" : "253", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "CeilingOverflow", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "253", + "s" : [ { + "value" : [ "", "define ", "CeilingOverflow", ": " ] + }, { + "r" : "258", + "s" : [ { + "r" : "254", + "value" : [ "Ceiling", "(", "2147483647.1", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Ceiling", + "localId" : "258", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "259", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "254", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2147483647.1", + "annotation" : [ ] + } + } } ] } } @@ -7946,6 +7989,7 @@ context Patient define flr: Floor(10.1) define Even: Floor(10) define FloorTenLong: Floor(10L) +define FloorUnderflow: Floor(-2147483648.1) */ module.exports['Floor'] = { @@ -7960,7 +8004,7 @@ module.exports['Floor'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "238", + "r" : "253", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8180,6 +8224,67 @@ module.exports['Floor'] = { } } } + }, { + "localId" : "253", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "FloorUnderflow", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "253", + "s" : [ { + "value" : [ "", "define ", "FloorUnderflow", ": " ] + }, { + "r" : "260", + "s" : [ { + "value" : [ "Floor", "(" ] + }, { + "r" : "254", + "s" : [ { + "r" : "255", + "value" : [ "-", "2147483648.1" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Floor", + "localId" : "260", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "261", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Negate", + "localId" : "254", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "256", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "255", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2147483648.1", + "annotation" : [ ] + } + } + } } ] } } @@ -8192,6 +8297,7 @@ context Patient define Trunc: Truncate(10.1) define Even: Truncate(10) define TruncTenLong: Truncate(10L) +define TruncateOverflow: Truncate(2147483648.0) */ module.exports['Truncate'] = { @@ -8206,7 +8312,7 @@ module.exports['Truncate'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "238", + "r" : "253", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8426,6 +8532,48 @@ module.exports['Truncate'] = { } } } + }, { + "localId" : "253", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "TruncateOverflow", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "253", + "s" : [ { + "value" : [ "", "define ", "TruncateOverflow", ": " ] + }, { + "r" : "258", + "s" : [ { + "r" : "254", + "value" : [ "Truncate", "(", "2147483648.0", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Truncate", + "localId" : "258", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "259", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "254", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2147483648.0", + "annotation" : [ ] + } + } } ] } } From 95ad9ed34e037660c625da3ceb4bf7d23d1c83bb Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 08:40:15 -0400 Subject: [PATCH 14/62] Low-hanging fruit to get interval tests passing --- src/elm/interval.ts | 19 +- .../cql/CqlIntervalOperatorsTest.cql | 48 +- .../cql/CqlIntervalOperatorsTest.json | 2656 ++++++++++++++--- test/spec-tests/skip-list.txt | 25 +- 4 files changed, 2291 insertions(+), 457 deletions(-) diff --git a/src/elm/interval.ts b/src/elm/interval.ts index cea2cf1a7..c7f53a91d 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -453,10 +453,17 @@ export class Expand extends Expression { return null; } - // CQL 1.5 introduced an overload to allow singular intervals; make it a list so we can use the same logic for either overload - if (!Array.isArray(intervals)) { + const isSingleInterval = !Array.isArray(intervals); + // CQL 1.5 introduced an overload to allow singular intervals; make it a list so we can use the same logic for either overload. + if (isSingleInterval) { intervals = [intervals]; } + + // If the list of intervals is empty, the result is empty. + if (intervals.length === 0) { + return []; + } + const type = intervalListType(intervals); if (type === 'mismatch') { throw new Error('List of intervals contains mismatched types.'); @@ -508,6 +515,14 @@ export class Expand extends Expression { results.push(...(items || [])); } + // If the input argument is an interval, rather than a list of intervals, + // the result is a list of points, rather than a list of intervals. + // In this case, the calculation is performed the same way, + // but the starting point of each resulting interval is returned, rather than the interval. + if (isSingleInterval) { + return results.map(i => i.start()); + } + return results; } diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql index 1f15520ab..eb465ed41 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql @@ -247,11 +247,9 @@ define "Expand": Tuple{ output: null }, "ExpandEmptyList": Tuple{ - skipped: 'Wrong answer (should be empty list)' - /* expression: expand { }, output: { } - */ }, + }, "ExpandListWithNull": Tuple{ skipped: 'Wrong answer (should be empty list due to removing nulls)' /* @@ -263,61 +261,49 @@ define "Expand": Tuple{ output: { Interval[@2018-01-01, @2018-01-01], Interval[@2018-01-02, @2018-01-02], Interval[@2018-01-03, @2018-01-03], Interval[@2018-01-04, @2018-01-04] } }, "ExpandPerDayIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[@2018-01-01, @2018-01-04] per day, output: { @2018-01-01, @2018-01-02, @2018-01-03, @2018-01-04 } - */ }, + }, "ExpandPer2Days": Tuple{ expression: expand { Interval[@2018-01-01, @2018-01-04] } per 2 days, output: { Interval[@2018-01-01, @2018-01-02], Interval[@2018-01-03, @2018-01-04] } }, "ExpandPer2DaysIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[@2018-01-01, @2018-01-04] per 2 days, output: { @2018-01-01, @2018-01-03 } - */ }, + }, "ExpandPerHour": Tuple{ expression: expand { Interval[@T10:00, @T12:30] } per hour, output: { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } }, "ExpandPerHourIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[@T10:00, @T12:30] per hour, output: { @T10, @T11, @T12 } - */ }, + }, "ExpandPerHourOpen": Tuple{ expression: expand { Interval[@T10:00, @T12:30) } per hour, output: { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } }, "ExpandPerHourOpenIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[@T10:00, @T12:30) per hour, output: { @T10, @T11, @T12 } - */ }, + }, "ExpandPer1": Tuple{ expression: expand { Interval[10.0, 12.5] } per 1, output: { Interval[10, 10], Interval[11, 11], Interval[12, 12] } }, "ExpandPer1IntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[10.0, 12.5] per 1, output: { 10, 11, 12 } - */ }, + }, "ExpandPer1Open": Tuple{ expression: expand { Interval[10.0, 12.5) } per 1, output: { Interval[10, 10], Interval[11, 11], Interval[12, 12] } }, "ExpandPer1OpenIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[10.0, 12.5) per 1, output: { 10, 11, 12 } - */ }, + }, "ExpandPerMinute": Tuple{ expression: expand { Interval[@T10, @T10] } per minute, output: { } @@ -327,13 +313,13 @@ define "Expand": Tuple{ output: { } }, "ExpandPer0D1": Tuple{ - skipped: 'Wrong answer (interval elements\'s decimals do not match expected output)' + skipped: 'Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705' /* expression: expand { Interval[10, 10] } per 0.1, output: { Interval[10.0, 10.0], Interval[10.1, 10.1], Interval[10.2, 10.2], Interval[10.3, 10.3], Interval[10.4, 10.4], Interval[10.5, 10.5], Interval[10.6, 10.6], Interval[10.7, 10.7], Interval[10.8, 10.8], Interval[10.9, 10.9] } */ }, "ExpandPer0D1IntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' + skipped: 'Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705' /* expression: expand Interval[10, 10] per 0.1, output: { 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 } @@ -343,41 +329,33 @@ define "Expand": Tuple{ output: { Interval[1, 1], Interval[2, 2], Interval[3, 3], Interval[4, 4], Interval[5, 5], Interval[6, 6], Interval[7, 7], Interval[8, 8], Interval[9, 9], Interval[10, 10] } }, "ExpandIntegerIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[1, 10], output: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } - */ }, + }, "ExpandIntervalOpen": Tuple{ expression: expand { Interval[1, 10) }, output: { Interval[1, 1], Interval[2, 2], Interval[3, 3], Interval[4, 4], Interval[5, 5], Interval[6, 6], Interval[7, 7], Interval[8, 8], Interval[9, 9] } }, "ExpandIntegerOpenIntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[1, 10), output: { 1, 2, 3, 4, 5, 6, 7, 8, 9 } - */ }, + }, "ExpandIntervalPer2": Tuple{ expression: expand { Interval[1, 10] } per 2, output: { Interval[1, 2], Interval[3, 4], Interval[5, 6], Interval[7, 8], Interval[9, 10] } }, "ExpandIntervalPer2IntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[1, 10] per 2, output: { 1, 3, 5, 7, 9 } - */ }, + }, "ExpandIntervalOpenPer2": Tuple{ expression: expand { Interval[1, 10) } per 2, output: { Interval[1, 2], Interval[3, 4], Interval[5, 6], Interval[7, 8] } }, "ExpandIntervalOpenPer2IntervalOverload": Tuple{ - skipped: 'Wrong answer (single interval overload should return list of points)' - /* expression: expand Interval[1, 10) per 2, output: { 1, 3, 5, 7 } - */ } + } } define "Contains": Tuple{ diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.json b/test/spec-tests/cql/CqlIntervalOperatorsTest.json index b229a9370..8fc6eda5e 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.json +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.json @@ -13763,12 +13763,33 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } } } ] @@ -13845,12 +13866,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } } } ] @@ -13908,12 +13946,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } } } ] @@ -13971,12 +14026,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] @@ -14034,12 +14106,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] @@ -14097,12 +14186,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -14160,12 +14266,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -14337,12 +14460,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -14395,25 +14535,6 @@ { "name": "ExpandIntegerOpenIntervalOverload", "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - } - }, - { - "name": "ExpandIntervalPer2", - "annotation": [], "elementType": { "type": "TupleTypeSpecifier", "annotation": [], @@ -14425,13 +14546,9 @@ "type": "ListTypeSpecifier", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } } }, @@ -14442,13 +14559,9 @@ "type": "ListTypeSpecifier", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } } } @@ -14456,26 +14569,87 @@ } }, { - "name": "ExpandIntervalPer2IntervalOverload", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - } - }, - { - "name": "ExpandIntervalOpenPer2", + "name": "ExpandIntervalPer2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + } + ] + } + }, + { + "name": "ExpandIntervalPer2IntervalOverload", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "ExpandIntervalOpenPer2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14526,12 +14700,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -14586,12 +14777,33 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } } } ] @@ -14668,12 +14880,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } } } ] @@ -14731,12 +14960,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } } } ] @@ -14794,12 +15040,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] @@ -14857,12 +15120,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] @@ -14920,12 +15200,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -14983,12 +15280,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -15160,12 +15474,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -15223,12 +15554,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -15286,12 +15634,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -15349,12 +15714,29 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -15461,25 +15843,130 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (should be empty list)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + }, + "signature": [], + "operand": [ + { + "type": "Query", + "annotation": [], + "source": [ + { + "alias": "X", + "annotation": [], + "expression": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + }, + "element": [] + } + } + ], + "let": [], + "relationship": [], + "return": { + "distinct": false, + "annotation": [], + "expression": { + "type": "As", + "annotation": [], + "signature": [], + "operand": { + "type": "AliasRef", + "name": "X", + "annotation": [] + }, + "asTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + } + } + }, + { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + }, + "element": [] } } ] @@ -15955,40 +16442,6 @@ }, { "name": "ExpandPerDayIntervalOverload", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "skipped", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] - } - } - ] - } - }, - { - "name": "ExpandPer2Days", "value": { "type": "Tuple", "annotation": [], @@ -16003,13 +16456,9 @@ "type": "ListTypeSpecifier", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } }, @@ -16020,13 +16469,9 @@ "type": "ListTypeSpecifier", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } } @@ -16042,128 +16487,379 @@ "type": "ListTypeSpecifier", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, "signature": [], "operand": [ - { - "type": "List", - "annotation": [], - "resultTypeSpecifier": { - "type": "ListTypeSpecifier", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } - } - }, - "element": [ - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } - }, - "low": { - "type": "Date", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2018", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - "high": { - "type": "Date", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2018", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - } - } - } - ] - }, - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 2, - "unit": "days", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "List", - "annotation": [], - "resultTypeSpecifier": { - "type": "ListTypeSpecifier", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [] - } - } - }, - "element": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": true, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "low": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + "high": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + }, + { + "type": "Quantity", + "value": 1, + "unit": "day", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "element": [ + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "ExpandPer2Days", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + "signature": [], + "operand": [ + { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + "element": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": true, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "low": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + "high": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + } + ] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + "element": [ { "type": "Interval", "lowClosed": true, @@ -16306,25 +17002,187 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": true, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "low": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + "high": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + "element": [ + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + } + ] } } ] @@ -16627,25 +17485,162 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": true, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "low": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + }, + "high": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } + } + }, + { + "type": "Quantity", + "value": 1, + "unit": "hour", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "element": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + } + ] } } ] @@ -16948,25 +17943,162 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": false, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "low": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + }, + "high": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } + } + }, + { + "type": "Quantity", + "value": 1, + "unit": "hour", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + "element": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + } + ] } } ] @@ -17217,25 +18349,125 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": true, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + "low": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "10.0", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "12.5", + "annotation": [] + } + }, + { + "type": "Quantity", + "value": 1, + "unit": "1", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + ] } } ] @@ -17486,25 +18718,125 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": false, + "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + "low": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "10.0", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "12.5", + "annotation": [] + } + }, + { + "type": "Quantity", + "value": 1, + "unit": "1", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + ] } } ] @@ -17808,7 +19140,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (interval elements's decimals do not match expected output)", + "value": "Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705", "annotation": [] } } @@ -17842,7 +19174,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", + "value": "Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705", "annotation": [] } } @@ -18296,25 +19628,173 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "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": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + ] } } ] @@ -18738,25 +20218,166 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": false, + "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": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + ] } } ] @@ -19065,25 +20686,139 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "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": "Quantity", + "value": 2, + "unit": "1", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + ] } } ] @@ -19363,25 +21098,132 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (single interval overload should return list of points)", - "annotation": [] + "type": "Expand", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "signature": [], + "operand": [ + { + "type": "Interval", + "lowClosed": true, + "highClosed": false, + "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": "Quantity", + "value": 2, + "unit": "1", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "List", + "annotation": [], + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + ] } } ] @@ -53485,11 +55327,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "9912", + "localId": "10275", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "9913", + "localId": "10276", "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } @@ -55355,11 +57197,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "10237", + "localId": "10600", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "10238", + "localId": "10601", "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } @@ -81779,11 +83621,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "15175", + "localId": "15538", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "15176", + "localId": "15539", "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 6e8072e7b..ee19feabc 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -9,6 +9,8 @@ CqlIntervalOperatorsTest.ProperContains.TimeProperContainsPrecisionFalse Wrong CqlIntervalOperatorsTest.ProperContains.TimeProperContainsFalse Wrong output: According to spec, a contained point is properly contained as long as the interval is not a unit interval CqlIntervalOperatorsTest.ProperIn.TimeProperInPrecisionFalse Wrong output: According to spec, a contained point is properly in as long as the interval is not a unit interval CqlIntervalOperatorsTest.ProperIn.TimeProperInFalse Wrong output: According to spec, a contained point is properly in as long as the interval is not a unit interval +CqlIntervalOperatorsTest.Expand.ExpandPer0D1 Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 +CqlIntervalOperatorsTest.Expand.ExpandPer0D1IntervalOverload Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 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 @@ -27,20 +29,17 @@ CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: In CqlComparisonOperatorsTest.Equal.DateTimeEqNull Wrong answer (true vs null - due to not evaluating DateTime(null) as null) CqlIntervalOperatorsTest.Collapse.TestCollapseNull Wrong answer (Interval(null, null) vs null) CqlIntervalOperatorsTest.Except.NullInterval Wrong answer (Interval(null, null) vs null) -CqlIntervalOperatorsTest.Expand.ExpandEmptyList Wrong answer (should be empty list) -CqlIntervalOperatorsTest.Expand.ExpandIntegerIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandIntegerOpenIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandIntervalOpenPer2IntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandIntervalPer2IntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandIntegerIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandIntegerOpenIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandIntervalOpenPer2IntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandIntervalPer2IntervalOverload Wrong answer (single interval overload should return list of points) CqlIntervalOperatorsTest.Expand.ExpandListWithNull Wrong answer (should be empty list due to removing nulls) -CqlIntervalOperatorsTest.Expand.ExpandPerDayIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPerHourIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPerHourOpenIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPer0D1 Wrong answer (interval elements's decimals do not match expected output) -CqlIntervalOperatorsTest.Expand.ExpandPer0D1IntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPer1IntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPer1OpenIntervalOverload Wrong answer (single interval overload should return list of points) -CqlIntervalOperatorsTest.Expand.ExpandPer2DaysIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPerDayIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPerHourIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPerHourOpenIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPer1IntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPer1OpenIntervalOverload Wrong answer (single interval overload should return list of points) +# CqlIntervalOperatorsTest.Expand.ExpandPer2DaysIntervalOverload Wrong answer (single interval overload should return list of points) CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong answer (Interval[5, 10] vs Interval[5, null)) CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime1 Wrong answer (different offsets) From 8c25d28db39b370a5d624244406024258a3910c6 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 09:49:13 -0400 Subject: [PATCH 15/62] just a couple more tests --- test/datatypes/datetime-test.ts | 4 + test/datatypes/decimal-test.ts | 5 + test/elm/aggregate/aggregate-test.ts | 9 + test/elm/aggregate/data.cql | 2 + test/elm/aggregate/data.js | 298 ++++++++++++++++++++++--- test/elm/arithmetic/arithmetic-test.ts | 4 + test/elm/arithmetic/data.cql | 1 + test/elm/arithmetic/data.js | 66 +++++- 8 files changed, 351 insertions(+), 38 deletions(-) diff --git a/test/datatypes/datetime-test.ts b/test/datatypes/datetime-test.ts index e771a8aca..cc3105cb3 100644 --- a/test/datatypes/datetime-test.ts +++ b/test/datatypes/datetime-test.ts @@ -219,6 +219,10 @@ describe('DateTime', () => { DateTime.fromJSDate(new Date(Date.UTC(1999, 1, 16, 13, 56, 24, 123)), +4.5).should.eql( DateTime.parse('1999-02-16T18:26:24.123+04:30') ); + DateTime.fromJSDate( + new Date(Date.UTC(1999, 1, 16, 13, 56, 24, 123)), + Decimal.from(-5) + ).should.eql(DateTime.parse('1999-02-16T08:56:24.123-05:00')); }); it('should construct from a Luxon DateTime', () => diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index e2682a5ae..171ca129d 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -42,6 +42,11 @@ describe('Decimal', () => { Decimal.from('8').log(2).should.equalDecimal(Decimal.from(3)); }); + it('should reject an invalid scale', () => { + (() => Decimal.from(1).setScale(-1)).should.throw(RangeError); + (() => Decimal.from(1).setScale(1.5)).should.throw(RangeError); + }); + it('should reject non-finite and divide-by-zero values', () => { (() => Decimal.from('not a number')).should.throw(); (() => Decimal.from(1).divideBy(0)).should.throw(); diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 5f946e4cc..f9300bc0c 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -420,6 +420,15 @@ describe('Mode', () => { (await this.bi_modal.exec(this.ctx)).should.eql([2, 3]); }); + it('should preserve units for single and tied quantity modes', async function () { + validateQuantity(await this.quantitySingleMode.exec(this.ctx), 1, 'g'); + + const modes = await this.quantityBiModal.exec(this.ctx); + modes.should.have.length(2); + validateQuantity(modes[0], 1, 'g'); + validateQuantity(modes[1], 2, 'g'); + }); + it('should be null if some are numbers and some are quantities', async function () { should(await this.numbersAndQuantities.exec(this.ctx)).be.null(); }); diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index 61eeffe92..48c754ae4 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -112,6 +112,8 @@ define has_null: Mode({1,null,null,2,2}) define empty: Mode({}) define bi_modal: Mode({1,2,2,2,3,3,3,4,5}) +define QuantitySingleMode: Mode({1.0 'g', 1.0 'g', 2.0 'g'}) +define QuantityBiModal: Mode({1.0 'g', 1.0 'g', 2.0 'g', 2.0 'g'}) define NumbersAndQuantities: Mode({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Mode({1 'mg/d', 0.002 '/d'}) diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index 5f063253c..f3ef86c20 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -11421,6 +11421,8 @@ define has_null: Mode({1,null,null,2,2}) define empty: Mode({}) define bi_modal: Mode({1,2,2,2,3,3,3,4,5}) +define QuantitySingleMode: Mode({1.0 'g', 1.0 'g', 2.0 'g'}) +define QuantityBiModal: Mode({1.0 'g', 1.0 'g', 2.0 'g', 2.0 'g'}) define NumbersAndQuantities: Mode({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Mode({1 'mg/d', 0.002 '/d'}) */ @@ -11437,7 +11439,7 @@ module.exports['Mode'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "331", + "r" : "364", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -12026,7 +12028,7 @@ module.exports['Mode'] = { }, { "localId" : "309", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "NumbersAndQuantities", + "name" : "QuantitySingleMode", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -12035,46 +12037,268 @@ module.exports['Mode'] = { "s" : { "r" : "309", "s" : [ { - "value" : [ "", "define ", "NumbersAndQuantities", ": " ] + "value" : [ "", "define ", "QuantitySingleMode", ": " ] }, { - "r" : "326", + "r" : "320", "s" : [ { "value" : [ "Mode", "(" ] }, { "r" : "310", "s" : [ { + "value" : [ "{" ] + }, { "r" : "311", - "value" : [ "{", "1", " ," ] + "s" : [ { + "value" : [ "1.0 ", "'g'" ] + } ] + }, { + "value" : [ ", " ] }, { "r" : "312", + "s" : [ { + "value" : [ "1.0 ", "'g'" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "313", + "s" : [ { + "value" : [ "2.0 ", "'g'" ] + } ] + }, { + "value" : [ "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Mode", + "localId" : "320", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "321", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "322", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "310", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "314", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "315", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Quantity", + "localId" : "311", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 1.0, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "312", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 1.0, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "313", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "g", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "325", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "QuantityBiModal", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "325", + "s" : [ { + "value" : [ "", "define ", "QuantityBiModal", ": " ] + }, { + "r" : "337", + "s" : [ { + "value" : [ "Mode", "(" ] + }, { + "r" : "326", + "s" : [ { + "value" : [ "{" ] + }, { + "r" : "327", + "s" : [ { + "value" : [ "1.0 ", "'g'" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "328", + "s" : [ { + "value" : [ "1.0 ", "'g'" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "329", + "s" : [ { + "value" : [ "2.0 ", "'g'" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "330", + "s" : [ { + "value" : [ "2.0 ", "'g'" ] + } ] + }, { + "value" : [ "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Mode", + "localId" : "337", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "338", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "339", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "326", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "331", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "332", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Quantity", + "localId" : "327", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 1.0, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "328", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 1.0, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "329", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "330", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "g", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "342", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "NumbersAndQuantities", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "342", + "s" : [ { + "value" : [ "", "define ", "NumbersAndQuantities", ": " ] + }, { + "r" : "359", + "s" : [ { + "value" : [ "Mode", "(" ] + }, { + "r" : "343", + "s" : [ { + "r" : "344", + "value" : [ "{", "1", " ," ] + }, { + "r" : "345", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "313", + "r" : "346", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "314", + "r" : "347", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "315", + "r" : "348", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "316", + "r" : "349", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -12089,48 +12313,48 @@ module.exports['Mode'] = { } ], "expression" : { "type" : "Mode", - "localId" : "326", + "localId" : "359", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "327", + "localId" : "360", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "328", + "localId" : "361", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "310", + "localId" : "343", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "320", + "localId" : "353", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "321", + "localId" : "354", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "ToQuantity", - "localId" : "318", + "localId" : "351", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "319", + "localId" : "352", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "311", + "localId" : "344", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -12138,35 +12362,35 @@ module.exports['Mode'] = { } }, { "type" : "Quantity", - "localId" : "312", + "localId" : "345", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "313", + "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "314", + "localId" : "347", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "315", + "localId" : "348", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "316", + "localId" : "349", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -12175,7 +12399,7 @@ module.exports['Mode'] = { } } }, { - "localId" : "331", + "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "IncompatibleUnitsNull", "context" : "Patient", @@ -12184,26 +12408,26 @@ module.exports['Mode'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "331", + "r" : "364", "s" : [ { "value" : [ "", "define ", "IncompatibleUnitsNull", ": " ] }, { - "r" : "341", + "r" : "374", "s" : [ { "value" : [ "Mode", "(" ] }, { - "r" : "332", + "r" : "365", "s" : [ { "value" : [ "{" ] }, { - "r" : "333", + "r" : "366", "s" : [ { "value" : [ "1 ", "'mg/d'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "334", + "r" : "367", "s" : [ { "value" : [ "0.002 ", "'/d'" ] } ] @@ -12218,45 +12442,45 @@ module.exports['Mode'] = { } ], "expression" : { "type" : "Mode", - "localId" : "341", + "localId" : "374", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "342", + "localId" : "375", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "343", + "localId" : "376", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "332", + "localId" : "365", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "335", + "localId" : "368", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "336", + "localId" : "369", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "333", + "localId" : "366", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "mg/d", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "334", + "localId" : "367", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "/d", diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 092a36c7d..f3475e0c1 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -501,6 +501,10 @@ describe('TruncatedDivide', () => { it('should be able to return just the long portion of a dividing a long by an integer', async function () { (await this.tenDivThreeReverseMixed.exec(this.ctx)).should.equal(3n); }); + + it('should truncate quantity division results', async function () { + validateQuantity(await this.quantityTruncatedDivide.exec(this.ctx), 5, '1'); + }); }); describe('Truncate', () => { diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 7d5e49457..6812f7c04 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -108,6 +108,7 @@ define Even: 9 div 3 define TenDivThreeLong: 10L div 3L define TenDivThreeMixed: 10 div 3L define TenDivThreeReverseMixed: 10L div 3 +define QuantityTruncatedDivide: 10.5 'g' div 2.0 'g' // @Test: Modulo define Mod: 3 mod 2 diff --git a/test/elm/arithmetic/data.js b/test/elm/arithmetic/data.js index ccfe850d1..b94eb9583 100644 --- a/test/elm/arithmetic/data.js +++ b/test/elm/arithmetic/data.js @@ -6808,6 +6808,7 @@ define Even: 9 div 3 define TenDivThreeLong: 10L div 3L define TenDivThreeMixed: 10 div 3L define TenDivThreeReverseMixed: 10L div 3 +define QuantityTruncatedDivide: 10.5 'g' div 2.0 'g' */ module.exports['TruncatedDivide'] = { @@ -6822,7 +6823,7 @@ module.exports['TruncatedDivide'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "249", + "r" : "260", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -7186,6 +7187,69 @@ module.exports['TruncatedDivide'] = { } } ] } + }, { + "localId" : "260", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "QuantityTruncatedDivide", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "260", + "s" : [ { + "value" : [ "", "define ", "QuantityTruncatedDivide", ": " ] + }, { + "r" : "261", + "s" : [ { + "r" : "262", + "s" : [ { + "value" : [ "10.5 ", "'g'" ] + } ] + }, { + "value" : [ " div " ] + }, { + "r" : "263", + "s" : [ { + "value" : [ "2.0 ", "'g'" ] + } ] + } ] + } ] + } + } ], + "expression" : { + "type" : "TruncatedDivide", + "localId" : "261", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "264", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "265", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Quantity", + "localId" : "262", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 10.5, + "unit" : "g", + "annotation" : [ ] + }, { + "type" : "Quantity", + "localId" : "263", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 2.0, + "unit" : "g", + "annotation" : [ ] + } ] + } } ] } } From b3eb56d9096e460c41fb6421e8f4eb7dc6dd8ce7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 11:26:30 -0400 Subject: [PATCH 16/62] more cleanup on manual review --- src/elm/interval.ts | 6 +++--- test/elm/convert/convert-test.ts | 1 - test/util/math-test.ts | 16 ++++++++-------- test/util/units-test.ts | 7 ------- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/elm/interval.ts b/src/elm/interval.ts index c7f53a91d..a60f7f080 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -481,12 +481,12 @@ export class Expand extends Expression { if (['time', 'date', 'datetime'].includes(type)) { expandFunction = this.expandDTishInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.getPrecision()); - } else if (['integer', 'long', 'decimal'].includes(type)) { - expandFunction = this.expandNumericInterval; - defaultPer = (_interval: any) => new Quantity(1, '1'); } else if (['quantity'].includes(type)) { expandFunction = this.expandQuantityInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.unit); + } else if (['integer', 'long', 'decimal'].includes(type)) { + expandFunction = this.expandNumericInterval; + defaultPer = (_interval: any) => new Quantity(1, '1'); } else { throw new Error('Interval list type not yet supported.'); } diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index 92a83bad6..f8986052c 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -373,7 +373,6 @@ describe('ToDecimal', () => { }); it('should be null if wrong format (+.1)', async function () { - // TODO: parseFloat is more forgiving than the CQL spec, so this does get converted should(await this.wrongFormat.exec(this.ctx)).be.null(); }); diff --git a/test/util/math-test.ts b/test/util/math-test.ts index 56305f115..ac82ebe3e 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -5,39 +5,39 @@ import { finalizeNumericResult, predecessor, successor } from '../../src/util/ma describe('successor', () => { it('should preserve integers in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0)); + const result = successor(new Uncertainty(1, 2)); result.low.should.equal(2); result.high.should.equal(3); }); it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); - result.low.should.equalDecimal(Decimal.from(1.00000001)); - result.high.should.equalDecimal(Decimal.from(2.00000001)); + result.low.should.equalDecimal(Decimal.from('1.00000001')); + result.high.should.equalDecimal(Decimal.from('2.00000001')); }); it('should leave the uncertainty high unchanged when it overflows', () => { const result = successor(new Uncertainty(Decimal.from(1), MAX_FLOAT_VALUE)); - result.should.eql(new Uncertainty(Decimal.from(1.00000001), MAX_FLOAT_VALUE)); + result.should.eql(new Uncertainty(Decimal.from('1.00000001'), MAX_FLOAT_VALUE)); }); }); describe('predecessor', () => { it('should preserve integers in an Uncertainty', () => { - const result = successor(new Uncertainty(1.0, 2.0)); + const result = successor(new Uncertainty(1, 2)); result.low.should.equal(2); result.high.should.equal(3); }); it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); - result.low.should.equalDecimal(Decimal.from(1.00000001)); - result.high.should.equalDecimal(Decimal.from(2.00000001)); + result.low.should.equalDecimal(Decimal.from('1.00000001')); + result.high.should.equalDecimal(Decimal.from('2.00000001')); }); it('should leave the uncertainty low unchanged when it underflows', () => { const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(2))); - result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(1.99999999))); + result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from('1.99999999'))); }); }); diff --git a/test/util/units-test.ts b/test/util/units-test.ts index 3550a6f25..21c8771c9 100644 --- a/test/util/units-test.ts +++ b/test/util/units-test.ts @@ -135,13 +135,6 @@ describe('convertUnit', () => { result.should.equalDecimal(Decimal.from('0.00018939')); }); - // it('should not truncate precision to 8 decimals when adjustPrecision is false', () => { - // const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]', false); - // result.should.not.equalDecimal(Decimal.from("0.00018939")); - // result.toString().length.should.be.greaterThan(10); - // result.toString().should.startWith('0.000189393939393'); - // }); - it('should return undefined for incompatible units', () => { should(convertUnit(Decimal.from(18), '[in_i]', '[in_i]2')).be.undefined(); }); From a887e94972562841fc930d964f10cabb4f845e0b Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 11:30:53 -0400 Subject: [PATCH 17/62] one more --- src/elm/interval.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elm/interval.ts b/src/elm/interval.ts index a60f7f080..d4288fb70 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -484,7 +484,7 @@ export class Expand extends Expression { } else if (['quantity'].includes(type)) { expandFunction = this.expandQuantityInterval; defaultPer = (interval: any) => new Quantity(1, interval.low.unit); - } else if (['integer', 'long', 'decimal'].includes(type)) { + } else if (['long', 'integer', 'decimal'].includes(type)) { expandFunction = this.expandNumericInterval; defaultPer = (_interval: any) => new Quantity(1, '1'); } else { From 15252124ef196f17f50e14663f5e1f3f0c15b793 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 11:36:15 -0400 Subject: [PATCH 18/62] forgot to save this file --- test/spec-tests/skip-list.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index ee19feabc..642e4f220 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -29,17 +29,7 @@ CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: In CqlComparisonOperatorsTest.Equal.DateTimeEqNull Wrong answer (true vs null - due to not evaluating DateTime(null) as null) CqlIntervalOperatorsTest.Collapse.TestCollapseNull Wrong answer (Interval(null, null) vs null) CqlIntervalOperatorsTest.Except.NullInterval Wrong answer (Interval(null, null) vs null) -# CqlIntervalOperatorsTest.Expand.ExpandIntegerIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandIntegerOpenIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandIntervalOpenPer2IntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandIntervalPer2IntervalOverload Wrong answer (single interval overload should return list of points) CqlIntervalOperatorsTest.Expand.ExpandListWithNull Wrong answer (should be empty list due to removing nulls) -# CqlIntervalOperatorsTest.Expand.ExpandPerDayIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandPerHourIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandPerHourOpenIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandPer1IntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandPer1OpenIntervalOverload Wrong answer (single interval overload should return list of points) -# CqlIntervalOperatorsTest.Expand.ExpandPer2DaysIntervalOverload Wrong answer (single interval overload should return list of points) CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong answer (Interval[5, 10] vs Interval[5, null)) CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime1 Wrong answer (different offsets) From 240f95bf6459ff5074cb1c2f519c63d452adecf0 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 27 Aug 2026 12:06:57 -0400 Subject: [PATCH 19/62] update some comments --- src/datatypes/decimal.ts | 4 ++++ test/elm/interval/interval-test.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index e72e6eeb9..3a04017c5 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -107,10 +107,14 @@ export class Decimal { } successor() { + // TODO: successor should be based on current precision + // For Decimal, successor is equivalent to adding 1 * the precision of the argument. return new Decimal(this.value.add(MIN_PRECISION_VALUE)); } predecessor() { + // TODO: predecessor should be based on current precision + // For Decimal, predecessor is equivalent to subtracting 1 * the precision of the argument. return new Decimal(this.value.minus(MIN_PRECISION_VALUE)); } diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 20bceedd0..77dc2c701 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -3605,8 +3605,8 @@ describe('IntegerIntervalExpand', () => { // https://jira.hl7.org/browse/FHIR-58705 and // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Interval.20Expand.20example/with/619051021 // Note that as of this writing the produced result is { } (empty list) - // which I believe is the correct result. - // But an empty list doesn't clearly show the intent of the test. + // but I believe the correct answer is either { } or { [ Interval[10.0, 10.0 ] } + // depending on whether the size of the interval is based on the precision of the decimals (not currently supported) // define PerDecimalMorePrecise: expand { Interval[10, 10] } per 0.1 const a = await this.perDecimalMorePrecise.exec(this.ctx); From ae241c0629b0f4881851e99d7b8dc9c87dfca2ca Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 3 Sep 2026 17:33:52 -0400 Subject: [PATCH 20/62] Update spec-tests to the latest, plus some minor supporting changes to get a couple more passing --- src/datatypes/datetime.ts | 6 +- src/datatypes/quantity.ts | 4 + test/spec-tests/cql/CqlAggregateTest.cql | 2 +- .../cql/CqlArithmeticFunctionsTest.cql | 130 +- .../cql/CqlArithmeticFunctionsTest.json | 6233 +- .../cql/CqlComparisonOperatorsTest.cql | 291 +- .../cql/CqlComparisonOperatorsTest.json | 9235 ++- .../cql/CqlDateTimeOperatorsTest.cql | 28 +- .../cql/CqlDateTimeOperatorsTest.json | 58068 ++++++++++++---- .../cql/CqlIntervalOperatorsTest.cql | 16 +- .../cql/CqlIntervalOperatorsTest.json | 478 +- .../spec-tests/cql/CqlStringOperatorsTest.cql | 6 + .../cql/CqlStringOperatorsTest.json | 72 + test/spec-tests/cql/CqlTypesTest.cql | 28 +- test/spec-tests/cql/CqlTypesTest.json | 4129 +- test/spec-tests/skip-list.txt | 39 +- test/spec-tests/spec-test.ts | 7 + .../xml/CqlAggregateFunctionsTest.xml | 79 + test/spec-tests/xml/CqlAggregateTest.xml | 23 +- .../xml/CqlArithmeticFunctionsTest.xml | 221 +- .../xml/CqlComparisonOperatorsTest.xml | 318 +- .../xml/CqlConditionalOperatorsTest.xml | 39 + .../xml/CqlDateTimeOperatorsTest.xml | 444 +- .../CqlErrorsAndMessagingOperatorsTest.xml | 6 + .../xml/CqlIntervalOperatorsTest.xml | 453 +- .../xml/CqlLogicalOperatorsTest.xml | 45 + .../xml/CqlNullologicalOperatorsTest.xml | 27 + test/spec-tests/xml/CqlQueryTests.xml | 16 + .../spec-tests/xml/CqlStringOperatorsTest.xml | 102 + test/spec-tests/xml/CqlTypeOperatorsTest.xml | 47 + test/spec-tests/xml/CqlTypesTest.xml | 48 +- .../xml/ValueLiteralsAndSelectors.xml | 81 + 32 files changed, 61751 insertions(+), 18970 deletions(-) diff --git a/src/datatypes/datetime.ts b/src/datatypes/datetime.ts index b8f288895..5b30779cb 100644 --- a/src/datatypes/datetime.ts +++ b/src/datatypes/datetime.ts @@ -20,6 +20,7 @@ import { MIN_TIME_VALUE_STRING } from '../util/limits'; import { Decimal } from './decimal'; +import { equals } from '../util/comparison'; // It's easiest and most performant to organize formats by length of the supported strings. // This way we can test strings only against the formats that have a chance of working. @@ -1274,7 +1275,8 @@ function compareWithDefaultResult(a: any, b: any, defaultResult: any) { } // make a copy of other in the correct timezone offset if they don't match. - if (a.timezoneOffset !== b.timezoneOffset) { + const differentTZ = (a.timeZoneOffset == null) ? (b.timezoneOffset != null) : !(a.timezoneOffset.equals(b.timezoneOffset)); + if (differentTZ) { b = b.convertToTimezoneOffset(a.timezoneOffset); } @@ -1296,7 +1298,7 @@ function compareWithDefaultResult(a: any, b: any, defaultResult: any) { } // if they are different then return with false - if (a[field] !== b[field]) { + if (!equals(a[field], b[field])) { return false; } diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index 190cc1e4e..77eab93db 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -96,6 +96,10 @@ export class Quantity { // same unit, or both are null return this.value.equals(other.value); } else { + // TODO: time-based Quantities are defined to have separate calendar duration semantics, + // not implemented here. + // eg, 1 year == 365 days. (Per UCUM unit conversion, 1 year is 365.25 days) + // https://cql.hl7.org/09-b-cqlreference.html#equal const otherVal = convertUnit(other.value, other.unit, this.unit); if (otherVal == null) { return null; diff --git a/test/spec-tests/cql/CqlAggregateTest.cql b/test/spec-tests/cql/CqlAggregateTest.cql index 62812517e..a4d5d5375 100644 --- a/test/spec-tests/cql/CqlAggregateTest.cql +++ b/test/spec-tests/cql/CqlAggregateTest.cql @@ -18,7 +18,7 @@ define "AggregateTests": Tuple{ aggregate R starting (null as List>): R union ({ M X let S: Max({ end of Last(R) + 1 day, start of X }), - E: S + duration in days of X + E: S + Quantity{ value: duration in days of X, unit: 'days' } return Interval[S, E] }), output: { diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql index cc94b950e..10d8a19ca 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql @@ -92,6 +92,46 @@ define "Ceiling": Tuple{ "Ceiling1I": Tuple{ expression: Ceiling(1), output: 1 + }, + "CeilingMaxInteger": Tuple{ + expression: Ceiling(2147483647), + output: 2147483647 + }, + "CeilingMaxIntegerAsDecimal": Tuple{ + expression: Ceiling(2147483647.0), + output: 2147483647 + }, + "CeilingMaxIntegerAsDecimalWhereDecimalIsNonZero": Tuple{ + expression: Ceiling(2147483647.2), + output: null + }, + "CeilingIntegerGreaterThanMaxInteger": Tuple{ + expression: Ceiling(2147483648), + output: null + }, + "CeilingDecimalGreaterThanMaxInteger": Tuple{ + expression: Ceiling(2147483648.2), + output: null + }, + "CeilingMinInteger": Tuple{ + expression: Ceiling(-2147483648), + output: -2147483648 + }, + "CeilingMinIntegerAsDecimal": Tuple{ + expression: Ceiling(-2147483648.0), + output: -2147483648 + }, + "CeilingMinIntegerAsDecimalWhereDecimalIsNonZero": Tuple{ + expression: Ceiling(-2147483648.2), + output: -2147483648 + }, + "CeilingIntegerLessThanMinInteger": Tuple{ + expression: Ceiling(-2147483649), + output: null + }, + "CeilingDecimalLessThanMinInteger": Tuple{ + expression: Ceiling(-2147483649.2), + output: null } } @@ -178,6 +218,46 @@ define "Floor": Tuple{ "Floor2I": Tuple{ expression: Floor(2), output: 2 + }, + "FloorMaxInteger": Tuple{ + expression: Floor(2147483647), + output: 2147483647 + }, + "FloorMaxIntegerAsDecimal": Tuple{ + expression: Floor(2147483647.0), + output: 2147483647 + }, + "FloorMaxIntegerAsDecimalWhereDecimalIsNonZero": Tuple{ + expression: Floor(2147483647.2), + output: 2147483647 + }, + "FloorIntegerGreaterThanMaxInteger": Tuple{ + expression: Floor(2147483648), + output: null + }, + "FloorDecimalGreaterThanMaxInteger": Tuple{ + expression: Floor(2147483648.2), + output: null + }, + "FloorMinInteger": Tuple{ + expression: Floor(-2147483648), + output: -2147483648 + }, + "FloorMinIntegerAsDecimal": Tuple{ + expression: Floor(-2147483648.0), + output: -2147483648 + }, + "FloorMinIntegerAsDecimalWhereDecimalIsNonZero": Tuple{ + expression: Floor(-2147483648.2), + output: null + }, + "FloorIntegerLessThanMinInteger": Tuple{ + expression: Floor(-2147483649), + output: null + }, + "FloorDecimalLessThanMinInteger": Tuple{ + expression: Floor(-2147483649.2), + output: null } } @@ -240,6 +320,18 @@ define "HighBoundary": Tuple{ /* expression: HighBoundary(@T10:30, 9), output: @T10:30:59.999 + */ }, + "HighBoundaryNull": Tuple{ + skipped: 'HighBoundary not implemented' + /* + expression: HighBoundary(null as Decimal, 8), + output: null + */ }, + "HighBoundaryNullPrecision": Tuple{ + skipped: 'HighBoundary not implemented' + /* + expression: HighBoundary(1.58888, null), + output: 1.58888999 */ } } @@ -306,6 +398,18 @@ define "LowBoundary": Tuple{ /* expression: LowBoundary(@T10:30, 9), output: @T10:30:00.000 + */ }, + "LowBoundaryNull": Tuple{ + skipped: 'LowBoundary not implemented' + /* + expression: LowBoundary(null as Decimal, 8), + output: null + */ }, + "LowBoundaryNullPrecision": Tuple{ + skipped: 'LowBoundary not implemented' + /* + expression: LowBoundary(1.58888, null), + output: 1.58888000 */ } } @@ -590,17 +694,23 @@ define "Predecessor": Tuple{ output: 0L }, "PredecessorOf1D": Tuple{ + skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147' + /* expression: predecessor of 1.0, output: 0.99999999 - }, + */ }, "PredecessorOf101D": Tuple{ + skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + /* expression: predecessor of 1.01, output: 1.00999999 - }, + */ }, "PredecessorOf1QCM": Tuple{ + skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + /* expression: predecessor of 1.0 'cm', output: 0.99999999'cm' - }, + */ }, "PredecessorOfJan12000": Tuple{ expression: predecessor of DateTime(2000,1,1), output: @1999-12-31T @@ -705,7 +815,7 @@ define "Round": Tuple{ }, "RoundNeg0D5": Tuple{ expression: Round(-0.5), - output: 0.0 + output: -1.0 }, "RoundNeg0D4": Tuple{ expression: Round(-0.4), @@ -721,7 +831,7 @@ define "Round": Tuple{ }, "RoundNeg1D5": Tuple{ expression: Round(-1.5), - output: -1.0 + output: -2.0 }, "RoundNeg1D6": Tuple{ expression: Round(-1.6), @@ -774,13 +884,17 @@ define "Successor": Tuple{ output: 2L }, "SuccessorOf1D": Tuple{ + skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + /* expression: successor of 1.0, output: 1.00000001 - }, + */ }, "SuccessorOf101D": Tuple{ + skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + /* expression: successor of 1.01, output: 1.01000001 - }, + */ }, "SuccessorOfJan12000": Tuple{ expression: successor of DateTime(2000,1,1), output: @2000-01-02T @@ -924,7 +1038,7 @@ define "Truncated Divide": Tuple{ output: 2.0 }, "TruncatedDivide10d1ByNeg3D1Quantity": Tuple{ - skipped: 'Wrong output: The resulting Quantity should have an appropriate unit; \'g\' / \'g\' should be \'1\', not \'g\'. See test Divide1Q1Q which is correct' + skipped: 'Wrong output: The resulting Quantity should have an appropriate unit; \'g\' / \'g\' should be \'1\', not \'g\'. See https://github.com/cqframework/cql-tests/pull/148' /* expression: 10.1 'cm' div -3.1 'cm', output: -3.0 'cm' diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json index d09ab84b4..a0552b7d3 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json @@ -2026,6 +2026,2227 @@ } ] } + }, + { + "name": "CeilingMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimal", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimalWhereDecimalIsNonZero", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingIntegerGreaterThanMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalGreaterThanMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimal", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimalWhereDecimalIsNonZero", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingIntegerLessThanMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalLessThanMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "CeilingNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Ceiling1D", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "Ceiling1D1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingNegD1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingNeg1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingNeg1D1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "Ceiling1I", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimal", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimalWhereDecimalIsNonZero", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingIntegerGreaterThanMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalGreaterThanMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimal", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimalWhereDecimalIsNonZero", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingIntegerLessThanMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalLessThanMinInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "CeilingNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "As", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "strict": false, + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + }, + "asTypeSpecifier": { + "type": "NamedTypeSpecifier", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Ceiling1D", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "Ceiling1D1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.1", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingNegD1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "0.1", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingNeg1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "CeilingNeg1D1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.1", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "Ceiling1I", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimal", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483647.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMaxIntegerAsDecimalWhereDecimalIsNonZero", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483647.2", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingIntegerGreaterThanMaxInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalGreaterThanMaxInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483648.2", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingMinInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimal", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483648.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "CeilingMinIntegerAsDecimalWhereDecimalIsNonZero", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483648.2", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "CeilingIntegerLessThanMinInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483649", + "annotation": [] + } + } + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "CeilingDecimalLessThanMinInteger", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Ceiling", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483649.2", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Divide", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DivideNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide01", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide11", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1L1L", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1d1d", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide103", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1Q1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1Q1Q", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10I5D", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10I5I", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10Q5I", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } } ] }, @@ -2037,9 +4258,425 @@ "annotation": [], "element": [ { - "name": "CeilingNull", + "name": "DivideNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide01", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide11", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1L1L", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1d1d", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide103", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1Q1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1Q1Q", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10I5D", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10I5I", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10Q5I", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DivideNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "type": "As", + "asType": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide10", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2048,7 +4685,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2062,12 +4699,60 @@ } } ] - } - }, - { - "name": "Ceiling1D", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide01", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2076,7 +4761,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2085,17 +4770,145 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } ] - } - }, - { - "name": "Ceiling1D1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "0.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide11", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1L1L", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2104,7 +4917,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2113,17 +4926,67 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } ] - } - }, - { - "name": "CeilingNegD1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "1", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1d1d", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2132,7 +4995,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2141,17 +5004,57 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } ] - } - }, - { - "name": "CeilingNeg1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide103", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2160,7 +5063,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2169,45 +5072,80 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } ] - } - }, - { - "name": "CeilingNeg1D1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Round", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "signature": [], + "operand": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + } + ] + }, + "precision": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", "annotation": [] } } - ] - } - }, - { - "name": "Ceiling1I", + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "3.33333333", + "annotation": [] + } + } + ] + } + }, + { + "name": "Divide1Q1", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -2216,7 +5154,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } }, @@ -2225,18 +5163,58 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } - ] - } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "g/cm3", + "annotation": [] + }, + { + "type": "ToQuantity", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "g/cm3", + "annotation": [] + } + } + ] } - ] - }, - "element": [ + }, { - "name": "CeilingNull", + "name": "Divide1Q1Q", "value": { "type": "Tuple", "annotation": [], @@ -2249,7 +5227,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } }, @@ -2258,7 +5236,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -2268,35 +5246,35 @@ { "name": "expression", "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [], "signature": [], - "operand": { - "type": "As", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "strict": false, - "annotation": [], - "signature": [], - "operand": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "g/cm3", "annotation": [] }, - "asTypeSpecifier": { - "type": "NamedTypeSpecifier", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "g/cm3", "annotation": [] } - } + ] } }, { "name": "output", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "1", "annotation": [] } } @@ -2304,7 +5282,7 @@ } }, { - "name": "Ceiling1D", + "name": "Divide10I5D", "value": { "type": "Tuple", "annotation": [], @@ -2317,7 +5295,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2326,7 +5304,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } @@ -2336,26 +5314,40 @@ { "name": "expression", "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [], "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "5.0", + "annotation": [] + } + ] } }, { "name": "output", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2.0", "annotation": [] } } @@ -2363,7 +5355,7 @@ } }, { - "name": "Ceiling1D1", + "name": "Divide10I5I", "value": { "type": "Tuple", "annotation": [], @@ -2376,7 +5368,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } }, @@ -2385,7 +5377,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } @@ -2395,26 +5387,45 @@ { "name": "expression", "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [], "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.1", - "annotation": [] - } + "operand": [ + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2.0", "annotation": [] } } @@ -2422,7 +5433,7 @@ } }, { - "name": "CeilingNegD1", + "name": "Divide10Q5I", "value": { "type": "Tuple", "annotation": [], @@ -2435,7 +5446,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } }, @@ -2444,42 +5455,146 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } - ] - }, + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Divide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 10, + "unit": "g", + "annotation": [] + }, + { + "type": "ToQuantity", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "g", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Floor", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "FloorNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "Floor1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "Floor1D", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "0.1", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2487,225 +5602,91 @@ } }, { - "name": "CeilingNeg1", - "value": { - "type": "Tuple", + "name": "Floor1D1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - }, "element": [ { "name": "expression", - "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } } ] } }, { - "name": "CeilingNeg1D1", - "value": { - "type": "Tuple", + "name": "FloorNegD1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - }, "element": [ { "name": "expression", - "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.1", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } } ] } }, { - "name": "Ceiling1I", - "value": { - "type": "Tuple", + "name": "FloorNeg1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - }, "element": [ { "name": "expression", - "value": { - "type": "Ceiling", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "Divide", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ + }, { - "name": "DivideNull", + "name": "FloorNeg1D1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2716,7 +5697,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2725,7 +5706,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2733,7 +5714,7 @@ } }, { - "name": "Divide10", + "name": "Floor2I", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2744,7 +5725,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2753,7 +5734,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2761,7 +5742,7 @@ } }, { - "name": "Divide01", + "name": "FloorMaxInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2772,7 +5753,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2781,7 +5762,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2789,7 +5770,7 @@ } }, { - "name": "Divide11", + "name": "FloorMaxIntegerAsDecimal", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2800,7 +5781,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2809,7 +5790,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2817,7 +5798,7 @@ } }, { - "name": "Divide1L1L", + "name": "FloorMaxIntegerAsDecimalWhereDecimalIsNonZero", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2828,7 +5809,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2837,7 +5818,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2845,7 +5826,7 @@ } }, { - "name": "Divide1d1d", + "name": "FloorIntegerGreaterThanMaxInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2856,7 +5837,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2865,7 +5846,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -2873,7 +5854,7 @@ } }, { - "name": "Divide103", + "name": "FloorDecimalGreaterThanMaxInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2884,7 +5865,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2893,7 +5874,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -2901,7 +5882,7 @@ } }, { - "name": "Divide1Q1", + "name": "FloorMinInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2912,7 +5893,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2921,7 +5902,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2929,7 +5910,7 @@ } }, { - "name": "Divide1Q1Q", + "name": "FloorMinIntegerAsDecimal", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2940,7 +5921,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2949,7 +5930,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -2957,7 +5938,7 @@ } }, { - "name": "Divide10I5D", + "name": "FloorMinIntegerAsDecimalWhereDecimalIsNonZero", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2968,7 +5949,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -2977,7 +5958,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -2985,7 +5966,7 @@ } }, { - "name": "Divide10I5I", + "name": "FloorIntegerLessThanMinInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -2996,7 +5977,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3005,7 +5986,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -3013,7 +5994,7 @@ } }, { - "name": "Divide10Q5I", + "name": "FloorDecimalLessThanMinInteger", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3024,7 +6005,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3033,7 +6014,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -3041,184 +6022,16 @@ } } ] - }, - "expression": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "DivideNull", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide10", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide01", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide11", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1L1L", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1d1d", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - ] - } - }, + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ { - "name": "Divide103", + "name": "FloorNull", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3229,7 +6042,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3238,7 +6051,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -3246,7 +6059,7 @@ } }, { - "name": "Divide1Q1", + "name": "Floor1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3257,7 +6070,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3266,7 +6079,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -3274,7 +6087,7 @@ } }, { - "name": "Divide1Q1Q", + "name": "Floor1D", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3285,7 +6098,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3294,7 +6107,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -3302,7 +6115,7 @@ } }, { - "name": "Divide10I5D", + "name": "Floor1D1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3313,7 +6126,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3322,7 +6135,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -3330,7 +6143,7 @@ } }, { - "name": "Divide10I5I", + "name": "FloorNegD1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3341,7 +6154,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3350,7 +6163,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -3358,7 +6171,7 @@ } }, { - "name": "Divide10Q5I", + "name": "FloorNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -3369,7 +6182,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3378,97 +6191,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] } - } - ] - }, - "element": [ - { - "name": "DivideNull", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "type": "As", - "asType": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide10", - "value": { - "type": "Tuple", + }, + { + "name": "FloorNeg1D1", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3477,7 +6210,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3486,65 +6219,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide01", - "value": { - "type": "Tuple", + } + }, + { + "name": "Floor2I", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3553,7 +6238,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3561,68 +6246,18 @@ "name": "output", "annotation": [], "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "0.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide11", - "value": { - "type": "Tuple", + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "FloorMaxInteger", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3631,7 +6266,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3640,67 +6275,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1L1L", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorMaxIntegerAsDecimal", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3709,7 +6294,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3718,67 +6303,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "1", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "1", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1d1d", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorMaxIntegerAsDecimalWhereDecimalIsNonZero", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3787,7 +6322,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3796,57 +6331,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide103", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorIntegerGreaterThanMaxInteger", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3855,7 +6350,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3864,80 +6359,45 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Round", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + } + }, + { + "name": "FloorDecimalGreaterThanMaxInteger", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - } - } - ] - }, - "precision": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "3.33333333", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1Q1", - "value": { - "type": "Tuple", + ] + } + }, + { + "name": "FloorMinInteger", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -3946,7 +6406,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -3955,62 +6415,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g/cm3", - "annotation": [] - }, - { - "type": "ToQuantity", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g/cm3", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide1Q1Q", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorMinIntegerAsDecimal", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4019,7 +6434,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -4028,57 +6443,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g/cm3", - "annotation": [] - }, - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g/cm3", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "1", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide10I5D", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorMinIntegerAsDecimalWhereDecimalIsNonZero", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4087,7 +6462,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -4096,62 +6471,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "5.0", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "2.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide10I5I", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorIntegerLessThanMinInteger", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4160,7 +6490,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -4169,67 +6499,17 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "2.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "Divide10Q5I", - "value": { - "type": "Tuple", + } + }, + { + "name": "FloorDecimalLessThanMinInteger", "annotation": [], - "resultTypeSpecifier": { + "elementType": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4238,7 +6518,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -4247,258 +6527,78 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Divide", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 10, - "unit": "g", - "annotation": [] - }, - { - "type": "ToQuantity", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 2, - "unit": "g", - "annotation": [] - } - } - ] + } } - } - ] - } - }, - { - "name": "Floor", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], + ] + }, "element": [ { "name": "FloorNull", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - } - }, - { - "name": "Floor1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - } - }, - { - "name": "Floor1D", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - } - }, - { - "name": "Floor1D1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - } - }, - { - "name": "FloorNegD1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - } - }, - { - "name": "FloorNeg1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - } - ] - } - }, - { - "name": "FloorNeg1D1", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", + "value": { + "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "As", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "strict": false, + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + }, + "asTypeSpecifier": { + "type": "NamedTypeSpecifier", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } } }, { "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4506,46 +6606,75 @@ } }, { - "name": "Floor2I", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", + "name": "Floor1", + "value": { + "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } } }, { "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } } ] } - } - ] - }, - "expression": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "FloorNull", + }, + { + "name": "Floor1D", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4563,17 +6692,48 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] - } - }, - { - "name": "Floor1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "Floor1D1", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4596,12 +6756,43 @@ } } ] - } - }, - { - "name": "Floor1D", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.1", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "FloorNegD1", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4624,12 +6815,55 @@ } } ] - } - }, - { - "name": "Floor1D1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "0.1", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "FloorNeg1", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4652,12 +6886,55 @@ } } ] - } - }, - { - "name": "FloorNegD1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "FloorNeg1D1", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4680,12 +6957,55 @@ } } ] - } - }, - { - "name": "FloorNeg1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.1", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "Floor2I", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4708,12 +7028,48 @@ } } ] - } - }, - { - "name": "FloorNeg1D1", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "FloorMaxInteger", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4736,12 +7092,48 @@ } } ] - } - }, - { - "name": "Floor2I", + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + ] + } + }, + { + "name": "FloorMaxIntegerAsDecimal", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -4764,13 +7156,39 @@ } } ] - } + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Floor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483647.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", + "annotation": [] + } + } + ] } - ] - }, - "element": [ + }, { - "name": "FloorNull", + "name": "FloorMaxIntegerAsDecimalWhereDecimalIsNonZero", "value": { "type": "Tuple", "annotation": [], @@ -4792,7 +7210,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -4803,34 +7221,25 @@ "name": "expression", "value": { "type": "Floor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "As", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "strict": false, - "annotation": [], - "signature": [], - "operand": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - }, - "asTypeSpecifier": { - "type": "NamedTypeSpecifier", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483647.2", + "annotation": [] } } }, { "name": "output", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483647", "annotation": [] } } @@ -4838,7 +7247,7 @@ } }, { - "name": "Floor1", + "name": "FloorIntegerGreaterThanMaxInteger", "value": { "type": "Tuple", "annotation": [], @@ -4860,7 +7269,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4882,7 +7291,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "2147483648", "annotation": [] } } @@ -4891,10 +7300,8 @@ { "name": "output", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4902,7 +7309,7 @@ } }, { - "name": "Floor1D", + "name": "FloorDecimalGreaterThanMaxInteger", "value": { "type": "Tuple", "annotation": [], @@ -4924,7 +7331,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4942,7 +7349,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "2147483648.2", "annotation": [] } } @@ -4950,10 +7357,8 @@ { "name": "output", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4961,7 +7366,7 @@ } }, { - "name": "Floor1D1", + "name": "FloorMinInteger", "value": { "type": "Tuple", "annotation": [], @@ -4998,29 +7403,46 @@ "annotation": [], "signature": [], "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.1", - "annotation": [] + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } + } } } }, { "name": "output", "value": { - "type": "Literal", + "type": "Negate", "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483648", + "annotation": [] + } } } ] } }, { - "name": "FloorNegD1", + "name": "FloorMinIntegerAsDecimal", "value": { "type": "Tuple", "annotation": [], @@ -5065,7 +7487,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "0.1", + "value": "2147483648.0", "annotation": [] } } @@ -5082,7 +7504,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "2147483648", "annotation": [] } } @@ -5091,7 +7513,7 @@ } }, { - "name": "FloorNeg1", + "name": "FloorMinIntegerAsDecimalWhereDecimalIsNonZero", "value": { "type": "Tuple", "annotation": [], @@ -5113,7 +7535,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -5136,7 +7558,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "2147483648.2", "annotation": [] } } @@ -5145,24 +7567,16 @@ { "name": "output", "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] } } ] } }, { - "name": "FloorNeg1D1", + "name": "FloorIntegerLessThanMinInteger", "value": { "type": "Tuple", "annotation": [], @@ -5184,7 +7598,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -5199,16 +7613,21 @@ "annotation": [], "signature": [], "operand": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "type": "ToDecimal", "annotation": [], "signature": [], "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.1", - "annotation": [] + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2147483649", + "annotation": [] + } } } } @@ -5216,24 +7635,16 @@ { "name": "output", "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] } } ] } }, { - "name": "Floor2I", + "name": "FloorDecimalLessThanMinInteger", "value": { "type": "Tuple", "annotation": [], @@ -5255,7 +7666,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -5270,14 +7681,15 @@ "annotation": [], "signature": [], "operand": { - "type": "ToDecimal", + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [], "signature": [], "operand": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2147483649.2", "annotation": [] } } @@ -5286,10 +7698,8 @@ { "name": "output", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -6417,6 +8827,44 @@ } ] } + }, + { + "name": "HighBoundaryNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "HighBoundaryNullPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } } ] }, @@ -6468,7 +8916,88 @@ { "name": "HighBoundaryDateTimeMillisecond", "annotation": [], - "elementType": { + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "HighBoundaryTimeMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "HighBoundaryNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "HighBoundaryNullPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "HighBoundaryDecimal", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -6482,12 +9011,27 @@ } } ] - } - }, - { - "name": "HighBoundaryTimeMillisecond", + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "HighBoundary not implemented", + "annotation": [] + } + } + ] + } + }, + { + "name": "HighBoundaryDateMonth", + "value": { + "type": "Tuple", "annotation": [], - "elementType": { + "resultTypeSpecifier": { "type": "TupleTypeSpecifier", "annotation": [], "element": [ @@ -6501,13 +9045,23 @@ } } ] - } + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "HighBoundary not implemented", + "annotation": [] + } + } + ] } - ] - }, - "element": [ + }, { - "name": "HighBoundaryDecimal", + "name": "HighBoundaryDateTimeMillisecond", "value": { "type": "Tuple", "annotation": [], @@ -6541,7 +9095,7 @@ } }, { - "name": "HighBoundaryDateMonth", + "name": "HighBoundaryTimeMillisecond", "value": { "type": "Tuple", "annotation": [], @@ -6575,7 +9129,7 @@ } }, { - "name": "HighBoundaryDateTimeMillisecond", + "name": "HighBoundaryNull", "value": { "type": "Tuple", "annotation": [], @@ -6609,7 +9163,7 @@ } }, { - "name": "HighBoundaryTimeMillisecond", + "name": "HighBoundaryNullPrecision", "value": { "type": "Tuple", "annotation": [], @@ -7949,6 +10503,44 @@ } ] } + }, + { + "name": "LowBoundaryNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "LowBoundaryNullPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } } ] }, @@ -8034,6 +10626,44 @@ } ] } + }, + { + "name": "LowBoundaryNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "LowBoundaryNullPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } } ] }, @@ -8173,6 +10803,74 @@ } ] } + }, + { + "name": "LowBoundaryNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "LowBoundary not implemented", + "annotation": [] + } + } + ] + } + }, + { + "name": "LowBoundaryNullPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "LowBoundary not implemented", + "annotation": [] + } + } + ] + } } ] } @@ -15614,20 +18312,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -15642,20 +18331,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -15670,20 +18350,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -15931,20 +18602,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -15959,20 +18621,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -15987,20 +18640,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -16383,20 +19027,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -16404,28 +19039,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Predecessor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "0.99999999", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147", "annotation": [] } } @@ -16442,20 +19061,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -16463,28 +19073,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Predecessor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.01", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.00999999", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", "annotation": [] } } @@ -16501,20 +19095,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -16522,28 +19107,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Predecessor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [], - "signature": [], - "operand": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "cm", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 0.99999999, - "unit": "cm", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", "annotation": [] } } @@ -19915,11 +22484,17 @@ { "name": "output", "value": { - "type": "Literal", + "type": "Negate", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "0.0", - "annotation": [] + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } } } ] @@ -20195,7 +22770,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "2.0", "annotation": [] } } @@ -21193,20 +23768,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21221,20 +23787,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21482,20 +24039,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21510,20 +24058,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21900,20 +24439,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21921,28 +24451,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Successor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.00000001", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", "annotation": [] } } @@ -21959,20 +24473,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21980,28 +24485,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Successor", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.01", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.01000001", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", "annotation": [] } } @@ -26454,7 +28943,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See test Divide1Q1Q which is correct", + "value": "Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See https://github.com/cqframework/cql-tests/pull/148", "annotation": [] } } diff --git a/test/spec-tests/cql/CqlComparisonOperatorsTest.cql b/test/spec-tests/cql/CqlComparisonOperatorsTest.cql index 31737de72..d19c842f2 100644 --- a/test/spec-tests/cql/CqlComparisonOperatorsTest.cql +++ b/test/spec-tests/cql/CqlComparisonOperatorsTest.cql @@ -46,6 +46,10 @@ define "Equal": Tuple{ expression: 1 = 2, output: false }, + "SimpleEqLong1Long2": Tuple{ + expression: 1L = 2L, + output: false + }, "SimpleEqStringAStringA": Tuple{ expression: 'a' = 'a', output: true @@ -62,6 +66,14 @@ define "Equal": Tuple{ expression: 1.0 = 2.0, output: false }, + "SimpleEqFloat1Float1WithZ": Tuple{ + expression: 1.0 = 1.00, + output: true + }, + "SimpleEqFloat1Float1WithPrecisionAndZ": Tuple{ + expression: 1.50 = 1.55, + output: false + }, "SimpleEqFloat1Int1": Tuple{ expression: 1.0 = 1, output: true @@ -82,6 +94,18 @@ define "Equal": Tuple{ expression: 2.0'cm' = 2.00'cm', output: true }, + "RatioEqual": Tuple{ + expression: 1'cm':2'cm' = 1'cm':2'cm', + output: true + }, + "RatioNotEqualDiffNumerator": Tuple{ + expression: 1'cm':2'cm' = 1.1'cm':2'cm', + output: false + }, + "RatioNotEqualDiffDenominator": Tuple{ + expression: 1'cm':2'cm' = 1'cm':2.1'cm', + output: false + }, "TupleEqJohnJohn": Tuple{ expression: Tuple { Id : 1, Name : 'John' } = Tuple { Id : 1, Name : 'John' }, output: true @@ -99,9 +123,11 @@ define "Equal": Tuple{ output: false }, "TupleEqDifferentNamesWithOneNullId": Tuple{ + skipped: 'Wrong output: Tuple equality with a known-unequal element should return false' + /* expression: Tuple { Id : null, Name : 'John' } = Tuple { Id : 1, Name : 'James' }, - output: false - }, + output: null + */ }, "TupleEqJohn1John1WithBothNamesNull": Tuple{ expression: Tuple { Id : 1, Name : null } = Tuple { Id : 1, Name : null }, output: true @@ -122,6 +148,10 @@ define "Equal": Tuple{ expression: Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 0, 0, 0, 0) } = Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 5, 0, 0, 0) }, output: false }, + "TupleEqDateTimeTrue2": Tuple{ + expression: Tuple { dateId: 12, Date: DateTime(2012, 1, 1) } = Tuple { dateId: 12, Date: DateTime(2012, 1, 1) }, + output: true + }, "TupleEqTimeTrue": Tuple{ expression: Tuple { timeId: 55, TheTime: @T05:15:15.541 } = Tuple { timeId: 55, TheTime: @T05:15:15.541 }, output: true @@ -146,12 +176,20 @@ define "Equal": Tuple{ expression: DateTime(2014, 1, 5, 5, 0, 0, 0, 0) = DateTime(2014, 7, 5, 5, 0, 0, 0, 0), output: false }, + "DateTimeEqMissingArg": Tuple{ + expression: DateTime(2015, 1, 5, 5, 0, 0) = DateTime(2015, 1, 5, 5, 0, 0), + output: true + }, "DateTimeEqNull": Tuple{ skipped: 'Wrong answer (true vs null - due to not evaluating DateTime(null) as null)' /* expression: DateTime(null) = DateTime(null), output: null */ }, + "DateTimeEqTrue": Tuple{ + expression: DateTime(2001, 1, 1, null) = DateTime(2001, 1, 1, null, null), + output: true + }, "DateTimeUTC": Tuple{ expression: @2014-01-25T14:30:14.559+01:00 = @2014-01-25T14:30:14.559+01:00, output: true @@ -179,6 +217,10 @@ define "Greater": Tuple{ expression: 0 > 1, output: false }, + "GreaterLong": Tuple{ + expression: 0L > 10L, + output: false + }, "GreaterZNeg1": Tuple{ expression: 0 > -1, output: true @@ -282,6 +324,10 @@ define "Greater Or Equal": Tuple{ expression: 0 >= 1, output: false }, + "GreaterOrEqualZ1Long": Tuple{ + expression: 0L >= 10L, + output: false + }, "GreaterOrEqualZNeg1": Tuple{ expression: 0 >= -1, output: true @@ -393,6 +439,14 @@ define "Less": Tuple{ expression: 0 < 1, output: true }, + "LessLong": Tuple{ + expression: 0L < 10L, + output: true + }, + "LessLongNeg": Tuple{ + expression: -30L < -20L, + output: true + }, "LessZNeg1": Tuple{ expression: 0 < -1, output: false @@ -496,6 +550,10 @@ define "Less Or Equal": Tuple{ expression: 0 <= 1, output: true }, + "LessOrEqualZ1Long": Tuple{ + expression: 0L <= 10L, + output: true + }, "LessOrEqualZNeg1": Tuple{ expression: 0 <= -1, output: false @@ -643,6 +701,10 @@ define "Equivalent": Tuple{ expression: 'a' ~ 'b', output: false }, + "EquivStringIgnoreCase": Tuple{ + expression: 'Abel' ~ 'abel', + output: true + }, "EquivFloat1Float1": Tuple{ expression: 1.0 ~ 1.0, output: true @@ -651,6 +713,22 @@ define "Equivalent": Tuple{ expression: 1.0 ~ 2.0, output: false }, + "EquivFloat1Float1WithZ": Tuple{ + expression: 1.0 ~ 1.00, + output: true + }, + "EquivFloat1Float1WithPrecision": Tuple{ + expression: 1.5 ~ 1.55, + output: false + }, + "EquivFloat1Float1WithPrecisionAndZ": Tuple{ + expression: 1.50 ~ 1.55, + output: false + }, + "EquivFloatTrailingZero": Tuple{ + expression: 1.001 ~ 1.000, + output: true + }, "EquivFloat1Int1": Tuple{ expression: 1.0 ~ 1, output: true @@ -667,6 +745,18 @@ define "Equivalent": Tuple{ expression: 1'cm' ~ 0.01'm', output: true }, + "RatioEquivalent": Tuple{ + expression: 1'cm':2'cm' ~ 1'cm':2'cm', + output: true + }, + "RatioNotEquivalentDiffNumerator": Tuple{ + expression: 1'cm':2'cm' ~ 3'cm':2'cm', + output: false + }, + "RatioNotEquivalentDiffDenominator": Tuple{ + expression: 1'cm':2'cm' ~ 1'cm':3'cm', + output: false + }, "EquivTupleJohnJohn": Tuple{ expression: Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 1, Name : 'John' }, output: true @@ -675,6 +765,14 @@ define "Equivalent": Tuple{ expression: Tuple { Id : 1, Name : 'John', Position: null } ~ Tuple { Id : 1, Name : 'John', Position: null }, output: true }, + "EquivTupleJohnJohnFalse": Tuple{ + expression: Tuple { Id : 1, Name : 'John', Position: 'Shift Manager' } ~ Tuple { Id : 1, Name : 'John' }, + invalid: true + }, + "EquivTupleJohnJohnFalse2": Tuple{ + expression: Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 1, Name : 'John', Position: 'Shift Manager' }, + invalid: true + }, "EquivTupleJohnJane": Tuple{ expression: Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 2, Name : 'Jane' }, output: false @@ -738,6 +836,10 @@ define "Not Equal": Tuple{ expression: 1 != 2, output: true }, + "SimpleNotEqLong1Long2": Tuple{ + expression: 1L != 2L, + output: true + }, "SimpleNotEqStringAStringA": Tuple{ expression: 'a' != 'a', output: false @@ -787,9 +889,11 @@ define "Not Equal": Tuple{ output: true }, "TupleNotEqDifferingNamesWithOneNullId": Tuple{ + skipped: 'Wrong output: Tuple inequality with a known-unequal element should return true' + /* expression: Tuple{ Id : null, Name : 'John' } != Tuple{ Id : 1, Name : 'Joe' }, - output: true - }, + output: null + */ }, "TupleNotEqJohn1John1WithBothNamesNull": Tuple{ expression: Tuple{ Id : 1, Name : null } != Tuple{ Id : 1, Name : null }, output: false @@ -819,3 +923,182 @@ define "Not Equal": Tuple{ output: true } } + +define "Unit Comparison": Tuple{ + "TestQuantityMillisecondEqualMs": Tuple{ + expression: 1 millisecond = 1 'ms', + output: true + }, + "TestQuantityMillisecondEqualMilliseconds": Tuple{ + expression: 1 millisecond = 1 milliseconds, + output: true + }, + "TestQuantityMillisecondsEqualMs": Tuple{ + expression: 1 milliseconds = 1 'ms', + output: true + }, + "TestQuantitySecondEqualS": Tuple{ + expression: 1 second = 1 's', + output: true + }, + "TestQuantitySecondEqualSeconds": Tuple{ + expression: 1 second = 1 seconds, + output: true + }, + "TestQuantitySecondsEqualS": Tuple{ + expression: 1 seconds = 1 's', + output: true + }, + "TestQuantityMinuteEqualMin": Tuple{ + expression: 1 minute = 1 'min', + output: true + }, + "TestQuantityMinuteEqualMinutes": Tuple{ + expression: 1 minute = 1 minutes, + output: true + }, + "TestQuantityMinutesEqualMin": Tuple{ + expression: 1 minutes = 1 'min', + output: true + }, + "TestQuantityHourEqualH": Tuple{ + expression: 1 hour = 1 'h', + output: true + }, + "TestQuantityHourEqualHours": Tuple{ + expression: 1 hour = 1 hours, + output: true + }, + "TestQuantityHoursEqualH": Tuple{ + expression: 1 hours = 1 'h', + output: true + }, + "TestQuantityDayEqualD": Tuple{ + expression: 1 day = 1 'd', + output: true + }, + "TestQuantityDayEqualDays": Tuple{ + expression: 1 day = 1 days, + output: true + }, + "TestQuantityDaysEqualD": Tuple{ + expression: 1 days = 1 'd', + output: true + }, + "TestQuantityWeekEqualWk": Tuple{ + expression: 1 week = 1 'wk', + output: true + }, + "TestQuantityWeekEqualWeeks": Tuple{ + expression: 1 week = 1 weeks, + output: true + }, + "TestQuantityWeeksEqualWk": Tuple{ + expression: 1 weeks = 1 'wk', + output: true + }, + "TestQuantityMonthEqualMo": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 month = 1 'mo', + output: null + */ }, + "TestQuantityMonthNotEqualMo": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 month != 1 'mo', + output: null + */ }, + "TestQuantityMonthEquivalentMo": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 month ~ 1 'mo', + output: true + */ }, + "TestQuantityMonthEqualMonths": Tuple{ + expression: 1 month = 1 months, + output: true + }, + "TestQuantityMonthsNotEqualMo": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 months != 1 'mo', + output: null + */ }, + "TestQuantityMonthsEquivalentMo": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 months ~ 1 'mo', + output: true + */ }, + "TestQuantityYearEqualA": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 year = 1 'a', + output: null + */ }, + "TestQuantityYearNotEqualA": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 year != 1 'a', + output: null + */ }, + "TestQuantityYearEquivalentA": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 year ~ 1 'a', + output: true + */ }, + "TestQuantityYearsEqualYear": Tuple{ + expression: 1 years = 1 year, + output: true + }, + "TestQuantityYearsNotEqualA": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 years != 1 'a', + output: null + */ }, + "TestQuantityYearsEquivalentA": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 years ~ 1 'a', + output: true + */ }, + "TestYearEquivalentMonths": Tuple{ + expression: 1 year ~ 12 months, + output: true + }, + "TestYearEquivalentDays": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 year ~ 365 days, + output: true + */ }, + "TestMonthEquivalentDays": Tuple{ + skipped: 'Wrong answer: Quantity =/~ should have special semantics for calendar-based units' + /* + expression: 1 month ~ 30 days, + output: true + */ }, + "TestWeekEqualDays": Tuple{ + expression: 1 week = 7 days, + output: true + }, + "TestDayEqualHours": Tuple{ + expression: 1 day = 24 hours, + output: true + }, + "TestHourEqualMinutes": Tuple{ + expression: 1 hour = 60 minutes, + output: true + }, + "TestMinuteEqualSeconds": Tuple{ + expression: 1 minute = 60 seconds, + output: true + }, + "TestSecondEqualMilliseconds": Tuple{ + expression: 1 second = 1000 milliseconds, + output: true + } +} diff --git a/test/spec-tests/cql/CqlComparisonOperatorsTest.json b/test/spec-tests/cql/CqlComparisonOperatorsTest.json index f0250760d..fd3c4e0c1 100644 --- a/test/spec-tests/cql/CqlComparisonOperatorsTest.json +++ b/test/spec-tests/cql/CqlComparisonOperatorsTest.json @@ -498,6 +498,34 @@ ] } }, + { + "name": "SimpleEqLong1Long2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "SimpleEqStringAStringA", "annotation": [], @@ -610,6 +638,62 @@ ] } }, + { + "name": "SimpleEqFloat1Float1WithZ", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SimpleEqFloat1Float1WithPrecisionAndZ", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "SimpleEqFloat1Int1", "annotation": [], @@ -751,7 +835,7 @@ } }, { - "name": "TupleEqJohnJohn", + "name": "RatioEqual", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -779,7 +863,7 @@ } }, { - "name": "TupleEqJohnJane", + "name": "RatioNotEqualDiffNumerator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -807,7 +891,7 @@ } }, { - "name": "TupleEqJohn1John2", + "name": "RatioNotEqualDiffDenominator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -835,7 +919,7 @@ } }, { - "name": "TupleEqJohn1John2WithNullName", + "name": "TupleEqJohnJohn", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -863,7 +947,35 @@ } }, { - "name": "TupleEqDifferentNamesWithOneNullId", + "name": "TupleEqJohnJane", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleEqJohn1John2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -890,6 +1002,53 @@ ] } }, + { + "name": "TupleEqJohn1John2WithNullName", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleEqDifferentNamesWithOneNullId", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqJohn1John1WithBothNamesNull", "annotation": [], @@ -1030,6 +1189,34 @@ ] } }, + { + "name": "TupleEqDateTimeTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqTimeTrue", "annotation": [], @@ -1198,6 +1385,34 @@ ] } }, + { + "name": "DateTimeEqMissingArg", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeEqNull", "annotation": [], @@ -1217,6 +1432,34 @@ ] } }, + { + "name": "DateTimeEqTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeUTC", "annotation": [], @@ -1591,7 +1834,7 @@ } }, { - "name": "SimpleEqStringAStringA", + "name": "SimpleEqLong1Long2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1619,7 +1862,7 @@ } }, { - "name": "SimpleEqStringAStringB", + "name": "SimpleEqStringAStringA", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1647,7 +1890,7 @@ } }, { - "name": "SimpleEqFloat1Float1", + "name": "SimpleEqStringAStringB", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1675,7 +1918,7 @@ } }, { - "name": "SimpleEqFloat1Float2", + "name": "SimpleEqFloat1Float1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1703,7 +1946,7 @@ } }, { - "name": "SimpleEqFloat1Int1", + "name": "SimpleEqFloat1Float2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1731,7 +1974,7 @@ } }, { - "name": "SimpleEqFloat1Int2", + "name": "SimpleEqFloat1Float1WithZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1759,7 +2002,7 @@ } }, { - "name": "QuantityEqCM1CM1", + "name": "SimpleEqFloat1Float1WithPrecisionAndZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1787,7 +2030,91 @@ } }, { - "name": "QuantityEqCM1M01", + "name": "SimpleEqFloat1Int1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SimpleEqFloat1Int2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityEqCM1CM1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityEqCM1M01", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1843,7 +2170,7 @@ } }, { - "name": "TupleEqJohnJohn", + "name": "RatioEqual", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1871,7 +2198,7 @@ } }, { - "name": "TupleEqJohnJane", + "name": "RatioNotEqualDiffNumerator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1899,7 +2226,7 @@ } }, { - "name": "TupleEqJohn1John2", + "name": "RatioNotEqualDiffDenominator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1927,7 +2254,7 @@ } }, { - "name": "TupleEqJohn1John2WithNullName", + "name": "TupleEqJohnJohn", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1955,7 +2282,63 @@ } }, { - "name": "TupleEqDifferentNamesWithOneNullId", + "name": "TupleEqJohnJane", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleEqJohn1John2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleEqJohn1John2WithNullName", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -1982,6 +2365,25 @@ ] } }, + { + "name": "TupleEqDifferentNamesWithOneNullId", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqJohn1John1WithBothNamesNull", "annotation": [], @@ -2122,6 +2524,34 @@ ] } }, + { + "name": "TupleEqDateTimeTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqTimeTrue", "annotation": [], @@ -2290,6 +2720,34 @@ ] } }, + { + "name": "DateTimeEqMissingArg", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeEqNull", "annotation": [], @@ -2309,6 +2767,34 @@ ] } }, + { + "name": "DateTimeEqTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeUTC", "annotation": [], @@ -3054,7 +3540,7 @@ } }, { - "name": "SimpleEqStringAStringA", + "name": "SimpleEqLong1Long2", "value": { "type": "Tuple", "annotation": [], @@ -3093,16 +3579,16 @@ "operand": [ { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "a", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "1", "annotation": [] }, { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "a", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "2", "annotation": [] } ] @@ -3114,7 +3600,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -3122,7 +3608,75 @@ } }, { - "name": "SimpleEqStringAStringB", + "name": "SimpleEqStringAStringA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "a", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "a", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "SimpleEqStringAStringB", "value": { "type": "Tuple", "annotation": [], @@ -3326,7 +3880,7 @@ } }, { - "name": "SimpleEqFloat1Int1", + "name": "SimpleEqFloat1Float1WithZ", "value": { "type": "Tuple", "annotation": [], @@ -3371,16 +3925,11 @@ "annotation": [] }, { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.00", + "annotation": [] } ] } @@ -3399,7 +3948,7 @@ } }, { - "name": "SimpleEqFloat1Int2", + "name": "SimpleEqFloat1Float1WithPrecisionAndZ", "value": { "type": "Tuple", "annotation": [], @@ -3440,20 +3989,15 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "1.50", "annotation": [] }, { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.55", + "annotation": [] } ] } @@ -3472,7 +4016,7 @@ } }, { - "name": "QuantityEqCM1CM1", + "name": "SimpleEqFloat1Int1", "value": { "type": "Tuple", "annotation": [], @@ -3510,18 +4054,23 @@ "signature": [], "operand": [ { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "cm", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", "annotation": [] }, { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "cm", - "annotation": [] + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } } ] } @@ -3540,7 +4089,7 @@ } }, { - "name": "QuantityEqCM1M01", + "name": "SimpleEqFloat1Int2", "value": { "type": "Tuple", "annotation": [], @@ -3578,18 +4127,23 @@ "signature": [], "operand": [ { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "cm", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", "annotation": [] }, { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 0.01, - "unit": "m", - "annotation": [] + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } } ] } @@ -3600,7 +4154,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -3608,7 +4162,7 @@ } }, { - "name": "QuantityEqDiffPrecision", + "name": "QuantityEqCM1CM1", "value": { "type": "Tuple", "annotation": [], @@ -3648,14 +4202,14 @@ { "type": "Quantity", "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 2, + "value": 1, "unit": "cm", "annotation": [] }, { "type": "Quantity", "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 2, + "value": 1, "unit": "cm", "annotation": [] } @@ -3676,7 +4230,7 @@ } }, { - "name": "TupleEqJohnJohn", + "name": "QuantityEqCM1M01", "value": { "type": "Tuple", "annotation": [], @@ -3714,104 +4268,18 @@ "signature": [], "operand": [ { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "Id", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "Name", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "Id", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "name": "Name", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", - "annotation": [] - } - } - ] + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] }, { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "Id", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "Name", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "Id", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "name": "Name", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", - "annotation": [] - } - } - ] + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 0.01, + "unit": "m", + "annotation": [] } ] } @@ -3830,7 +4298,339 @@ } }, { - "name": "TupleEqJohnJane", + "name": "QuantityEqDiffPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioEqual", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEqualDiffNumerator", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1.1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEqualDiffDenominator", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2.1, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleEqJohnJohn", "value": { "type": "Tuple", "annotation": [], @@ -3951,7 +4751,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "value": "1", "annotation": [] } }, @@ -3961,7 +4761,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Jane", + "value": "John", "annotation": [] } } @@ -3976,7 +4776,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -3984,7 +4784,7 @@ } }, { - "name": "TupleEqJohn1John2", + "name": "TupleEqJohnJane", "value": { "type": "Tuple", "annotation": [], @@ -4115,7 +4915,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", + "value": "Jane", "annotation": [] } } @@ -4138,7 +4938,7 @@ } }, { - "name": "TupleEqJohn1John2WithNullName", + "name": "TupleEqJohn1John2", "value": { "type": "Tuple", "annotation": [], @@ -4246,7 +5046,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -4266,8 +5066,10 @@ { "name": "Name", "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": "John", "annotation": [] } } @@ -4290,7 +5092,7 @@ } }, { - "name": "TupleEqDifferentNamesWithOneNullId", + "name": "TupleEqJohn1John2WithNullName", "value": { "type": "Tuple", "annotation": [], @@ -4339,7 +5141,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -4358,8 +5160,10 @@ { "name": "Id", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } }, @@ -4396,7 +5200,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4409,17 +5213,15 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "2", "annotation": [] } }, { "name": "Name", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "James", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -4441,6 +5243,40 @@ ] } }, + { + "name": "TupleEqDifferentNamesWithOneNullId", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: Tuple equality with a known-unequal element should return false", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqJohn1John1WithBothNamesNull", "value": { @@ -5391,6 +6227,200 @@ ] } }, + { + "name": "TupleEqDateTimeTrue2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "dateId", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Date", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "dateId", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + }, + { + "name": "Date", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + }, + { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "dateId", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Date", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "dateId", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + }, + { + "name": "Date", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + ] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, { "name": "TupleEqTimeTrue", "value": { @@ -6315,41 +7345,7 @@ } }, { - "name": "DateTimeEqNull", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "skipped", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (true vs null - due to not evaluating DateTime(null) as null)", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeUTC", + "name": "DateTimeEqMissingArg", "value": { "type": "Tuple", "annotation": [], @@ -6393,50 +7389,44 @@ "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2015", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "1", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "5", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "0", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "559", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "0", "annotation": [] } }, @@ -6447,50 +7437,381 @@ "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2015", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "1", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "5", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "0", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "559", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeEqNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer (true vs null - due to not evaluating DateTime(null) as null)", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeEqTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2001", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "As", + "asType": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2001", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "As", + "asType": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + }, + "minute": { + "type": "As", + "asType": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUTC", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "559", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "559", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", "annotation": [] } } @@ -6970,7 +8291,7 @@ } }, { - "name": "GreaterZNeg1", + "name": "GreaterLong", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -6998,7 +8319,7 @@ } }, { - "name": "GreaterDecZZ", + "name": "GreaterZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7026,7 +8347,7 @@ } }, { - "name": "GreaterDecZ1", + "name": "GreaterDecZZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7054,7 +8375,7 @@ } }, { - "name": "GreaterDecZNeg1", + "name": "GreaterDecZ1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7082,7 +8403,7 @@ } }, { - "name": "GreaterDec1Int2", + "name": "GreaterDecZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7110,7 +8431,7 @@ } }, { - "name": "GreaterCM0CM0", + "name": "GreaterDec1Int2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7138,7 +8459,7 @@ } }, { - "name": "GreaterCM0CM1", + "name": "GreaterCM0CM0", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7166,7 +8487,7 @@ } }, { - "name": "GreaterCM0NegCM1", + "name": "GreaterCM0CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7194,7 +8515,35 @@ } }, { - "name": "GreaterM1CM1", + "name": "GreaterCM0NegCM1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "GreaterM1CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -7678,6 +9027,34 @@ ] } }, + { + "name": "GreaterLong", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "GreaterZNeg1", "annotation": [], @@ -8461,6 +9838,74 @@ ] } }, + { + "name": "GreaterLong", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "10", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, { "name": "GreaterZNeg1", "value": { @@ -10364,6 +11809,34 @@ ] } }, + { + "name": "GreaterOrEqualZ1Long", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "GreaterOrEqualZNeg1", "annotation": [], @@ -11129,6 +12602,34 @@ ] } }, + { + "name": "GreaterOrEqualZ1Long", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "GreaterOrEqualZNeg1", "annotation": [], @@ -11968,6 +13469,74 @@ ] } }, + { + "name": "GreaterOrEqualZ1Long", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "GreaterOrEqual", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "10", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, { "name": "GreaterOrEqualZNeg1", "value": { @@ -14262,7 +15831,7 @@ } }, { - "name": "LessZNeg1", + "name": "LessLong", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14290,7 +15859,7 @@ } }, { - "name": "LessDecZZ", + "name": "LessLongNeg", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14318,7 +15887,7 @@ } }, { - "name": "LessDecZ1", + "name": "LessZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14346,7 +15915,7 @@ } }, { - "name": "LessDecZNeg1", + "name": "LessDecZZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14374,7 +15943,7 @@ } }, { - "name": "LessDec1Int2", + "name": "LessDecZ1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14402,7 +15971,7 @@ } }, { - "name": "LessCM0CM0", + "name": "LessDecZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14430,7 +15999,7 @@ } }, { - "name": "LessCM0CM1", + "name": "LessDec1Int2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14458,7 +16027,7 @@ } }, { - "name": "LessCM0NegCM1", + "name": "LessCM0CM0", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14486,7 +16055,7 @@ } }, { - "name": "LessM1CM1", + "name": "LessCM0CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14514,7 +16083,7 @@ } }, { - "name": "LessM1CM10", + "name": "LessCM0NegCM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14542,7 +16111,7 @@ } }, { - "name": "LessAA", + "name": "LessM1CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14570,7 +16139,7 @@ } }, { - "name": "LessAB", + "name": "LessM1CM10", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14598,7 +16167,63 @@ } }, { - "name": "LessBA", + "name": "LessAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "LessAB", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "LessBA", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -14970,6 +16595,62 @@ ] } }, + { + "name": "LessLong", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "LessLongNeg", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "LessZNeg1", "annotation": [], @@ -15753,6 +17434,154 @@ ] } }, + { + "name": "LessLong", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Less", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "10", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "LessLongNeg", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Less", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "30", + "annotation": [] + } + }, + { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "20", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, { "name": "LessZNeg1", "value": { @@ -17657,7 +19486,7 @@ } }, { - "name": "LessOrEqualZNeg1", + "name": "LessOrEqualZ1Long", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17685,7 +19514,7 @@ } }, { - "name": "LessOrEqualDecZZ", + "name": "LessOrEqualZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17713,7 +19542,7 @@ } }, { - "name": "LessOrEqualDecZ1", + "name": "LessOrEqualDecZZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17741,7 +19570,7 @@ } }, { - "name": "LessOrEqualDecZNeg1", + "name": "LessOrEqualDecZ1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17769,7 +19598,7 @@ } }, { - "name": "LessOrEqualDec1Int2", + "name": "LessOrEqualDecZNeg1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17797,7 +19626,7 @@ } }, { - "name": "LessOrEqualCM0CM0", + "name": "LessOrEqualDec1Int2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -17825,7 +19654,35 @@ } }, { - "name": "LessOrEqualCM0CM1", + "name": "LessOrEqualCM0CM0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "LessOrEqualCM0CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -18421,6 +20278,34 @@ ] } }, + { + "name": "LessOrEqualZ1Long", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "LessOrEqualZNeg1", "annotation": [], @@ -19260,6 +21145,74 @@ ] } }, + { + "name": "LessOrEqualZ1Long", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "LessOrEqual", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "10", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, { "name": "LessOrEqualZNeg1", "value": { @@ -21805,6 +23758,34 @@ ] } }, + { + "name": "EquivStringIgnoreCase", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "EquivFloat1Float1", "annotation": [], @@ -21861,6 +23842,118 @@ ] } }, + { + "name": "EquivFloat1Float1WithZ", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloat1Float1WithPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloat1Float1WithPrecisionAndZ", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloatTrailingZero", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "EquivFloat1Int1", "annotation": [], @@ -21974,7 +24067,7 @@ } }, { - "name": "EquivTupleJohnJohn", + "name": "RatioEquivalent", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22002,7 +24095,7 @@ } }, { - "name": "EquivTupleJohnJohnWithNulls", + "name": "RatioNotEquivalentDiffNumerator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22030,7 +24123,7 @@ } }, { - "name": "EquivTupleJohnJane", + "name": "RatioNotEquivalentDiffDenominator", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22058,7 +24151,147 @@ } }, { - "name": "EquivTupleJohn1John2", + "name": "EquivTupleJohnJohn", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnWithNulls", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnFalse2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJane", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohn1John2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22514,6 +24747,34 @@ ] } }, + { + "name": "EquivStringIgnoreCase", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "EquivFloat1Float1", "annotation": [], @@ -22571,7 +24832,7 @@ } }, { - "name": "EquivFloat1Int1", + "name": "EquivFloat1Float1WithZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22599,7 +24860,7 @@ } }, { - "name": "EquivFloat1Int2", + "name": "EquivFloat1Float1WithPrecision", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22627,7 +24888,7 @@ } }, { - "name": "EquivEqCM1CM1", + "name": "EquivFloat1Float1WithPrecisionAndZ", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22655,7 +24916,7 @@ } }, { - "name": "EquivEqCM1M01", + "name": "EquivFloatTrailingZero", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22683,7 +24944,7 @@ } }, { - "name": "EquivTupleJohnJohn", + "name": "EquivFloat1Int1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22711,7 +24972,7 @@ } }, { - "name": "EquivTupleJohnJohnWithNulls", + "name": "EquivFloat1Int2", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22739,7 +25000,7 @@ } }, { - "name": "EquivTupleJohnJane", + "name": "EquivEqCM1CM1", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22767,7 +25028,7 @@ } }, { - "name": "EquivTupleJohn1John2", + "name": "EquivEqCM1M01", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -22795,7 +25056,259 @@ } }, { - "name": "EquivDateTimeTodayToday", + "name": "RatioEquivalent", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEquivalentDiffNumerator", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEquivalentDiffDenominator", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohn", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnWithNulls", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnFalse2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJane", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohn1John2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivDateTimeTodayToday", "annotation": [], "elementType": { "type": "TupleTypeSpecifier", @@ -23680,6 +26193,74 @@ ] } }, + { + "name": "EquivStringIgnoreCase", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Abel", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "abel", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, { "name": "EquivFloat1Float1", "value": { @@ -23817,7 +26398,7 @@ } }, { - "name": "EquivFloat1Int1", + "name": "EquivFloat1Float1WithZ", "value": { "type": "Tuple", "annotation": [], @@ -23862,16 +26443,11 @@ "annotation": [] }, { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.00", + "annotation": [] } ] } @@ -23890,7 +26466,7 @@ } }, { - "name": "EquivFloat1Int2", + "name": "EquivFloat1Float1WithPrecision", "value": { "type": "Tuple", "annotation": [], @@ -23931,20 +26507,15 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "1.5", "annotation": [] }, { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.55", + "annotation": [] } ] } @@ -23963,7 +26534,289 @@ } }, { - "name": "EquivEqCM1CM1", + "name": "EquivFloat1Float1WithPrecisionAndZ", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.50", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.55", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloatTrailingZero", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.001", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.000", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloat1Int1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivFloat1Int2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivEqCM1CM1", "value": { "type": "Tuple", "annotation": [], @@ -24098,6 +26951,270 @@ ] } }, + { + "name": "RatioEquivalent", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEquivalentDiffNumerator", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 3, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "RatioNotEquivalentDiffDenominator", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "cm", + "annotation": [] + } + }, + { + "type": "Ratio", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Ratio", + "annotation": [], + "numerator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "cm", + "annotation": [] + }, + "denominator": { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 3, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, { "name": "EquivTupleJohnJohn", "value": { @@ -24441,7 +27558,7 @@ } }, { - "name": "EquivTupleJohnJane", + "name": "EquivTupleJohnJohnFalse", "value": { "type": "Tuple", "annotation": [], @@ -24459,7 +27576,7 @@ } }, { - "name": "output", + "name": "invalid", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", @@ -24479,10 +27596,376 @@ "signature": [], "operand": [ { - "type": "Tuple", + "type": "ToList", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", + "signature": [], + "operand": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "Id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "Position", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "Id", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "name": "Name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "John", + "annotation": [] + } + }, + { + "name": "Position", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Shift Manager", + "annotation": [] + } + } + ] + } + }, + { + "type": "ToList", + "annotation": [], + "signature": [], + "operand": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "Id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "Id", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "name": "Name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "John", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "invalid", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJohnFalse2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "ToList", + "annotation": [], + "signature": [], + "operand": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "Id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "Id", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "name": "Name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "John", + "annotation": [] + } + } + ] + } + }, + { + "type": "ToList", + "annotation": [], + "signature": [], + "operand": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "Id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "Name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "Position", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "Id", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + }, + { + "name": "Name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "John", + "annotation": [] + } + }, + { + "name": "Position", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Shift Manager", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "invalid", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "EquivTupleJohnJane", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { @@ -25387,6 +28870,34 @@ ] } }, + { + "name": "SimpleNotEqLong1Long2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "SimpleNotEqStringAStringA", "annotation": [], @@ -25731,20 +29242,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": [] } } @@ -26208,6 +29710,34 @@ ] } }, + { + "name": "SimpleNotEqLong1Long2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, { "name": "SimpleNotEqStringAStringA", "annotation": [], @@ -26552,20 +30082,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": [] } } @@ -27455,7 +30976,7 @@ } }, { - "name": "SimpleNotEqStringAStringA", + "name": "SimpleNotEqLong1Long2", "value": { "type": "Tuple", "annotation": [], @@ -27499,16 +31020,16 @@ "operand": [ { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "a", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "1", "annotation": [] }, { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "a", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", + "valueType": "{urn:hl7-org:elm-types:r1}Long", + "value": "2", "annotation": [] } ] @@ -27521,7 +31042,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -27529,7 +31050,7 @@ } }, { - "name": "SimpleNotEqStringAStringB", + "name": "SimpleNotEqStringAStringA", "value": { "type": "Tuple", "annotation": [], @@ -27582,81 +31103,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "b", - "annotation": [] - } - ] - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } - } - ] - } - }, - { - "name": "SimpleNotEqFloat1Float1", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Not", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": { - "type": "Equal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "value": "a", "annotation": [] } ] @@ -27677,7 +31124,7 @@ } }, { - "name": "SimpleNotEqFloat1Float2", + "name": "SimpleNotEqStringAStringB", "value": { "type": "Tuple", "annotation": [], @@ -27721,16 +31168,16 @@ "operand": [ { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "a", "annotation": [] }, { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "2.0", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "b", "annotation": [] } ] @@ -27751,7 +31198,7 @@ } }, { - "name": "SimpleNotEqFloat1Int1", + "name": "SimpleNotEqFloat1Float1", "value": { "type": "Tuple", "annotation": [], @@ -27800,96 +31247,12 @@ "value": "1.0", "annotation": [] }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - } - ] - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] - } - } - ] - } - }, - { - "name": "SimpleNotEqFloat1Int2", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Not", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": { - "type": "Equal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ { "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", "valueType": "{urn:hl7-org:elm-types:r1}Decimal", "value": "1.0", "annotation": [] - }, - { - "type": "ToDecimal", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } } ] } @@ -27901,7 +31264,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -27909,7 +31272,239 @@ } }, { - "name": "QuantityNotEqCM1CM1", + "name": "SimpleNotEqFloat1Float2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Not", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "2.0", + "annotation": [] + } + ] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "SimpleNotEqFloat1Int1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Not", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "SimpleNotEqFloat1Int2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Not", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + }, + { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityNotEqCM1CM1", "value": { "type": "Tuple", "annotation": [], @@ -28696,6 +32291,40 @@ }, { "name": "TupleNotEqDifferingNamesWithOneNullId", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: Tuple inequality with a known-unequal element should return true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TupleNotEqJohn1John1WithBothNamesNull", "value": { "type": "Tuple", "annotation": [], @@ -28749,7 +32378,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -28758,7 +32387,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -28768,18 +32397,18 @@ { "name": "Id", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } }, { "name": "Name", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -28806,7 +32435,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -28826,10 +32455,8 @@ { "name": "Name", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Joe", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -28845,7 +32472,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -28853,7 +32480,7 @@ } }, { - "name": "TupleNotEqJohn1John1WithBothNamesNull", + "name": "TupleNotEqMatchingNamesWithNullIDs", "value": { "type": "Tuple", "annotation": [], @@ -28907,7 +32534,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } }, @@ -28916,7 +32543,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -28926,18 +32553,18 @@ { "name": "Id", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } }, { "name": "Name", "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": "John", "annotation": [] } } @@ -28955,7 +32582,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } }, @@ -28964,7 +32591,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -28974,18 +32601,18 @@ { "name": "Id", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } }, { "name": "Name", "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": "John", "annotation": [] } } @@ -29009,7 +32636,7 @@ } }, { - "name": "TupleNotEqMatchingNamesWithNullIDs", + "name": "TupleNotEqJohn1John1WithNullName", "value": { "type": "Tuple", "annotation": [], @@ -29031,7 +32658,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -29063,7 +32690,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -29082,8 +32709,10 @@ { "name": "Id", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } }, @@ -29111,7 +32740,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, @@ -29120,7 +32749,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -29130,18 +32759,18 @@ { "name": "Id", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } }, { "name": "Name", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -29151,6 +32780,76 @@ } } }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeNotEqTodayToday", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Not", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [] + }, + { + "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [] + } + ] + } + } + }, { "name": "output", "value": { @@ -29165,7 +32864,7 @@ } }, { - "name": "TupleNotEqJohn1John1WithNullName", + "name": "DateTimeNotEqTodayYesterday", "value": { "type": "Tuple", "annotation": [], @@ -29187,7 +32886,7 @@ "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -29208,100 +32907,29 @@ "signature": [], "operand": [ { - "type": "Tuple", + "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "Id", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "Name", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "Id", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "name": "Name", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "John", - "annotation": [] - } - } - ] + "signature": [] }, { - "type": "Tuple", + "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "Id", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "Name", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } - } - ] - }, - "element": [ + "signature": [], + "operand": [ { - "name": "Id", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [] }, { - "name": "Name", - "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "days", + "annotation": [] } ] } @@ -29312,8 +32940,10 @@ { "name": "output", "value": { - "type": "Null", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -29321,166 +32951,7 @@ } }, { - "name": "DateTimeNotEqTodayToday", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Not", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": { - "type": "Equal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Today", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [] - }, - { - "type": "Today", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [] - } - ] - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeNotEqTodayYesterday", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - }, - { - "name": "output", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "expression", - "value": { - "type": "Not", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": { - "type": "Equal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Today", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [] - }, - { - "type": "Subtract", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Today", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", - "annotation": [], - "signature": [] - }, - { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "days", - "annotation": [] - } - ] - } - ] - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } - } - ] - } - }, - { - "name": "TimeNotEq10A10A", + "name": "TimeNotEq10A10A", "value": { "type": "Tuple", "annotation": [], @@ -29721,6 +33192,4118 @@ } ] } + }, + { + "name": "Unit Comparison", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TestQuantityMillisecondEqualMs", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondEqualMilliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondsEqualMs", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualS", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondsEqualS", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinutesEqualMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualH", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHoursEqualH", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDaysEqualD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWk", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeeksEqualWk", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthNotEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEquivalentMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsNotEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsEquivalentMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearNotEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEquivalentA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEqualYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsNotEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEquivalentA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMonthEquivalentDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestWeekEqualDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestDayEqualHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestHourEqualMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMinuteEqualSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestSecondEqualMilliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TestQuantityMillisecondEqualMs", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondEqualMilliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondsEqualMs", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualS", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondsEqualS", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinutesEqualMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualH", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHoursEqualH", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDaysEqualD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWk", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeeksEqualWk", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthNotEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEquivalentMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsNotEqualMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsEquivalentMo", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearNotEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEquivalentA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEqualYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsNotEqualA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEquivalentA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMonthEquivalentDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestWeekEqualDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestDayEqualHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestHourEqualMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMinuteEqualSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestSecondEqualMilliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "TestQuantityMillisecondEqualMs", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "millisecond", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "ms", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondEqualMilliseconds", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "millisecond", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "milliseconds", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMillisecondsEqualMs", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "milliseconds", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "ms", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualS", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "second", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "s", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondEqualSeconds", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "second", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "seconds", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantitySecondsEqualS", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "seconds", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "s", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMin", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minute", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "min", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinuteEqualMinutes", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minute", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minutes", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMinutesEqualMin", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minutes", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "min", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualH", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "hour", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "h", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHourEqualHours", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "hour", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "hours", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityHoursEqualH", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "hours", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "h", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualD", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "day", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "d", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDayEqualDays", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "day", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityDaysEqualD", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "days", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "d", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWk", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "week", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "wk", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeekEqualWeeks", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "week", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "weeks", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityWeeksEqualWk", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "weeks", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "wk", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMo", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthNotEqualMo", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEquivalentMo", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthEqualMonths", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "month", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "months", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsNotEqualMo", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityMonthsEquivalentMo", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEqualA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearNotEqualA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearEquivalentA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEqualYear", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "years", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "year", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsNotEqualA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestQuantityYearsEquivalentA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentMonths", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equivalent", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "year", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 12, + "unit": "months", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestYearEquivalentDays", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMonthEquivalentDays", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Quantity =/~ should have special semantics for calendar-based units", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestWeekEqualDays", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "week", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 7, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestDayEqualHours", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "day", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 24, + "unit": "hours", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestHourEqualMinutes", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "hour", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 60, + "unit": "minutes", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestMinuteEqualSeconds", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minute", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 60, + "unit": "seconds", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TestSecondEqualMilliseconds", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "second", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1000, + "unit": "milliseconds", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + } + ] + } } ] } diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql index 665236441..ce21523b5 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql @@ -424,13 +424,15 @@ define "DateTimeComponentFrom": Tuple{ output: 955 }, "DateTimeComponentFromTimezone": Tuple{ - expression: timezone from DateTime(2003, 10, 29, 20, 50, 33, 955, 1), - invalid: true - }, - "DateTimeComponentFromTimezone2": Tuple{ expression: timezoneoffset from DateTime(2003, 10, 29, 20, 50, 33, 955, 1), output: 1.00 }, + "DateTimeComponentFromTimezoneOffset": Tuple{ + skipped: 'Translator error: Timezone keyword is only valid in 1.3 or lower' + /* + expression: timezone from DateTime(2003, 10, 29, 20, 50, 33, 955, 1), + output: 1.00 + */ }, "DateTimeComponentFromDate": Tuple{ expression: date from DateTime(2003, 10, 29, 20, 50, 33, 955, 1), output: @2003-10-29 @@ -616,9 +618,11 @@ define "Duration": Tuple{ define "Uncertainty tests": Tuple{ "DateTimeDurationBetweenUncertainInterval": Tuple{ + skipped: 'Wrong answer: [17, 44] vs [16, 44]' + /* expression: days between DateTime(2014, 1, 15) and DateTime(2014, 2), - output: Interval[ 16, 44 ] - }, + output: Interval[ 17, 44 ] + */ }, "DateTimeDurationBetweenUncertainInterval2": Tuple{ expression: months between DateTime(2005) and DateTime(2006, 5), output: Interval[ 4, 16 ] @@ -700,13 +704,17 @@ define "Uncertainty tests": Tuple{ output: 2 }, "TimeDurationBetweenHourDiffPrecision": Tuple{ + skipped: 'Translator error: Syntax error at Z' + /* expression: hours between @T06Z and @T07:00:00Z, invalid: true - }, + */ }, "TimeDurationBetweenHourDiffPrecision2": Tuple{ + skipped: 'Wrong answer: 1 vs uncertainty [0, 1]' + /* expression: hours between @T06 and @T07:00:00, output: 1 - }, + */ }, "TimeDurationBetweenMinute": Tuple{ expression: minutes between @T23:20:16.555 and @T23:25:15.555, output: 4 @@ -1219,9 +1227,11 @@ define "Subtract": Tuple{ output: @2005-05-10T05:05:05 }, "DateTimeSubtract1YearInSeconds": Tuple{ + skipped: 'Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05' + /* expression: DateTime(2016,5) - 31535999 seconds = DateTime(2015, 5), output: true - }, + */ }, "DateTimeSubtract15HourPrecisionSecond": Tuple{ expression: DateTime(2016, 10, 1, 10, 20, 30) - 15 hours, output: @2016-09-30T19:20:30 diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json index 5d602b24d..6ab5a5c2d 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json @@ -4,7 +4,7 @@ { "type": "CqlToElmInfo", "translatorVersion": "4.2.0", - "translatorOptions": "", + "translatorOptions": "EnableResultTypes", "signatureLevel": "None" } ], @@ -66,79 +66,33 @@ "context": "Patient", "accessLevel": "Public", "annotation": [], - "expression": { - "type": "Tuple", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "DateTimeAdd5Years", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "years", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2010", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -146,55 +100,26 @@ }, { "name": "DateTimeAddInvalidYears", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 8000, - "unit": "years", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "invalid", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -203,73 +128,27 @@ }, { "name": "DateTimeAdd5Months", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "months", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -277,73 +156,27 @@ }, { "name": "DateTimeAddMonthsOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 10, - "unit": "months", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -351,85 +184,26 @@ }, { "name": "DateTimeAddThreeWeeks", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2018", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 3, - "unit": "weeks", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2018", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -438,85 +212,26 @@ }, { "name": "DateTimeAddYearInWeeks", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2018", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 52, - "unit": "weeks", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2019", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -525,85 +240,26 @@ }, { "name": "DateTimeLeapDayAddYearInWeeks", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2023", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 52, - "unit": "weeks", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2024", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -612,85 +268,26 @@ }, { "name": "DateTimeLeapYearAddYearInWeeks", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2024", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "28", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 52, - "unit": "weeks", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2025", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "26", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -699,73 +296,27 @@ }, { "name": "DateTimeAdd5Days", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "days", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -773,73 +324,27 @@ }, { "name": "DateTimeAddDaysOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 21, - "unit": "days", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -847,85 +352,27 @@ }, { "name": "DateTimeAdd5Hours", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -933,109 +380,27 @@ }, { "name": "DateTimeAdd5HoursWithLeftMinPrecisionSecond", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1043,85 +408,26 @@ }, { "name": "DateTimeAdd5HoursWithLeftMinPrecisionDay", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -1130,85 +436,26 @@ }, { "name": "DateTimeAdd5HoursWithLeftMinPrecisionDayOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 25, - "unit": "hours", - "annotation": [] - } - ] - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -1217,49 +464,27 @@ }, { "name": "DateAdd2YearsAsMonths", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 24, - "unit": "months", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } ] @@ -1267,49 +492,27 @@ }, { "name": "DateAdd2YearsAsMonthsRem1", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 25, - "unit": "months", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } ] @@ -1317,61 +520,27 @@ }, { "name": "DateAdd33Days", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 33, - "unit": "days", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } ] @@ -1379,61 +548,27 @@ }, { "name": "DateAdd1Year", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 1, - "unit": "year", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } } ] @@ -1441,85 +576,27 @@ }, { "name": "DateTimeAddHoursOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 19, - "unit": "hours", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1527,97 +604,27 @@ }, { "name": "DateTimeAdd5Minutes", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "minutes", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1625,97 +632,27 @@ }, { "name": "DateTimeAddMinutesOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 55, - "unit": "minutes", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1723,109 +660,27 @@ }, { "name": "DateTimeAdd5Seconds", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "seconds", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1833,109 +688,27 @@ }, { "name": "DateTimeAddSecondsOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 55, - "unit": "seconds", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -1943,121 +716,27 @@ }, { "name": "DateTimeAdd5Milliseconds", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "milliseconds", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2065,121 +744,27 @@ }, { "name": "DateTimeAddMillisecondsOverflow", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 995, - "unit": "milliseconds", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2187,73 +772,27 @@ }, { "name": "DateTimeAddLeapYear", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 1, - "unit": "year", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "28", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2261,49 +800,27 @@ }, { "name": "DateTimeAdd2YearsByMonths", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 24, - "unit": "months", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2311,49 +828,27 @@ }, { "name": "DateTimeAdd2YearsByDays", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 730, - "unit": "days", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2361,49 +856,27 @@ }, { "name": "DateTimeAdd2YearsByDaysRem5Days", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 735, - "unit": "days", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -2411,85 +884,27 @@ }, { "name": "TimeAdd5Hours", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } } ] @@ -2497,136 +912,1206 @@ }, { "name": "TimeAdd1Minute", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Add", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 1, - "unit": "minute", - "annotation": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Time", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd1Second", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd1Millisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd5Hours1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd5hoursByMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeAdd5Years", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + } + } + ] + } + }, + { + "name": "DateTimeAddInvalidYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - } - ] + ] + } + }, + { + "name": "DateTimeAdd5Months", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddMonthsOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddThreeWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapDayAddYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapYearAddYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddDaysOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5HoursWithLeftMinPrecisionSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5HoursWithLeftMinPrecisionDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5HoursWithLeftMinPrecisionDayOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateAdd2YearsAsMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateAdd2YearsAsMonthsRem1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateAdd33Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateAdd1Year", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddHoursOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Minutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddMinutesOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Seconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddSecondsOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Milliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddMillisecondsOverflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddLeapYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd2YearsByMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd2YearsByDays", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd2YearsByDaysRem5Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd1Second", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd1Millisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd5Hours1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAdd5hoursByMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } } - }, + ] + }, + "element": [ { - "name": "TimeAdd1Second", + "name": "DateTimeAdd5Years", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2005", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } }, { "type": "Quantity", - "value": 1, - "unit": "seconds", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "years", "annotation": [] } ] @@ -2635,31 +2120,26 @@ { "name": "output", "value": { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "2010", "annotation": [] }, - "second": { + "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } } @@ -2668,150 +2148,163 @@ } }, { - "name": "TimeAdd1Millisecond", + "name": "DateTimeAddInvalidYears", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2005", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } }, { "type": "Quantity", - "value": 1, - "unit": "milliseconds", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 8000, + "unit": "years", "annotation": [] } ] } }, { - "name": "output", + "name": "invalid", "value": { - "type": "Time", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAdd5Months", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } - } - ] - } - }, - { - "name": "TimeAdd5Hours1Minute", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Add", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } }, { "type": "Quantity", - "value": 1, - "unit": "minutes", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "months", "annotation": [] } ] @@ -2820,31 +2313,26 @@ { "name": "output", "value": { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "2005", "annotation": [] }, - "second": { + "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } } @@ -2853,51 +2341,75 @@ } }, { - "name": "TimeAdd5hoursByMinute", + "name": "DateTimeAddMonthsOverflow", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2005", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } }, { "type": "Quantity", - "value": 300, - "unit": "minutes", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 10, + "unit": "months", "annotation": [] } ] @@ -2906,107 +2418,137 @@ { "name": "output", "value": { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2006", "annotation": [] }, - "second": { + "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "3", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } } } ] } - } - ] - } - }, - { - "name": "After", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeAfterYearTrue", + "name": "DateTimeAddThreeWeeks", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Year", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 3, + "unit": "weeks", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2018", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] } } @@ -3017,6 +2559,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -3026,62 +2569,109 @@ } }, { - "name": "DateTimeAfterYearFalse", + "name": "DateTimeAddYearInWeeks", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Year", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2018", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 52, + "unit": "weeks", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2019", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "22", "annotation": [] } } @@ -3092,8 +2682,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -3101,62 +2692,109 @@ } }, { - "name": "DateTimeAfterMonthTrue", + "name": "DateTimeLeapDayAddYearInWeeks", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Month", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2023", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 52, + "unit": "weeks", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2024", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "2", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "29", "annotation": [] } } @@ -3167,6 +2805,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -3176,62 +2815,109 @@ } }, { - "name": "DateTimeAfterMonthFalse", + "name": "DateTimeLeapYearAddYearInWeeks", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Month", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2024", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "28", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 52, + "unit": "weeks", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2025", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "2", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "26", "annotation": [] } } @@ -3242,8 +2928,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -3251,64 +2938,76 @@ } }, { - "name": "DateTimeAfterDayTrue", + "name": "DateTimeAdd5Days", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Day", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "days", + "annotation": [] } ] } @@ -3316,149 +3015,104 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeAfterDayTrue2", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "After", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "09", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterDayFalse", + "name": "DateTimeAddDaysOverflow", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Day", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "10", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 21, + "unit": "days", + "annotation": [] } ] } @@ -3466,86 +3120,111 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterHourTrue", + "name": "DateTimeAdd5Hours", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] } ] } @@ -3553,86 +3232,131 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterHourFalse", + "name": "DateTimeAdd5HoursWithLeftMinPrecisionSecond", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, - "day": { + "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "20", "annotation": [] }, - "hour": { + "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", + "value": "30", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] } ] } @@ -3640,97 +3364,156 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterMinuteTrue", + "name": "DateTimeAdd5HoursWithLeftMinPrecisionDay", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Minute", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] } } ] @@ -3740,6 +3523,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -3749,86 +3533,109 @@ } }, { - "name": "DateTimeAfterMinuteFalse", + "name": "DateTimeAdd5HoursWithLeftMinPrecisionDayOverflow", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Minute", + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 25, + "unit": "hours", + "annotation": [] + } + ] }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", + "value": "11", "annotation": [] } } @@ -3839,8 +3646,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -3848,100 +3656,62 @@ } }, { - "name": "DateTimeAfterSecondTrue", + "name": "DateAdd2YearsAsMonths", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Second", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "2014", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 24, + "unit": "months", + "annotation": [] } ] } @@ -3949,110 +3719,78 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterSecondFalse", + "name": "DateAdd2YearsAsMonthsRem1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Second", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "2014", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 25, + "unit": "months", + "annotation": [] } ] } @@ -4060,122 +3798,85 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterMillisecondTrue", + "name": "DateAdd33Days", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Millisecond", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "512", + "value": "6", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "510", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 33, + "unit": "days", + "annotation": [] } ] } @@ -4183,122 +3884,91 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterMillisecondFalse", + "name": "DateAdd1Year", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Millisecond", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "512", + "value": "6", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "513", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "year", + "annotation": [] } ] } @@ -4306,68 +3976,105 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + } } } ] } }, { - "name": "DateTimeAfterUncertain", + "name": "DateTimeAddHoursOverflow", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Day", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] }, - "month": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "5", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 19, + "unit": "hours", + "annotation": [] } ] } @@ -4375,134 +4082,255 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } } } ] } }, { - "name": "AfterTimezoneTrue", + "name": "DateTimeAdd5Minutes", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "5", "annotation": [] } }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "minutes", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeAddMinutesOverflow", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "5", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 55, + "unit": "minutes", + "annotation": [] } ] } @@ -4510,134 +4338,281 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } } } ] } }, { - "name": "AfterTimezoneFalse", + "name": "DateTimeAdd5Seconds", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "5", "annotation": [] } }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "seconds", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeAddSecondsOverflow", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "5", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 55, + "unit": "seconds", + "annotation": [] } ] } @@ -4645,86 +4620,150 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterHourTrue", + "name": "DateTimeAdd5Milliseconds", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "2005", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, "millisecond": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "5", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "milliseconds", + "annotation": [] } ] } @@ -4732,86 +4771,156 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterHourFalse", + "name": "DateTimeAddMillisecondsOverflow", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "2016", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "6", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", + "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "5", "annotation": [] }, "millisecond": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "5", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 995, + "unit": "milliseconds", + "annotation": [] } ] } @@ -4819,86 +4928,128 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] - } - } - ] - } - }, - { - "name": "TimeAfterMinuteTrue", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "After", - "precision": "Minute", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeAddLeapYear", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2012", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "29", "annotation": [] } }, { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "year", + "annotation": [] } ] } @@ -4906,86 +5057,90 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2013", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "28", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterMinuteFalse", + "name": "DateTimeAdd2YearsByMonths", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Minute", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "2014", "annotation": [] } }, { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 24, + "unit": "months", + "annotation": [] } ] } @@ -4993,86 +5148,78 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterSecondTrue", + "name": "DateTimeAdd2YearsByDays", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Second", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "2014", "annotation": [] } }, { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 730, + "unit": "days", + "annotation": [] } ] } @@ -5080,60 +5227,141 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterSecondFalse", + "name": "DateTimeAdd2YearsByDaysRem5Days", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Second", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "2014", "annotation": [] } }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 735, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "TimeAdd5Hours", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -5160,6 +5388,13 @@ "value": "999", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] } ] } @@ -5167,31 +5402,80 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterMillisecondTrue", + "name": "TimeAdd1Minute", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Millisecond", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -5220,33 +5504,11 @@ } }, { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "998", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minute", + "annotation": [] } ] } @@ -5254,31 +5516,80 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterMillisecondFalse", + "name": "TimeAdd1Second", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Millisecond", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -5302,38 +5613,16 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "998", + "value": "999", "annotation": [] } }, { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "seconds", + "annotation": [] } ] } @@ -5341,62 +5630,113 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } } ] } }, { - "name": "TimeAfterTimeCstor", + "name": "TimeAdd1Millisecond", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "After", - "precision": "Hour", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "15", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "59", "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { + }, + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "59", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "999", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "milliseconds", + "annotation": [] } ] } @@ -5404,74 +5744,128 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } } } ] } - } - ] - } - }, - { - "name": "Before", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeBeforeYearTrue", + "name": "TimeAdd5Hours1Minute", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Before", - "precision": "Year", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - } + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] + } + ] }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 1, + "unit": "minutes", + "annotation": [] } ] } @@ -5479,74 +5873,113 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } } ] } }, { - "name": "DateTimeBeforeYearFalse", + "name": "TimeAdd5hoursByMinute", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Before", - "precision": "Year", + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "15", "annotation": [] }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", + "value": "59", "annotation": [] }, - "month": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "999", "annotation": [] } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 300, + "unit": "minutes", + "annotation": [] } ] } @@ -5554,9 +5987,73 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + } + } + ] + } + } + ] + } + }, + { + "name": "After", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeAfterYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5564,74 +6061,27 @@ } }, { - "name": "DateTimeBeforeMonthTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5639,74 +6089,27 @@ } }, { - "name": "DateTimeBeforeMonthFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5714,74 +6117,27 @@ } }, { - "name": "DateTimeBeforeDayTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5789,74 +6145,27 @@ } }, { - "name": "DateTimeBeforeDayTrue2", - "value": { - "type": "Tuple", + "name": "DateTimeAfterDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5864,74 +6173,27 @@ } }, { - "name": "DateTimeBeforeDayFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -5939,86 +6201,27 @@ } }, { - "name": "DateTimeBeforeHourTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6026,86 +6229,27 @@ } }, { - "name": "DateTimeBeforeHourFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6113,98 +6257,27 @@ } }, { - "name": "DateTimeBeforeMinuteTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "28", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6212,98 +6285,27 @@ } }, { - "name": "DateTimeBeforeMinuteFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6311,110 +6313,27 @@ } }, { - "name": "DateTimeBeforeSecondTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6422,110 +6341,27 @@ } }, { - "name": "DateTimeBeforeSecondFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6533,122 +6369,27 @@ } }, { - "name": "DateTimeBeforeMillisecondTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "508", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "510", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6656,122 +6397,27 @@ } }, { - "name": "DateTimeBeforeMillisecondFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "599", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2004", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "513", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6779,134 +6425,27 @@ } }, { - "name": "BeforeTimezoneTrue", - "value": { - "type": "Tuple", + "name": "DateTimeAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -6914,134 +6453,27 @@ } }, { - "name": "BeforeTimezoneFalse", - "value": { - "type": "Tuple", + "name": "DateTimeAfterUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7049,86 +6481,27 @@ } }, { - "name": "TimeBeforeHourTrue", - "value": { - "type": "Tuple", + "name": "AfterTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "14", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7136,86 +6509,27 @@ } }, { - "name": "TimeBeforeHourFalse", - "value": { - "type": "Tuple", + "name": "AfterTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7223,86 +6537,27 @@ } }, { - "name": "TimeBeforeMinuteTrue", - "value": { - "type": "Tuple", + "name": "TimeAfterHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "57", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7310,86 +6565,27 @@ } }, { - "name": "TimeBeforeMinuteFalse", - "value": { - "type": "Tuple", + "name": "TimeAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7397,86 +6593,27 @@ } }, { - "name": "TimeBeforeSecondTrue", - "value": { - "type": "Tuple", + "name": "TimeAfterMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "57", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "58", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -7484,74 +6621,1031 @@ } }, { - "name": "TimeBeforeSecondFalse", - "value": { - "type": "Tuple", + "name": "TimeAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Before", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterTimeCstor", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeAfterYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAfterUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "AfterTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "AfterTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAfterTimeCstor", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeAfterYearTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "56", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2004", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "10", "annotation": [] } } @@ -7562,8 +7656,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -7571,74 +7666,95 @@ } }, { - "name": "TimeBeforeMillisecondTrue", + "name": "DateTimeAfterYearFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Before", - "precision": "Millisecond", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2004", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "11", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "997", + "value": "10", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2004", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "998", + "value": "10", "annotation": [] } } @@ -7649,8 +7765,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -7658,74 +7775,95 @@ } }, { - "name": "TimeBeforeMillisecondFalse", + "name": "DateTimeAfterMonthTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Before", - "precision": "Millisecond", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2004", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "12", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "998", + "value": "10", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2004", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "11", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "997", + "value": "10", "annotation": [] } } @@ -7736,617 +7874,691 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "DateTime", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeYear", + "name": "DateTimeAfterMonthFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DateTimeMonth", + "name": "DateTimeAfterDayTrue", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } - } - }, - { - "name": "output", - "value": { - "type": "DateTime", + }, + { + "name": "output", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - } - ] - } - }, - { - "name": "DateTimeDay", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "DateTimeHour", + "name": "DateTimeAfterDayTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "09", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "DateTimeMinute", + "name": "DateTimeAfterDayFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DateTimeSecond", + "name": "DateTimeAfterHourTrue", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - }, + ] + }, + "element": [ { - "name": "output", + "name": "expression", "value": { - "type": "DateTime", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - } + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "DateTimeMillisecond", + "name": "DateTimeAfterHourFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } - } - }, - { - "name": "output", - "value": { - "type": "DateTime", + }, + { + "name": "output", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - } - ] - } - } - ] - } - }, - { - "name": "DateTimeComponentFrom", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "DateTimeComponentFromYear", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", - "precision": "Year", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -8354,73 +8566,136 @@ } }, { - "name": "DateTimeComponentFromMonth", + "name": "DateTimeAfterMinuteTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", - "precision": "Month", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -8428,73 +8703,136 @@ } }, { - "name": "DateTimeComponentFromMonthMinBoundary", + "name": "DateTimeAfterMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", - "precision": "Month", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "01", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -8502,147 +8840,150 @@ } }, { - "name": "DateTimeComponentFromDay", + "name": "DateTimeAfterSecondTrue", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTimeComponentFrom", - "precision": "Day", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] - } + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeComponentFromHour", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", - "precision": "Hour", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -8650,147 +8991,150 @@ } }, { - "name": "DateTimeComponentFromMinute", + "name": "DateTimeAfterSecondFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTimeComponentFrom", - "precision": "Minute", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] - } + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeComponentFromSecond", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Second", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -8798,73 +9142,164 @@ } }, { - "name": "DateTimeComponentFromMillisecond", + "name": "DateTimeAfterMillisecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Millisecond", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "512", + "annotation": [] + } }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "510", + "annotation": [] + } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -8872,101 +9307,164 @@ } }, { - "name": "DateTimeComponentFromTimezone", + "name": "DateTimeAfterMillisecondFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "skipped", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Translation Error: Timezone keyword is only valid in 1.3 or lower", - "annotation": [] + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - } - ] - } - }, - { - "name": "DateTimeComponentFromTimezone2", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "TimezoneOffsetFrom", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "512", + "annotation": [] + } }, - "timezoneOffset": { - "type": "ToDecimal", + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "513", "annotation": [] } } - } + ] } }, { "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.00", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -8974,445 +9472,252 @@ } }, { - "name": "DateTimeComponentFromDate", + "name": "DateTimeAfterUncertain", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateFrom", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "955", - "annotation": [] + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } }, - "timezoneOffset": { - "type": "ToDecimal", + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", "annotation": [] } } - } + ] } }, { "name": "output", "value": { - "type": "Date", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2003", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "TimeComponentFromHour", + "name": "AfterTimezoneTrue", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTimeComponentFrom", - "precision": "Hour", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - } - } - ] - } - }, - { - "name": "TimeComponentFromMinute", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTimeComponentFrom", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } - } - ] - } - }, - { - "name": "TimeComponentFromSecond", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTimeComponentFrom", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - } - ] - } - }, - { - "name": "TimeComponentFromMilli", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTimeComponentFrom", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] - } - } - ] - } - }, - { - "name": "Difference", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "DateTimeDifferenceYear", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Year", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "2012", "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { + }, + "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "value": "3", "annotation": [] }, - "month": { + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeDifferenceMonth", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { + }, + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "10", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "2012", "annotation": [] }, "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] } } ] @@ -9422,8 +9727,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -9431,39 +9737,65 @@ } }, { - "name": "DateTimeDifferenceDay", + "name": "AfterTimezoneFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Day", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "10", "annotation": [] }, "hour": { @@ -9475,30 +9807,49 @@ "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, "hour": { @@ -9508,10 +9859,28 @@ "annotation": [] }, "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "0", "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] } } ] @@ -9521,8 +9890,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -9530,74 +9900,101 @@ } }, { - "name": "DateTimeDifferenceHour", + "name": "TimeAfterHourTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "59", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "999", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "14", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "59", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "999", "annotation": [] } } @@ -9608,8 +10005,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -9617,86 +10015,101 @@ } }, { - "name": "DateTimeDifferenceMinute", + "name": "TimeAfterHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Minute", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "15", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", + "value": "999", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "16", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "999", "annotation": [] } } @@ -9707,8 +10120,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -9716,98 +10130,101 @@ } }, { - "name": "DateTimeDifferenceSecond", + "name": "TimeAfterMinuteTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Second", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "58", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "50", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } } @@ -9818,8 +10235,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -9827,133 +10245,102 @@ } }, { - "name": "DateTimeDifferenceMillisecond", + "name": "TimeAfterMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Millisecond", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "58", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "59", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", + "value": "999", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "59", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "999", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } } } ] @@ -9963,8 +10350,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3600400", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -9972,62 +10360,101 @@ } }, { - "name": "DateTimeDifferenceWeeks", + "name": "TimeAfterSecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Week", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "28", + "value": "58", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } } @@ -10038,8 +10465,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -10047,62 +10475,101 @@ } }, { - "name": "DateTimeDifferenceWeeks2", + "name": "TimeAfterSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Week", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "58", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2000", + "value": "15", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "59", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "29", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } } @@ -10113,8 +10580,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -10122,98 +10590,101 @@ } }, { - "name": "DateTimeDifferenceWeeks3", + "name": "TimeAfterMillisecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Week", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "999", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "19", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", + "value": "998", "annotation": [] } } @@ -10224,8 +10695,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -10233,125 +10705,114 @@ } }, { - "name": "DateTimeDifferenceNegative", + "name": "TimeAfterMillisecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Year", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "998", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1998", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", "annotation": [] } } ] } }, - { - "name": "output", - "value": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "18", - "annotation": [] - } - } - } - ] - } - }, - { - "name": "DateTimeDifferenceUncertain", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "Greater", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DifferenceBetween", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - ] - } - }, { "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -10359,56 +10820,81 @@ } }, { - "name": "TimeDifferenceHour", + "name": "TimeAfterTimeCstor", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", + "type": "After", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", "annotation": [] } }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "11", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "55", "annotation": [] } } @@ -10419,95 +10905,49 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } ] } - }, - { - "name": "TimeDifferenceMinute", - "value": { - "type": "Tuple", - "annotation": [], + } + ] + } + }, + { + "name": "Before", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeBeforeYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -10515,86 +10955,27 @@ } }, { - "name": "TimeDifferenceSecond", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -10602,1624 +10983,1437 @@ } }, { - "name": "TimeDifferenceMillis", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "550", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } - } - ] - } - }, - { - "name": "From Github issue #29", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeA", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeAA", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeB", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeBB", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeC", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeCC", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeD", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeDD", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeE", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeEE", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeF", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DateTimeFF", - "value": { - "type": "Tuple", + "name": "DateTimeBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } } ] } }, { - "name": "DifferenceInHoursA", - "value": { - "type": "Tuple", + "name": "BeforeTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DifferenceBetween", - "precision": "Hour", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "BeforeTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeBeforeYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "BeforeTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "BeforeTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeBeforeYearTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", + "value": "2003", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", + "value": "10", "annotation": [] } } @@ -12230,8 +12424,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -12239,110 +12434,95 @@ } }, { - "name": "DifferenceInMinutesA", + "name": "DateTimeBeforeYearFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Minute", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "11", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", + "value": "10", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2003", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", + "value": "10", "annotation": [] } } @@ -12353,8 +12533,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -12362,110 +12543,95 @@ } }, { - "name": "DifferenceInDaysA", + "name": "DateTimeBeforeMonthTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Day", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", + "value": "10", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "11", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", + "value": "10", "annotation": [] } } @@ -12476,8 +12642,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -12485,133 +12652,96 @@ } }, { - "name": "DifferenceInHoursAA", + "name": "DateTimeBeforeMonthFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Hour", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "11", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "10", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "10", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } } } ] @@ -12621,8 +12751,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -12630,133 +12761,96 @@ } }, { - "name": "DifferenceInMinutesAA", + "name": "DateTimeBeforeDayTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", - "precision": "Minute", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", "annotation": [] }, "day": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "1", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "10", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } } } ] @@ -12766,8 +12860,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -12775,133 +12870,96 @@ } }, { - "name": "DifferenceInDaysAA", + "name": "DateTimeBeforeDayTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DifferenceBetween", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2003", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "11", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "10", "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } } } ] @@ -12911,59 +12969,105 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "Duration", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeDurationBetweenYear", + "name": "DateTimeBeforeDayFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Year", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2010", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", "annotation": [] } } @@ -12973,84 +13077,133 @@ { "name": "output", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DateTimeDurationBetweenYearOffset", + "name": "DateTimeBeforeHourTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Year", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2010", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "value": "10", "annotation": [] - } - } - ] - } - }, - { - "name": "output", - "value": { + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -13058,62 +13211,109 @@ } }, { - "name": "DateTimeDurationBetweenMonth", + "name": "DateTimeBeforeHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Month", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "Date", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", "annotation": [] } }, { - "type": "Date", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", "annotation": [] } } @@ -13124,8 +13324,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -13133,86 +13334,123 @@ } }, { - "name": "DateTimeDurationBetweenDaysDiffYears", + "name": "DateTimeBeforeMinuteTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Day", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2010", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "20", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "28", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2008", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "value": "20", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "value": "29", "annotation": [] } } @@ -13222,83 +13460,134 @@ { "name": "output", "value": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "788", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } - } - ] - } - }, - { - "name": "Uncertainty tests", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeDurationBetweenUncertainInterval", + "name": "DateTimeBeforeMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Day", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "35", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", "annotation": [] } } @@ -13308,66 +13597,148 @@ { "name": "output", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "44", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DateTimeDurationBetweenUncertainInterval2", + "name": "DateTimeBeforeSecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Month", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", + "value": "2004", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", "annotation": [] } } @@ -13377,135 +13748,150 @@ { "name": "output", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "DateTimeDurationBetweenUncertainAdd", + "name": "DateTimeBeforeSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Add", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + } }, { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + } } ] } @@ -13513,123 +13899,164 @@ { "name": "output", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "32", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "88", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DateTimeDurationBetweenUncertainSubtract", + "name": "DateTimeBeforeMillisecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Subtract", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "508", + "annotation": [] + } }, { - "type": "DurationBetween", - "precision": "Month", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "510", + "annotation": [] + } } ] } @@ -13637,269 +14064,175 @@ { "name": "output", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "40", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] } } ] } }, { - "name": "DateTimeDurationBetweenUncertainMultiply", + "name": "DateTimeBeforeMillisecondFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "Multiply", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DurationBetween", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] - }, - { - "type": "DurationBetween", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "256", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1936", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - } - ] - } - }, - { - "name": "DateTimeDurationBetweenUncertainDiv", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "TruncatedDivide", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "599", + "annotation": [] + } }, { - "type": "DurationBetween", - "precision": "Month", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2004", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "513", + "annotation": [] + } } ] } }, { - "name": "invalid", + "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -13907,59 +14240,151 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain", + "name": "BeforeTimezoneTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Greater", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } } ] } @@ -13968,6 +14393,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -13977,59 +14403,151 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain2", + "name": "BeforeTimezoneFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Greater", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } } ] } @@ -14037,7 +14555,10 @@ { "name": "output", "value": { - "type": "Null", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -14045,59 +14566,103 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain3", + "name": "TimeBeforeHourTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Greater", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "14", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } ] } @@ -14106,8 +14671,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -14115,59 +14681,103 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain4", + "name": "TimeBeforeHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Less", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } ] } @@ -14176,8 +14786,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -14185,59 +14796,103 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain5", + "name": "TimeBeforeMinuteTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "Equal", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", - "annotation": [] + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "57", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "58", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } ] } @@ -14246,8 +14901,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -14255,59 +14911,103 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain6", + "name": "TimeBeforeMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "GreaterOrEqual", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } ] } @@ -14316,8 +15016,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -14325,59 +15026,103 @@ } }, { - "name": "DateTimeDurationBetweenMonthUncertain7", + "name": "TimeBeforeSecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "LessOrEqual", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DurationBetween", - "precision": "Month", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2006", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - } - } - ] + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "57", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } }, { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", - "annotation": [] + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "58", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } } ] } @@ -14386,6 +15131,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -14395,413 +15141,216 @@ } }, { - "name": "DateTime1", + "name": "TimeBeforeSecondFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } - } - }, - { - "name": "output", - "value": { - "type": "DateTime", + }, + { + "name": "output", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } - } - ] - } - }, - { - "name": "DateTime2", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "56", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + } + ] } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] } } ] } }, { - "name": "DurationInYears", + "name": "TimeBeforeMillisecondTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Year", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateFrom", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } - } - }, - { - "type": "DateFrom", - "annotation": [], - "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - } - ] - } - }, - { - "name": "DurationInWeeks", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DurationBetween", - "precision": "Week", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "997", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "19", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", + "value": "998", "annotation": [] } } @@ -14812,8 +15361,9 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -14821,98 +15371,101 @@ } }, { - "name": "DurationInWeeks2", + "name": "TimeBeforeMillisecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Week", + "type": "Before", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "998", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", + "value": "15", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "value": "59", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "19", + "value": "59", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", + "value": "997", "annotation": [] } } @@ -14923,8 +15476,49 @@ "name": "output", "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "DateTime", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -14932,110 +15526,27 @@ } }, { - "name": "DurationInWeeks3", - "value": { - "type": "Tuple", + "name": "DateTimeMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DurationBetween", - "precision": "Week", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "24", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "19", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -15043,86 +15554,27 @@ } }, { - "name": "TimeDurationBetweenHour", - "value": { - "type": "Tuple", + "name": "DateTimeDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DurationBetween", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "26", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -15130,17 +15582,27 @@ } }, { - "name": "TimeDurationBetweenHourDiffPrecision", - "value": { - "type": "Tuple", + "name": "DateTimeHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { - "name": "skipped", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Translation Error: Syntax error at Z", + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -15148,17 +15610,27 @@ } }, { - "name": "TimeDurationBetweenHourDiffPrecision2", - "value": { - "type": "Tuple", + "name": "DateTimeMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { - "name": "skipped", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: Duration in hours between T06 and T07:00:00 should be Uncertainty[0, 1]", + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -15166,86 +15638,27 @@ } }, { - "name": "TimeDurationBetweenMinute", - "value": { - "type": "Tuple", + "name": "DateTimeSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DurationBetween", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } @@ -15253,978 +15666,957 @@ } }, { - "name": "TimeDurationBetweenSecond", + "name": "DateTimeMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeYear", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Second", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "556", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + } } } ] } }, { - "name": "TimeDurationBetweenMillis", + "name": "DateTimeMonth", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Millisecond", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "560", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } } } ] } }, { - "name": "DurationInHoursA", + "name": "DateTimeDay", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Hour", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } } } ] } }, { - "name": "DurationInMinutesA", + "name": "DateTimeHour", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Minute", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } } } ] } }, { - "name": "DurationInDaysA", + "name": "DateTimeMinute", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-7.0", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "-6.0", - "annotation": [] - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + } } } ] } }, { - "name": "DurationInHoursAA", + "name": "DateTimeSecond", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Hour", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } } } ] } }, { - "name": "DurationInMinutesAA", + "name": "DateTimeMillisecond", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DurationBetween", - "precision": "Minute", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } } - } - ] - } - }, - { - "name": "DurationInDaysAA", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Day", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] - } - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "13", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "timezoneOffset": { - "type": "Negate", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] - } - } - } - ] + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } } }, { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } } } ] @@ -16234,109 +16626,64 @@ } }, { - "name": "Now", + "name": "DateTimeComponentFrom", "context": "Patient", "accessLevel": "Public", "annotation": [], - "expression": { - "type": "Tuple", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { - "name": "DateTimeNow", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Equal", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Now", - "annotation": [], - "signature": [] - }, - { - "type": "Now", - "annotation": [], - "signature": [] - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "SameAs", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeSameAsYearTrue", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Year", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16344,50 +16691,27 @@ } }, { - "name": "DateTimeSameAsYearFalse", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromMonthMinBoundary", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Year", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16395,62 +16719,27 @@ } }, { - "name": "DateTimeSameAsMonthTrue", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16458,62 +16747,27 @@ } }, { - "name": "DateTimeSameAsMonthFalse", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Month", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16521,74 +16775,27 @@ } }, { - "name": "DateTimeSameAsDayTrue", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16596,74 +16803,27 @@ } }, { - "name": "DateTimeSameAsDayFalse", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Day", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16671,86 +16831,27 @@ } }, { - "name": "DateTimeSameAsHourTrue", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -16758,86 +16859,27 @@ } }, { - "name": "DateTimeSameAsHourFalse", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromTimezone", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } @@ -16845,408 +16887,21987 @@ } }, { - "name": "DateTimeSameAsMinuteTrue", - "value": { - "type": "Tuple", + "name": "DateTimeComponentFromTimezoneOffset", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromDate", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameAs", - "precision": "Minute", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMilli", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeComponentFromYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - } - } - ] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMonthMinBoundary", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromTimezone", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromTimezoneOffset", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromDate", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMilli", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeComponentFromYear", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMonth", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMonthMinBoundary", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "01", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromDay", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromHour", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMinute", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromSecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromMillisecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromTimezone", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "TimezoneOffsetFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + }, + "timezoneOffset": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.00", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromTimezoneOffset", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Translator error: Timezone keyword is only valid in 1.3 or lower", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeComponentFromDate", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "955", + "annotation": [] + }, + "timezoneOffset": { + "type": "ToDecimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + } + } + }, + { + "name": "output", + "value": { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2003", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "TimeComponentFromHour", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMinute", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromSecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeComponentFromMilli", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Difference", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDifferenceYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceNegative", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMillis", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDifferenceYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceDay", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMillisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceNegative", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMillis", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeDifferenceYear", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMonth", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceDay", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceHour", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMinute", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceSecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "50", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceMillisecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "900", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3600400", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "28", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceWeeks3", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "22", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "19", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDifferenceNegative", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1998", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "18", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDifferenceUncertain", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceHour", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMinute", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceSecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDifferenceMillis", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "550", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + } + ] + } + } + ] + } + }, + { + "name": "From Github issue #29", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeB", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBB", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeC", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeCC", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeE", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeEE", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeF", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeFF", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInHoursA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInHoursAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeB", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeBB", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeC", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeCC", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDD", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeE", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeEE", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeF", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeFF", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInHoursA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInHoursAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeB", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeBB", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeC", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeCC", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeD", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDD", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeE", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeEE", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeF", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeFF", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DifferenceInHoursA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInHoursAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInMinutesAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + } + ] + } + }, + { + "name": "DifferenceInDaysAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DifferenceBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Duration", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDurationBetweenYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenYearOffset", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenDaysDiffYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDurationBetweenYear", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenYearOffset", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonth", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenDaysDiffYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeDurationBetweenYear", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2010", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "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": "4", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenYearOffset", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2010", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonth", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenDaysDiffYears", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2010", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2008", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "8", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "788", + "annotation": [] + } + } + } + ] + } + } + ] + } + }, + { + "name": "Uncertainty tests", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDurationBetweenUncertainInterval", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainInterval2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainAdd", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainSubtract", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainMultiply", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainDiv", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain4", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain5", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain6", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain7", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTime1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTime2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMillis", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeDurationBetweenUncertainInterval", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainInterval2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainAdd", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainSubtract", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainMultiply", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainDiv", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain4", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain5", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain6", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain7", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTime1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTime2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks3", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHour", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMillis", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysAA", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeDurationBetweenUncertainInterval", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: [17, 44] vs [16, 44]", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainInterval2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "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": "4", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainAdd", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + }, + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + ] + } + }, + { + "name": "output", + "value": { + "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": "32", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "88", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainSubtract", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + }, + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + ] + } + }, + { + "name": "output", + "value": { + "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": "0", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "40", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainMultiply", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Multiply", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + }, + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + ] + } + }, + { + "name": "output", + "value": { + "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": "256", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1936", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenUncertainDiv", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "TruncatedDivide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + }, + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + ] + } + }, + { + "name": "invalid", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain3", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain4", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Less", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain5", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain6", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "GreaterOrEqual", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeDurationBetweenMonthUncertain7", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "LessOrEqual", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2006", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + } + } + ] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTime1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTime2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2013", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2013", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DurationInYears", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + }, + { + "type": "DateFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2013", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "22", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "19", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "22", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "19", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInWeeks3", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Week", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "24", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "19", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHour", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "26", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Translator error: Syntax error at Z", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenHourDiffPrecision2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: 1 vs uncertainty [0, 1]", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMinute", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "16", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenSecond", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "556", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "4", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeDurationBetweenMillis", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "560", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "-6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInHoursAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInMinutesAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + } + ] + } + }, + { + "name": "DurationInDaysAA", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2017", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "13", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "timezoneOffset": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Now", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeNow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeNow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeNow", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Now", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [] + }, + { + "type": "Now", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "SameAs", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameAsYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameAsYearTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeSameAsYearTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsYearFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2013", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMonthFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsDayFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "11", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsHourFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMinuteFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "56", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsSecondFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "44", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsMillisecondFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "501", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameAsNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameAsTimezoneFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "900", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsHourFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "22", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "22", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "900", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMinuteFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "26", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "900", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsSecondFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "35", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisTrue", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameAsMillisFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameAs", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "554", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "SameOrAfter", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrAfterYearTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterYearTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterNull1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrAfterTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrAfterTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMillisTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMillisTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMillisFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "OnOrAfterTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "Issue32DateTime", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrAfterYearTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterYearTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrAfterNull1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrAfterTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrAfterTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrAfterSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + ] + } + }, + { + "name": "TimeSameOrAfterSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - } - ] - } - }, - { - "name": "DateTimeSameAsMinuteFalse", - "value": { - "type": "Tuple", + ] + } + }, + { + "name": "TimeSameOrAfterMillisTrue1", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "SameAs", - "precision": "Minute", + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "56", - "annotation": [] - } - } - ] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", - "annotation": [] + ] + } + }, + { + "name": "TimeSameOrAfterMillisTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - } - ] - } - }, - { - "name": "DateTimeSameAsSecondTrue", - "value": { - "type": "Tuple", + ] + } + }, + { + "name": "TimeSameOrAfterMillisFalse", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "SameAs", - "precision": "Second", + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - } - } - ] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] + ] + } + }, + { + "name": "OnOrAfterTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } } - } - ] + ] + } + }, + { + "name": "Issue32DateTime", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } } - }, + ] + }, + "element": [ { - "name": "DateTimeSameAsSecondFalse", + "name": "DateTimeSameOrAfterYearTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Second", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "44", - "annotation": [] } } ] @@ -17256,8 +38877,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -17265,111 +38887,68 @@ } }, { - "name": "DateTimeSameAsMillisecondTrue", + "name": "DateTimeSameOrAfterYearTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Millisecond", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", + "value": "2016", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", - "annotation": [] } } ] @@ -17379,6 +38958,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -17388,110 +38968,67 @@ } }, { - "name": "DateTimeSameAsMillisecondFalse", + "name": "DateTimeSameOrAfterYearFalse", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "SameAs", - "precision": "Millisecond", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "2013", "annotation": [] - }, - "millisecond": { + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "501", + "value": "2014", "annotation": [] } } @@ -17502,6 +39039,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -17511,54 +39049,79 @@ } }, { - "name": "DateTimeSameAsNull", + "name": "DateTimeSameOrAfterMonthTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Day", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "12", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] @@ -17570,7 +39133,10 @@ { "name": "output", "value": { - "type": "Null", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -17578,123 +39144,82 @@ } }, { - "name": "SameAsTimezoneTrue", + "name": "DateTimeSameOrAfterMonthTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Hour", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "9", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", - "annotation": [] } } ] @@ -17704,6 +39229,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -17713,122 +39239,81 @@ } }, { - "name": "SameAsTimezoneFalse", + "name": "DateTimeSameOrAfterMonthFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Hour", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", - "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "11", "annotation": [] } } @@ -17839,6 +39324,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -17848,74 +39334,95 @@ } }, { - "name": "TimeSameAsHourTrue", + "name": "DateTimeSameOrAfterDayTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Hour", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "2014", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "12", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "20", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "2014", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "12", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "20", "annotation": [] } } @@ -17926,6 +39433,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -17935,74 +39443,95 @@ } }, { - "name": "TimeSameAsHourFalse", + "name": "DateTimeSameOrAfterDayTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Hour", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "2014", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "20", "annotation": [] } } @@ -18013,8 +39542,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -18022,75 +39552,96 @@ } }, { - "name": "TimeSameAsMinuteTrue", + "name": "DateTimeSameOrAfterDayFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Minute", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "2014", "annotation": [] }, - "second": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "10", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "20", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] } } ] @@ -18100,8 +39651,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -18109,74 +39661,109 @@ } }, { - "name": "TimeSameAsMinuteFalse", + "name": "DateTimeSameOrAfterHourTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Minute", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "26", + "value": "12", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "12", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", "annotation": [] } } @@ -18187,8 +39774,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -18196,74 +39784,109 @@ } }, { - "name": "TimeSameAsSecondTrue", + "name": "DateTimeSameOrAfterHourTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Second", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "10", "annotation": [] } } @@ -18274,6 +39897,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -18283,74 +39907,109 @@ } }, { - "name": "TimeSameAsSecondFalse", + "name": "DateTimeSameOrAfterHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Second", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", + "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "15", "annotation": [] } } @@ -18361,6 +40020,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -18370,74 +40030,123 @@ } }, { - "name": "TimeSameAsMillisTrue", + "name": "DateTimeSameOrAfterMinuteTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Millisecond", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "12", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "12", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", "annotation": [] } } @@ -18448,6 +40157,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -18457,74 +40167,123 @@ } }, { - "name": "TimeSameAsMillisFalse", + "name": "DateTimeSameOrAfterMinuteTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameAs", - "precision": "Millisecond", + "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "2014", "annotation": [] }, - "minute": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, - "second": { + "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "millisecond": { + "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "554", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", "annotation": [] } } @@ -18535,60 +40294,134 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "SameOrAfter", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeSameOrAfterYearTrue1", + "name": "DateTimeSameOrAfterMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] } } ] @@ -18598,8 +40431,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -18607,39 +40441,138 @@ } }, { - "name": "DateTimeSameOrAfterYearTrue2", + "name": "DateTimeSameOrAfterSecondTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] } } ] @@ -18649,6 +40582,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -18658,39 +40592,138 @@ } }, { - "name": "DateTimeSameOrAfterYearFalse", + "name": "DateTimeSameOrAfterSecondTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] } } ] @@ -18700,8 +40733,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -18709,50 +40743,137 @@ } }, { - "name": "DateTimeSameOrAfterMonthTrue1", + "name": "DateTimeSameOrAfterSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", "annotation": [] } } @@ -18763,8 +40884,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -18772,50 +40894,151 @@ } }, { - "name": "DateTimeSameOrAfterMonthTrue2", + "name": "DateTimeSameOrAfterMillisecondTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "250", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "250", "annotation": [] } } @@ -18826,6 +41049,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -18835,50 +41059,151 @@ } }, { - "name": "DateTimeSameOrAfterMonthFalse", + "name": "DateTimeSameOrAfterMillisecondTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "499", "annotation": [] } } @@ -18889,8 +41214,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -18898,63 +41224,152 @@ } }, { - "name": "DateTimeSameOrAfterDayTrue1", + "name": "DateTimeSameOrAfterMillisecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "500", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "501", + "annotation": [] } } ] @@ -18964,8 +41379,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -18973,62 +41389,88 @@ } }, { - "name": "DateTimeSameOrAfterDayTrue2", + "name": "DateTimeSameOrAfterNull1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "12", "annotation": [] } } @@ -19038,9 +41480,8 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -19048,62 +41489,149 @@ } }, { - "name": "DateTimeSameOrAfterDayFalse", + "name": "SameOrAfterTimezoneTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", "annotation": [] } } @@ -19114,8 +41642,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -19123,74 +41652,149 @@ } }, { - "name": "DateTimeSameOrAfterHourTrue1", + "name": "SameOrAfterTimezoneFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", "annotation": [] } } @@ -19201,8 +41805,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -19210,74 +41815,101 @@ } }, { - "name": "DateTimeSameOrAfterHourTrue2", + "name": "TimeSameOrAfterHourTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "55", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "900", "annotation": [] } } @@ -19288,6 +41920,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -19297,74 +41930,101 @@ } }, { - "name": "DateTimeSameOrAfterHourFalse", + "name": "TimeSameOrAfterHourTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "22", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "55", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "900", "annotation": [] } } @@ -19375,8 +42035,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -19384,86 +42045,101 @@ } }, { - "name": "DateTimeSameOrAfterMinuteTrue1", + "name": "TimeSameOrAfterHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "22", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "25", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "55", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "25", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "900", "annotation": [] } } @@ -19474,8 +42150,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -19483,86 +42160,101 @@ } }, { - "name": "DateTimeSameOrAfterMinuteTrue2", + "name": "TimeSameOrAfterMinuteTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "900", "annotation": [] } } @@ -19573,6 +42265,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -19582,86 +42275,101 @@ } }, { - "name": "DateTimeSameOrAfterMinuteFalse", + "name": "TimeSameOrAfterMinuteTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "25", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "22", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "15", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "900", "annotation": [] } } @@ -19672,8 +42380,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -19681,98 +42390,101 @@ } }, { - "name": "DateTimeSameOrAfterSecondTrue1", + "name": "TimeSameOrAfterMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Second", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "23", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "25", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "25", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "23", "annotation": [] }, - "hour": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "55", "annotation": [] }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "25", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "900", "annotation": [] } } @@ -19783,8 +42495,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -19792,98 +42505,101 @@ } }, { - "name": "DateTimeSameOrAfterSecondTrue2", + "name": "TimeSameOrAfterSecondTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "900", "annotation": [] } } @@ -19894,6 +42610,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -19903,98 +42620,101 @@ } }, { - "name": "DateTimeSameOrAfterSecondFalse", + "name": "TimeSameOrAfterSecondTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "35", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "22", "annotation": [] }, - "day": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "minute": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "25", "annotation": [] }, - "second": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", + "value": "900", "annotation": [] } } @@ -20005,8 +42725,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -20014,110 +42735,101 @@ } }, { - "name": "DateTimeSameOrAfterMillisecondTrue1", + "name": "TimeSameOrAfterSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Millisecond", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "250", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "35", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "250", + "value": "900", "annotation": [] } } @@ -20128,8 +42840,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -20137,45 +42850,53 @@ } }, { - "name": "DateTimeSameOrAfterMillisecondTrue2", + "name": "TimeSameOrAfterMillisTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { @@ -20187,42 +42908,25 @@ "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { @@ -20234,13 +42938,13 @@ "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "499", + "value": "555", "annotation": [] } } @@ -20251,6 +42955,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -20260,110 +42965,101 @@ } }, { - "name": "DateTimeSameOrAfterMillisecondFalse", + "name": "TimeSameOrAfterMillisTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "25", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "500", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "22", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "25", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "501", + "value": "550", "annotation": [] } } @@ -20374,8 +43070,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -20383,56 +43080,101 @@ } }, { - "name": "DateTimeSameOrAfterNull1", + "name": "TimeSameOrAfterMillisFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "55", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "55", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "900", "annotation": [] } } @@ -20442,7 +43184,10 @@ { "name": "output", "value": { - "type": "Null", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", "annotation": [] } } @@ -20450,51 +43195,76 @@ } }, { - "name": "SameOrAfterTimezoneTrue", + "name": "OnOrAfterTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2017", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "12", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "20", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "11", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "0", "annotation": [] }, "second": { @@ -20506,48 +43276,43 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2017", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "12", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "20", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "11", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "0", "annotation": [] }, "second": { @@ -20559,13 +43324,7 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "0", "annotation": [] } } @@ -20576,6 +43335,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -20585,51 +43345,76 @@ } }, { - "name": "SameOrAfterTimezoneFalse", + "name": "Issue32DateTime", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrAfter", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2017", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "12", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "21", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "2", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "0", "annotation": [] }, "second": { @@ -20641,48 +43426,43 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "2017", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "12", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "20", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "11", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "0", "annotation": [] }, "second": { @@ -20694,13 +43474,7 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "0", "annotation": [] } } @@ -20709,10 +43483,695 @@ }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "SameOrBefore", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrBeforeYearTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeYearTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeNull1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrBeforeTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrBeforeTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -20720,86 +44179,27 @@ } }, { - "name": "TimeSameOrAfterHourTrue1", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -20807,86 +44207,27 @@ } }, { - "name": "TimeSameOrAfterHourTrue2", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -20894,86 +44235,27 @@ } }, { - "name": "TimeSameOrAfterHourFalse", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -20981,86 +44263,27 @@ } }, { - "name": "TimeSameOrAfterMinuteTrue1", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -21068,86 +44291,27 @@ } }, { - "name": "TimeSameOrAfterMinuteTrue2", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeMinuteFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -21155,86 +44319,139 @@ } }, { - "name": "TimeSameOrAfterMinuteFalse", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMillisTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -21242,86 +44459,27 @@ } }, { - "name": "TimeSameOrAfterSecondTrue1", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeMillisFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } @@ -21329,161 +44487,1115 @@ } }, { - "name": "TimeSameOrAfterSecondTrue2", - "value": { - "type": "Tuple", + "name": "TimeSameOrBeforeMillisFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrAfter", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [] } } ] } - }, + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrBeforeYearTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeYearTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeYearFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMonthFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeDayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeMillisecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeNull1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrBeforeTimezoneTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "SameOrBeforeTimezoneFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeHourTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeHourTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeHourFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMinuteTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMinuteFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMinuteFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMillisTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMillisFalse0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeMillisFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ { - "name": "TimeSameOrAfterSecondFalse", + "name": "DateTimeSameOrBeforeYearTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", - "precision": "Second", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", + "value": "2014", "annotation": [] - }, - "millisecond": { + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "2014", "annotation": [] } } @@ -21494,8 +45606,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -21503,74 +45616,67 @@ } }, { - "name": "TimeSameOrAfterMillisTrue1", + "name": "DateTimeSameOrBeforeYearTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", - "precision": "Millisecond", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "2013", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "2014", "annotation": [] } } @@ -21581,6 +45687,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -21590,74 +45697,67 @@ } }, { - "name": "TimeSameOrAfterMillisTrue2", + "name": "DateTimeSameOrBeforeYearFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", - "precision": "Millisecond", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Year", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "2015", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "550", + "value": "2014", "annotation": [] } } @@ -21668,8 +45768,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -21677,74 +45778,81 @@ } }, { - "name": "TimeSameOrAfterMillisFalse", + "name": "DateTimeSameOrBeforeMonthTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", - "precision": "Millisecond", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "2014", "annotation": [] }, - "millisecond": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "12", "annotation": [] } }, { - "type": "Time", + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { + "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "2014", "annotation": [] }, - "millisecond": { + "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "12", "annotation": [] } } @@ -21755,8 +45863,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -21764,109 +45873,81 @@ } }, { - "name": "OnOrAfterTrue", + "name": "DateTimeSameOrBeforeMonthTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "8", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "9", "annotation": [] } } @@ -21877,6 +45958,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -21886,110 +45968,82 @@ } }, { - "name": "Issue32DateTime", + "name": "DateTimeSameOrBeforeMonthFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "SameOrAfter", + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Month", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2017", + "value": "2014", "annotation": [] }, "month": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", - "annotation": [] - }, - "hour": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "11", "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] } } ] @@ -21999,60 +46053,106 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "SameOrBefore", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "DateTimeSameOrBeforeYearTrue1", + "name": "DateTimeSameOrBeforeDayTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] } } ] @@ -22062,6 +46162,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22071,39 +46172,96 @@ } }, { - "name": "DateTimeSameOrBeforeYearTrue2", + "name": "DateTimeSameOrBeforeDayTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2013", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] } } ] @@ -22113,6 +46271,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22122,39 +46281,96 @@ } }, { - "name": "DateTimeSameOrBeforeYearFalse", + "name": "DateTimeSameOrBeforeDayFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Year", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] } } ] @@ -22164,6 +46380,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -22173,31 +46390,73 @@ } }, { - "name": "DateTimeSameOrBeforeMonthTrue1", + "name": "DateTimeSameOrBeforeHourTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] @@ -22205,16 +46464,33 @@ }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] @@ -22227,6 +46503,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22236,50 +46513,109 @@ } }, { - "name": "DateTimeSameOrBeforeMonthTrue2", + "name": "DateTimeSameOrBeforeHourTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "8", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", "annotation": [] } } @@ -22290,6 +46626,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22299,50 +46636,109 @@ } }, { - "name": "DateTimeSameOrBeforeMonthFalse", + "name": "DateTimeSameOrBeforeHourFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Month", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "11", + "value": "10", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", "annotation": [] } } @@ -22353,6 +46749,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -22362,63 +46759,124 @@ } }, { - "name": "DateTimeSameOrBeforeDayTrue1", + "name": "DateTimeSameOrBeforeMinuteTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] } } ] @@ -22428,6 +46886,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22437,62 +46896,123 @@ } }, { - "name": "DateTimeSameOrBeforeDayTrue2", + "name": "DateTimeSameOrBeforeMinuteTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", "annotation": [] } } @@ -22503,6 +47023,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22512,63 +47033,124 @@ } }, { - "name": "DateTimeSameOrBeforeDayFalse", + "name": "DateTimeSameOrBeforeMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Day", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "25", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "55", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] } } ] @@ -22578,6 +47160,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -22587,75 +47170,138 @@ } }, { - "name": "DateTimeSameOrBeforeHourTrue1", + "name": "DateTimeSameOrBeforeSecondTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] } } ] @@ -22665,6 +47311,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22674,75 +47321,138 @@ } }, { - "name": "DateTimeSameOrBeforeHourTrue2", + "name": "DateTimeSameOrBeforeSecondTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "value": "10", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] } } ] @@ -22752,6 +47462,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22761,75 +47472,138 @@ } }, { - "name": "DateTimeSameOrBeforeHourFalse", + "name": "DateTimeSameOrBeforeSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "15", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "15", "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "21", + "annotation": [] } } ] @@ -22839,6 +47613,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -22848,87 +47623,152 @@ } }, { - "name": "DateTimeSameOrBeforeMinuteTrue1", + "name": "DateTimeSameOrBeforeMillisecondTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "30", "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "250", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "30", "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "15", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "250", + "annotation": [] } } ] @@ -22938,6 +47778,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -22947,87 +47788,152 @@ } }, { - "name": "DateTimeSameOrBeforeMinuteTrue2", + "name": "DateTimeSameOrBeforeMillisecondTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "450", + "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "499", + "annotation": [] } } ] @@ -23037,6 +47943,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -23046,87 +47953,152 @@ } }, { - "name": "DateTimeSameOrBeforeMinuteFalse", + "name": "DateTimeSameOrBeforeMillisecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "15", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "45", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "505", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "15", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "45", "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "20", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "501", + "annotation": [] } } ] @@ -23136,6 +48108,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -23145,96 +48118,100 @@ } }, { - "name": "DateTimeSameOrBeforeSecondTrue1", + "name": "DateTimeSameOrBeforeNull1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Any", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Second", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "12", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "hour": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - }, - "second": { - "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "15", "annotation": [] @@ -23246,9 +48223,8 @@ { "name": "output", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "type": "Null", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } } @@ -23256,209 +48232,149 @@ } }, { - "name": "DateTimeSameOrBeforeSecondTrue2", + "name": "SameOrBeforeTimezoneTrue", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Second", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "9", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "20", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "0", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "999", "annotation": [] }, - "second": { + "timezoneOffset": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", "annotation": [] } - } - ] - } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } - } - ] - } - }, - { - "name": "DateTimeSameOrBeforeSecondFalse", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ + }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "10", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "20", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - } - }, - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "0", "annotation": [] }, - "minute": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "999", "annotation": [] }, - "second": { + "timezoneOffset": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", "annotation": [] } } @@ -23469,8 +48385,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -23478,110 +48395,149 @@ } }, { - "name": "DateTimeSameOrBeforeMillisecondTrue1", + "name": "SameOrBeforeTimezoneFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Millisecond", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "20", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "0", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "250", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "6.0", "annotation": [] } }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "3", "annotation": [] }, "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "10", "annotation": [] }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "10", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", + "value": "20", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "0", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "250", + "value": "999", + "annotation": [] + }, + "timezoneOffset": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "7.0", "annotation": [] } } @@ -23592,8 +48548,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -23601,45 +48558,53 @@ } }, { - "name": "DateTimeSameOrBeforeMillisecondTrue2", + "name": "TimeSameOrBeforeHourTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Millisecond", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { @@ -23651,60 +48616,43 @@ "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "450", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "499", + "value": "900", "annotation": [] } } @@ -23715,6 +48663,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -23724,110 +48673,216 @@ } }, { - "name": "DateTimeSameOrBeforeMillisecondFalse", + "name": "TimeSameOrBeforeHourTrue2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Millisecond", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "21", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "22", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "505", + "value": "900", "annotation": [] } - }, + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeHourFalse", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "22", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "25", "annotation": [] }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "21", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "501", + "value": "900", "annotation": [] } } @@ -23838,6 +48893,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -23847,68 +48903,101 @@ } }, { - "name": "DateTimeSameOrBeforeNull1", + "name": "TimeSameOrBeforeMinuteTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2014", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "900", "annotation": [] } } @@ -23918,7 +49007,10 @@ { "name": "output", "value": { - "type": "Null", + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", "annotation": [] } } @@ -23926,122 +49018,101 @@ } }, { - "name": "SameOrBeforeTimezoneTrue", + "name": "TimeSameOrBeforeMinuteFalse0", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "10", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "555", "annotation": [] } }, { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "22", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "15", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "900", "annotation": [] } } @@ -24052,8 +49123,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -24061,122 +49133,216 @@ } }, { - "name": "SameOrBeforeTimezoneFalse", + "name": "TimeSameOrBeforeMinuteFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Minute", "annotation": [], "signature": [], "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "56", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "6.0", + "value": "900", "annotation": [] } - }, + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "false", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSameOrBeforeSecondTrue1", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", + "annotation": [], + "signature": [], + "operand": [ { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", + "value": "23", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "25", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "25", "annotation": [] }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "555", + "annotation": [] + } + }, + { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "20", + "value": "25", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + "value": "25", "annotation": [] }, "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - }, - "timezoneOffset": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "7.0", + "value": "900", "annotation": [] } } @@ -24187,8 +49353,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -24196,21 +49363,47 @@ } }, { - "name": "TimeSameOrBeforeHourTrue1", + "name": "TimeSameOrBeforeSecondFalse0", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -24228,7 +49421,7 @@ "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "35", "annotation": [] }, "millisecond": { @@ -24240,24 +49433,25 @@ }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "22", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "25", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "45", "annotation": [] }, "millisecond": { @@ -24274,8 +49468,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -24283,39 +49478,65 @@ } }, { - "name": "TimeSameOrBeforeHourTrue2", + "name": "TimeSameOrBeforeSecondFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Second", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "55", "annotation": [] }, "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "45", "annotation": [] }, "millisecond": { @@ -24327,12 +49548,13 @@ }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "23", "annotation": [] }, "minute": { @@ -24344,7 +49566,7 @@ "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", + "value": "35", "annotation": [] }, "millisecond": { @@ -24361,8 +49583,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -24370,27 +49593,53 @@ } }, { - "name": "TimeSameOrBeforeHourFalse", + "name": "TimeSameOrBeforeMillisTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Hour", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "23", "annotation": [] }, "minute": { @@ -24414,18 +49663,19 @@ }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "21", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", + "value": "25", "annotation": [] }, "second": { @@ -24437,7 +49687,7 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "555", "annotation": [] } } @@ -24448,8 +49698,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "value": "true", "annotation": [] } } @@ -24457,21 +49708,47 @@ } }, { - "name": "TimeSameOrBeforeMinuteTrue1", + "name": "TimeSameOrBeforeMillisFalse0", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -24495,18 +49772,19 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "200", "annotation": [] } }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "22", "annotation": [] }, "minute": { @@ -24524,7 +49802,7 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", + "value": "550", "annotation": [] } } @@ -24535,8 +49813,9 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "value": "false", "annotation": [] } } @@ -24544,21 +49823,47 @@ } }, { - "name": "TimeSameOrBeforeMinuteFalse0", + "name": "TimeSameOrBeforeMillisFalse", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", - "precision": "Minute", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "precision": "Millisecond", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -24570,7 +49875,7 @@ "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "55", "annotation": [] }, "second": { @@ -24582,24 +49887,25 @@ "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", + "value": "966", "annotation": [] } }, { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", + "value": "23", "annotation": [] }, "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "15", + "value": "55", "annotation": [] }, "second": { @@ -24622,6 +49928,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -24629,88 +49936,704 @@ } ] } + } + ] + } + }, + { + "name": "Subtract", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSubtract5Years", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } }, { - "name": "TimeSameOrBeforeMinuteFalse", - "value": { - "type": "Tuple", + "name": "DateTimeSubtractInvalidYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Months", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMonthsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractThreeWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapDaySubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapYearSubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractDaysUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractHoursUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Minutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMinutesUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Seconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract1YearInSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract15HourPrecisionSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractSecondsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Milliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMillisecondsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract2YearsAsMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract2YearsAsMonthsRem1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract2YearsAsMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract2YearsAsMonthsRem1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract33Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Minute", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "56", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } } @@ -24718,86 +50641,27 @@ } }, { - "name": "TimeSameOrBeforeSecondTrue1", - "value": { - "type": "Tuple", + "name": "DateSubtract1Year", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } } @@ -24805,86 +50669,27 @@ } }, { - "name": "TimeSameOrBeforeSecondFalse0", - "value": { - "type": "Tuple", + "name": "TimeSubtract5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -24892,86 +50697,27 @@ } }, { - "name": "TimeSameOrBeforeSecondFalse", - "value": { - "type": "Tuple", + "name": "TimeSubtract1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Second", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "45", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "35", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -24979,86 +50725,27 @@ } }, { - "name": "TimeSameOrBeforeMillisTrue1", - "value": { - "type": "Tuple", + "name": "TimeSubtract1Second", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "555", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -25066,86 +50753,27 @@ } }, { - "name": "TimeSameOrBeforeMillisFalse0", - "value": { - "type": "Tuple", + "name": "TimeSubtract1Millisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "200", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "22", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "550", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -25153,86 +50781,55 @@ } }, { - "name": "TimeSameOrBeforeMillisFalse", - "value": { - "type": "Tuple", + "name": "TimeSubtract5Hours1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "SameOrBefore", - "precision": "Millisecond", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "966", - "annotation": [] - } - }, - { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "55", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "900", - "annotation": [] - } - } - ] + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract5hoursByMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "false", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -25240,48 +50837,964 @@ } } ] - } - }, - { - "name": "Subtract", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], + }, "expression": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSubtract5Years", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractInvalidYears", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Months", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMonthsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractThreeWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapDaySubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLeapYearSubtractYearInWeeks", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractDaysUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractHoursUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Minutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMinutesUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Seconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract1YearInSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract15HourPrecisionSecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractSecondsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Milliseconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtractMillisecondsUnderflow", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract2YearsAsMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSubtract2YearsAsMonthsRem1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract2YearsAsMonths", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract2YearsAsMonthsRem1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract33Days", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateSubtract1Year", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract5Hours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract1Second", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract1Millisecond", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract5Hours1Minute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeSubtract5hoursByMinute", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "DateTimeSubtract5Years", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -25289,6 +51802,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "years", "annotation": [] @@ -25300,6 +51814,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -25330,32 +51845,61 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -25363,6 +51907,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 2005, "unit": "years", "annotation": [] @@ -25374,6 +51919,7 @@ "name": "invalid", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -25387,32 +51933,61 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -25420,6 +51995,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "months", "annotation": [] @@ -25431,6 +52007,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -25461,32 +52038,61 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -25494,6 +52100,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 6, "unit": "months", "annotation": [] @@ -25505,6 +52112,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -25535,37 +52143,67 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2018", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "23", "annotation": [] @@ -25573,6 +52211,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 3, "unit": "weeks", "annotation": [] @@ -25581,22 +52220,26 @@ }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2018", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2", "annotation": [] @@ -25609,6 +52252,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -25622,37 +52266,67 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2018", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "23", "annotation": [] @@ -25660,6 +52334,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 52, "unit": "weeks", "annotation": [] @@ -25668,22 +52343,26 @@ }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2017", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "24", "annotation": [] @@ -25696,6 +52375,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -25709,37 +52389,67 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2024", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "29", "annotation": [] @@ -25747,6 +52457,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 52, "unit": "weeks", "annotation": [] @@ -25755,22 +52466,26 @@ }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2023", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "3", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2", "annotation": [] @@ -25783,6 +52498,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -25796,37 +52512,67 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2024", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "3", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "1", "annotation": [] @@ -25834,6 +52580,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 52, "unit": "weeks", "annotation": [] @@ -25842,22 +52589,26 @@ }, { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2023", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "3", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "3", "annotation": [] @@ -25870,6 +52621,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -25883,32 +52635,61 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -25916,6 +52697,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "days", "annotation": [] @@ -25927,6 +52709,224 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeSubtractDaysUnderflow", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 11, + "unit": "days", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "30", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeSubtract5Hours", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2005", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "hours", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -25944,82 +52944,14 @@ "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - } - } - } - ] - } - }, - { - "name": "DateTimeSubtractDaysUnderflow", - "value": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "Subtract", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 11, - "unit": "days", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", + "value": "10", "annotation": [] }, - "month": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] } } } @@ -26027,128 +52959,72 @@ } }, { - "name": "DateTimeSubtract5Hours", + "name": "DateTimeSubtractHoursUnderflow", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "Subtract", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - }, - { - "type": "Quantity", - "value": 5, - "unit": "hours", - "annotation": [] - } - ] - } - }, - { - "name": "output", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2005", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [] } } - } - ] - } - }, - { - "name": "DateTimeSubtractHoursUnderflow", - "value": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] @@ -26156,6 +53032,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 6, "unit": "hours", "annotation": [] @@ -26167,6 +53044,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26203,44 +53081,75 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -26248,6 +53157,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "minutes", "annotation": [] @@ -26259,6 +53169,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26301,44 +53212,75 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] @@ -26346,6 +53288,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 6, "unit": "minutes", "annotation": [] @@ -26357,6 +53300,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26399,50 +53343,82 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -26450,6 +53426,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "seconds", "annotation": [] @@ -26461,6 +53438,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26509,13 +53487,29 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, "element": [ { "name": "skipped", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Spec says to convert more precise duration to most precise unit in Date. How do you convert seconds to months? 31535999 is 364.999 days, which isn't quite 12 months, so we answer 2015-06.", + "value": "Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05", "annotation": [] } } @@ -26527,50 +53521,82 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "1", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "20", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "30", "annotation": [] @@ -26578,6 +53604,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 15, "unit": "hours", "annotation": [] @@ -26589,6 +53616,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26637,50 +53665,82 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] @@ -26688,6 +53748,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 6, "unit": "seconds", "annotation": [] @@ -26699,6 +53760,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26747,56 +53809,89 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2005", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "millisecond": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] @@ -26804,6 +53899,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "milliseconds", "annotation": [] @@ -26815,6 +53911,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26869,56 +53966,89 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2016", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "10", "annotation": [] }, "hour": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "minute": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "second": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] }, "millisecond": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "5", "annotation": [] @@ -26926,6 +54056,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 6, "unit": "milliseconds", "annotation": [] @@ -26937,6 +54068,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -26991,20 +54123,47 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] @@ -27012,6 +54171,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 24, "unit": "months", "annotation": [] @@ -27023,6 +54183,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -27041,20 +54202,47 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "operand": [ { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] @@ -27062,6 +54250,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 25, "unit": "months", "annotation": [] @@ -27073,6 +54262,7 @@ "name": "output", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { @@ -27091,20 +54281,47 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] @@ -27112,6 +54329,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 24, "unit": "months", "annotation": [] @@ -27123,6 +54341,7 @@ "name": "output", "value": { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { @@ -27141,20 +54360,47 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] @@ -27162,6 +54408,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 25, "unit": "months", "annotation": [] @@ -27173,6 +54420,7 @@ "name": "output", "value": { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { @@ -27191,26 +54439,54 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] @@ -27218,6 +54494,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 33, "unit": "days", "annotation": [] @@ -27229,6 +54506,7 @@ "name": "output", "value": { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { @@ -27253,26 +54531,54 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "2014", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "6", "annotation": [] @@ -27280,6 +54586,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "year", "annotation": [] @@ -27291,6 +54598,7 @@ "name": "output", "value": { "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "year": { @@ -27315,16 +54623,42 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27354,6 +54688,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "hours", "annotation": [] @@ -27365,6 +54700,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27401,16 +54737,42 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27440,6 +54802,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "minutes", "annotation": [] @@ -27451,6 +54814,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27487,16 +54851,42 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27526,6 +54916,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "seconds", "annotation": [] @@ -27537,6 +54928,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27573,16 +54965,42 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27612,6 +55030,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "milliseconds", "annotation": [] @@ -27623,6 +55042,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27659,21 +55079,48 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27703,6 +55150,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 5, "unit": "hours", "annotation": [] @@ -27711,6 +55159,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "minutes", "annotation": [] @@ -27722,6 +55171,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27758,16 +55208,42 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Subtract", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "operand": [ { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27797,6 +55273,7 @@ }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 300, "unit": "minutes", "annotation": [] @@ -27808,6 +55285,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27847,20 +55325,113 @@ "context": "Patient", "accessLevel": "Public", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TimeTest2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + } + ] + }, "expression": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TimeTest2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "TimeTest2", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27893,6 +55464,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -27932,30 +55504,125 @@ "context": "Patient", "accessLevel": "Public", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TimeOfDayTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, "expression": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TimeOfDayTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "TimeOfDayTest", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "TimeOfDay", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [] }, { "type": "TimeOfDay", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [] } @@ -27966,6 +55633,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -27982,31 +55650,350 @@ "context": "Patient", "accessLevel": "Public", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrBeforeTodayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeTodayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeTodayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddTodayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "Issue34B", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, "expression": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeSameOrBeforeTodayTrue1", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeTodayTrue2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeSameOrBeforeTodayFalse", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeAddTodayTrue", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "Issue34B", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "DateTimeSameOrBeforeTodayTrue1", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] } @@ -28017,6 +56004,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -28030,32 +56018,61 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "days", "annotation": [] @@ -28069,6 +56086,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -28082,27 +56100,55 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "SameOrBefore", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "precision": "Day", "annotation": [], "signature": [], "operand": [ { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "years", "annotation": [] @@ -28111,6 +56157,7 @@ }, { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] } @@ -28121,6 +56168,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "false", "annotation": [] @@ -28134,26 +56182,54 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Greater", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Add", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", "value": 1, "unit": "days", "annotation": [] @@ -28162,6 +56238,7 @@ }, { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] } @@ -28172,6 +56249,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] @@ -28185,21 +56263,48 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Equal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "annotation": [], "signature": [], "operand": [ { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] }, { "type": "Today", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", "annotation": [], "signature": [] } @@ -28210,6 +56315,7 @@ "name": "output", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", "valueType": "{urn:hl7-org:elm-types:r1}Boolean", "value": "true", "annotation": [] diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql index eb465ed41..d8d7c9407 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql @@ -364,7 +364,7 @@ define "Contains": Tuple{ output: null }, "TestNullElement1": Tuple{ - expression: null contains 5, + expression: null as Interval contains 5, output: false }, "TestNullElement2": Tuple{ @@ -531,12 +531,6 @@ define "Equal": Tuple{ } define "Except": Tuple{ - "NullInterval": Tuple{ - skipped: 'Wrong answer (Interval(null, null) vs null)' - /* - expression: Interval[null, null], - output: null - */ }, "TestExceptNull": Tuple{ expression: Interval[null, null] except Interval[null, null], output: null @@ -550,17 +544,21 @@ define "Except": Tuple{ output: null }, "DecimalIntervalExcept1to3": Tuple{ + skipped: '# Wrong output: Interval Except should be precision-aware (based on interval Start/End).' + /* expression: Interval[1.0, 10.0] except Interval[4.0, 10.0], output: Interval [ 1.0, 3.99999999 ] - }, + */ }, "DecimalIntervalExceptNull": Tuple{ expression: Interval[1.0, 10.0] except Interval[3.0, 7.0], output: null }, "QuantityIntervalExcept1to4": Tuple{ + skipped: '# Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale' + /* expression: Interval[1.0 'g', 10.0 'g'] except Interval[5.0 'g', 10.0 'g'], output: Interval [ 1.0 'g', 4.99999999 'g' ] - }, + */ }, "Except12": Tuple{ expression: Interval[1, 4] except Interval[3, 6], output: Interval [ 1, 2 ] diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.json b/test/spec-tests/cql/CqlIntervalOperatorsTest.json index 8fc6eda5e..350371239 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.json +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.json @@ -22113,7 +22113,17 @@ "operand": [ { "type": "As", + "strict": false, "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, "signature": [], "operand": { "type": "Null", @@ -22123,8 +22133,20 @@ "asTypeSpecifier": { "type": "IntervalTypeSpecifier", "annotation": [], + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "localId": "4130", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "localId": "4131", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, "pointType": { "type": "NamedTypeSpecifier", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } @@ -29184,25 +29206,6 @@ "type": "TupleTypeSpecifier", "annotation": [], "element": [ - { - "name": "NullInterval", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - } - }, { "name": "TestExceptNull", "annotation": [], @@ -29311,29 +29314,12 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] @@ -29379,29 +29365,12 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] @@ -29596,25 +29565,6 @@ "type": "TupleTypeSpecifier", "annotation": [], "element": [ - { - "name": "NullInterval", - "annotation": [], - "elementType": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - } - }, { "name": "TestExceptNull", "annotation": [], @@ -29723,29 +29673,12 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] @@ -29791,29 +29724,12 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] @@ -30002,40 +29918,6 @@ ] }, "element": [ - { - "name": "NullInterval", - "value": { - "type": "Tuple", - "annotation": [], - "resultTypeSpecifier": { - "type": "TupleTypeSpecifier", - "annotation": [], - "element": [ - { - "name": "skipped", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", - "annotation": [] - } - } - ] - }, - "element": [ - { - "name": "skipped", - "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (Interval(null, null) vs null)", - "annotation": [] - } - } - ] - } - }, { "name": "TestExceptNull", "value": { @@ -30432,141 +30314,25 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] }, "element": [ { - "name": "expression", - "value": { - "type": "Except", - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - "signature": [], - "operand": [ - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - "low": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - }, - "high": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "10.0", - "annotation": [] - } - }, - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - "low": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "4.0", - "annotation": [] - }, - "high": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "10.0", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Decimal", - "annotation": [] - } - }, - "low": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "1.0", - "annotation": [] - }, - "high": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", - "valueType": "{urn:hl7-org:elm-types:r1}Decimal", - "value": "3.99999999", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "# Wrong output: Interval Except should be precision-aware (based on interval Start/End).", + "annotation": [] } } ] @@ -30704,141 +30470,25 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] }, "element": [ { - "name": "expression", - "value": { - "type": "Except", - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - "signature": [], - "operand": [ - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - "low": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g", - "annotation": [] - }, - "high": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 10, - "unit": "g", - "annotation": [] - } - }, - { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - "low": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 5, - "unit": "g", - "annotation": [] - }, - "high": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 10, - "unit": "g", - "annotation": [] - } - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "resultTypeSpecifier": { - "type": "IntervalTypeSpecifier", - "annotation": [], - "pointType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Quantity", - "annotation": [] - } - }, - "low": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 1, - "unit": "g", - "annotation": [] - }, - "high": { - "type": "Quantity", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", - "value": 4.99999999, - "unit": "g", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "# Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale", + "annotation": [] } } ] @@ -55327,11 +54977,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "10275", + "localId": "10219", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "10276", + "localId": "10220", "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } @@ -57197,11 +56847,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "10600", + "localId": "10544", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "10601", + "localId": "10545", "name": "{urn:hl7-org:elm-types:r1}Date", "annotation": [] } @@ -83621,11 +83271,11 @@ "annotation": [], "resultTypeSpecifier": { "type": "IntervalTypeSpecifier", - "localId": "15538", + "localId": "15482", "annotation": [], "pointType": { "type": "NamedTypeSpecifier", - "localId": "15539", + "localId": "15483", "name": "{urn:hl7-org:elm-types:r1}Any", "annotation": [] } diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.cql b/test/spec-tests/cql/CqlStringOperatorsTest.cql index 12054e0e6..177e252f2 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.cql +++ b/test/spec-tests/cql/CqlStringOperatorsTest.cql @@ -311,6 +311,12 @@ define "Substring": Tuple{ expression: Substring('ab', -1), output: null }, + "SubstringEmptyAnd0": Tuple{ + skipped: 'Wrong output: Substring(x, x.length) should be null\'. Note similar test SubstringAB2. See https://github.com/cqframework/cql-tests/issues/149' + /* + expression: Substring('', 0), + output: '' + */ }, "SubstringAB0To1": Tuple{ expression: Substring('ab', 0, 1), output: 'a' diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.json b/test/spec-tests/cql/CqlStringOperatorsTest.json index 1fd5e49e9..1f54242c4 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.json +++ b/test/spec-tests/cql/CqlStringOperatorsTest.json @@ -8397,6 +8397,25 @@ ] } }, + { + "name": "SubstringEmptyAnd0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "SubstringAB0To1", "annotation": [], @@ -8686,6 +8705,25 @@ ] } }, + { + "name": "SubstringEmptyAnd0", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "SubstringAB0To1", "annotation": [], @@ -9247,6 +9285,40 @@ ] } }, + { + "name": "SubstringEmptyAnd0", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: Substring(x, x.length) should be null'. Note similar test SubstringAB2. See https://github.com/cqframework/cql-tests/issues/149", + "annotation": [] + } + } + ] + } + }, { "name": "SubstringAB0To1", "value": { diff --git a/test/spec-tests/cql/CqlTypesTest.cql b/test/spec-tests/cql/CqlTypesTest.cql index d81a9f0ef..c3638fa2c 100644 --- a/test/spec-tests/cql/CqlTypesTest.cql +++ b/test/spec-tests/cql/CqlTypesTest.cql @@ -35,9 +35,11 @@ define "Any": Tuple{ define "DateTime": Tuple{ "DateTimeNull": Tuple{ + skipped: 'Wrong answer: null vs DateTime with null components' + /* expression: DateTime(null), output: null - }, + */ }, "DateTimeUpperBoundExcept": Tuple{ expression: DateTime(10000, 12, 31, 23, 59, 59, 999), invalid: true @@ -78,8 +80,8 @@ define "Quantity": Tuple{ output: 150.2 '[lb_av]' }, "QuantityTest2": Tuple{ - expression: 2.5589 '{eskimo kisses}', - output: 2.5589 '{eskimo kisses}' + expression: 2.5589 '{eskimo_kisses}', + output: 2.5589 '{eskimo_kisses}' }, "QuantityFractionalTooBig": Tuple{ expression: 5.999999999 'g', @@ -100,21 +102,29 @@ define "String": Tuple{ define "Time": Tuple{ "TimeUpperBoundHours": Tuple{ + skipped: 'Intentional Translator error: Invalid time input (T24:59:59.999). Use ISO 8601 time representation (hh:mm:ss.fff)' + /* expression: @T24:59:59.999, invalid: 'semantic' - }, + */ }, "TimeUpperBoundMinutes": Tuple{ + skipped: 'Translator error: Invalid time input[...]' + /* expression: @T23:60:59.999, invalid: 'semantic' - }, + */ }, "TimeUpperBoundSeconds": Tuple{ + skipped: 'Translator error: Invalid time input[...]' + /* expression: @T23:59:60.999, invalid: 'semantic' - }, - "TimeUpperBoundMillis": Tuple{ + */ }, + "TimeMillisParsing": Tuple{ + skipped: 'Wrong answer: @T23:59:59.100 vs @T23:59:59.10000' + /* expression: @T23:59:59.10000, - invalid: 'semantic' - }, + output: @T23:59:59.100 + */ }, "TimeProper": Tuple{ expression: @T10:25:12.863, output: @T10:25:12.863 diff --git a/test/spec-tests/cql/CqlTypesTest.json b/test/spec-tests/cql/CqlTypesTest.json index b1551874a..8907ed45d 100644 --- a/test/spec-tests/cql/CqlTypesTest.json +++ b/test/spec-tests/cql/CqlTypesTest.json @@ -4,7 +4,7 @@ { "type": "CqlToElmInfo", "translatorVersion": "4.2.0", - "translatorOptions": "", + "translatorOptions": "EnableResultTypes", "signatureLevel": "None" } ], @@ -66,31 +66,32 @@ "context": "Patient", "accessLevel": "Public", "annotation": [], - "expression": { - "type": "Tuple", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "AnyQuantity", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Quantity", - "value": 5, - "unit": "g", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } }, { "name": "output", - "value": { - "type": "Quantity", - "value": 5, - "unit": "g", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -99,60 +100,27 @@ }, { "name": "AnyDateTime", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2012", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] } } ] @@ -160,72 +128,27 @@ }, { "name": "AnyTime", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } }, { "name": "output", - "value": { - "type": "Time", - "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] } } ] @@ -233,48 +156,33 @@ }, { "name": "AnyInterval", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } }, { "name": "output", - "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } } @@ -284,62 +192,35 @@ }, { "name": "AnyList", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "List", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", "annotation": [], - "element": [ - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - } - ] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } }, { "name": "output", - "value": { - "type": "List", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", "annotation": [], - "element": [ - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", - "annotation": [] - } - ] + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } } } ] @@ -347,31 +228,33 @@ }, { "name": "AnyTuple", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "id", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, { "name": "name", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Chris", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -380,25 +263,26 @@ }, { "name": "output", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "id", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, { "name": "name", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Chris", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -410,78 +294,341 @@ }, { "name": "AnyString", - "value": { - "type": "Tuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Property", - "path": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "AnyQuantity", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "source": { - "type": "Tuple", - "annotation": [], - "element": [ - { - "name": "id", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "5", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "AnyDateTime", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "AnyTime", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "AnyInterval", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "AnyList", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "AnyTuple", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", "annotation": [] } }, { "name": "name", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Chris", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } ] } } - }, - { - "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Chris", - "annotation": [] + ] + } + }, + { + "name": "AnyString", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } } - } - ] + ] + } } - } - ] - } - }, - { - "name": "DateTime", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], + ] + }, "element": [ { - "name": "DateTimeNull", + "name": "AnyQuantity", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Should DateTime(null) really evaluate to null?", + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "g", + "annotation": [] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "g", "annotation": [] } } @@ -489,108 +636,170 @@ } }, { - "name": "DateTimeUpperBoundExcept", + "name": "AnyDateTime", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", "annotation": [], "signature": [], "year": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10000", + "value": "2012", "annotation": [] }, "month": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", + "value": "4", "annotation": [] }, "day": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", + "value": "4", "annotation": [] - }, - "minute": { + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "2012", "annotation": [] }, - "second": { + "month": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "value": "4", "annotation": [] }, - "millisecond": { + "day": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + "value": "4", "annotation": [] } } - }, - { - "name": "invalid", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } } ] } }, { - "name": "DateTimeLowerBoundExcept", + "name": "AnyTime", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], - "year": { + "hour": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0000", + "value": "9", "annotation": [] }, - "month": { + "minute": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "0", "annotation": [] }, - "day": { + "second": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "value": "0", "annotation": [] }, - "hour": { + "millisecond": { "type": "Literal", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "0", "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [], + "signature": [], + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9", + "annotation": [] }, "minute": { "type": "Literal", @@ -611,122 +820,109 @@ "annotation": [] } } - }, - { - "name": "invalid", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Boolean", - "value": "true", - "annotation": [] - } } ] } }, { - "name": "DateTimeProper", + "name": "AnyInterval", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "Interval", + "lowClosed": true, + "highClosed": true, "annotation": [], - "signature": [], - "year": { + "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": "2016", + "value": "2", "annotation": [] }, - "month": { + "high": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "7", "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "910", - "annotation": [] } } }, { "name": "output", "value": { - "type": "DateTime", + "type": "Interval", + "lowClosed": true, + "highClosed": true, "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2016", - "annotation": [] + "resultTypeSpecifier": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } }, - "month": { + "low": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "7", + "value": "2", "annotation": [] }, - "day": { + "high": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", "value": "7", "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "6", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "25", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "33", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "910", - "annotation": [] } } } @@ -734,414 +930,2471 @@ } }, { - "name": "DateTimeIncomplete", + "name": "AnyList", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DateTime", + "type": "List", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + ] } }, { "name": "output", "value": { - "type": "DateTime", + "type": "List", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] + "resultTypeSpecifier": { + "type": "ListTypeSpecifier", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } + "element": [ + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + ] } } ] } }, { - "name": "DateTimeUncertain", + "name": "AnyTuple", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "DurationBetween", - "precision": "Day", + "type": "Tuple", "annotation": [], - "signature": [], - "operand": [ - { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } }, - "day": { + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "id", + "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", + "value": "5", "annotation": [] } }, { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { + "name": "name", + "value": { "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Chris", "annotation": [] - }, - "month": { + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "id", + "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "3", + "value": "5", + "annotation": [] + } + }, + { + "name": "name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Chris", "annotation": [] } } ] } + } + ] + } + }, + { + "name": "AnyString", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Property", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "path": "name", + "annotation": [], + "source": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "id", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "name", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "id", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "5", + "annotation": [] + } + }, + { + "name": "name", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Chris", + "annotation": [] + } + } + ] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Chris", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "DateTime", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUpperBoundExcept", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLowerBoundExcept", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeProper", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeIncomplete", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeMax", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeTimeUnspecified", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "DateTimeNull", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUpperBoundExcept", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLowerBoundExcept", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeProper", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeIncomplete", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUncertain", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeMax", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeTimeUnspecified", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "DateTimeNull", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: null vs DateTime with null components", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeUpperBoundExcept", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + } + }, + { + "name": "invalid", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeLowerBoundExcept", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "invalid", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0000", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + }, + { + "name": "invalid", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + }, + { + "name": "DateTimeProper", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "910", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2016", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "7", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "6", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "25", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "33", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "910", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeIncomplete", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeUncertain", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "IntervalTypeSpecifier", + "annotation": [], + "pointType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Day", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "3", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "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": "18", + "annotation": [] + }, + "high": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "49", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeMin", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0001", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "1", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeMax", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9999", + "annotation": [] + }, + "month": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", + "annotation": [] + }, + "hour": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "9999", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "31", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "23", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "59", + "annotation": [] + }, + "millisecond": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "999", + "annotation": [] + } + } + } + ] + } + }, + { + "name": "DateTimeTimeUnspecified", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "IsNull", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTimeComponentFrom", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Hour", + "annotation": [], + "signature": [], + "operand": { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2015", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "10", + "annotation": [] + } + } + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Boolean", + "valueType": "{urn:hl7-org:elm-types:r1}Boolean", + "value": "true", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "Quantity", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "QuantityTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityTest2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityFractionalTooBig", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "QuantityTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityTest2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityFractionalTooBig", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + } + } + ] + }, + "element": [ + { + "name": "QuantityTest", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 150.2, + "unit": "[lb_av]", + "annotation": [] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 150.2, + "unit": "[lb_av]", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityTest2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2.5589, + "unit": "{eskimo_kisses}", + "annotation": [] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2.5589, + "unit": "{eskimo_kisses}", + "annotation": [] + } + } + ] + } + }, + { + "name": "QuantityFractionalTooBig", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5.999999999, + "unit": "g", + "annotation": [] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5.999999999, + "unit": "g", + "annotation": [] + } + } + ] + } + } + ] + } + }, + { + "name": "String", + "context": "Patient", + "accessLevel": "Public", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "StringTestEscapeQuotes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } }, { "name": "output", - "value": { - "type": "Interval", - "lowClosed": true, - "highClosed": true, - "annotation": [], - "low": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "18", - "annotation": [] - }, - "high": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "49", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } } ] } }, { - "name": "DateTimeMin", - "value": { - "type": "Tuple", + "name": "StringUnicodeTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0001", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] } }, { "name": "output", - "value": { - "type": "DateTime", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + } + ] + }, + "expression": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "StringTestEscapeQuotes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + } + } + ] + } + }, + { + "name": "StringUnicodeTest", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } - } - ] + ] + } } - }, + ] + }, + "element": [ { - "name": "DateTimeMax", + "name": "StringTestEscapeQuotes", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "DateTime", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9999", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "'I start with a single quote and end with a double quote\"", + "annotation": [] + } }, { "name": "output", "value": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9999", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "12", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "31", - "annotation": [] - }, - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "999", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "'I start with a single quote and end with a double quote\"", + "annotation": [] } } ] } }, { - "name": "DateTimeTimeUnspecified", + "name": "StringUnicodeTest", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { - "type": "IsNull", - "annotation": [], - "signature": [], - "operand": { - "type": "DateTimeComponentFrom", - "precision": "Hour", - "annotation": [], - "signature": [], - "operand": { - "type": "DateTime", - "annotation": [], - "signature": [], - "year": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2015", - "annotation": [] - }, - "month": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - "day": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - } - } - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Hi", + "annotation": [] } }, { "name": "output", "value": { "type": "Literal", - "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": "Hi", "annotation": [] } } @@ -1152,35 +3405,46 @@ } }, { - "name": "Quantity", + "name": "Time", "context": "Patient", "accessLevel": "Public", "annotation": [], - "expression": { - "type": "Tuple", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { - "name": "QuantityTest", - "value": { - "type": "Tuple", + "name": "TimeUpperBoundHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { - "name": "expression", - "value": { - "type": "Quantity", - "value": 150.2, - "unit": "[lb_av]", + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } - }, + } + ] + } + }, + { + "name": "TimeUpperBoundMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ { - "name": "output", - "value": { - "type": "Quantity", - "value": 150.2, - "unit": "[lb_av]", + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1188,17 +3452,18 @@ } }, { - "name": "QuantityTest2", - "value": { - "type": "Tuple", + "name": "TimeUpperBoundSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "skipped", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Invalid UCUM unit: According to UCUM spec, custom units only support ASCII characters 33-126, which does not include the space character", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1206,65 +3471,74 @@ } }, { - "name": "QuantityFractionalTooBig", - "value": { - "type": "Tuple", + "name": "TimeMillisParsing", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeProper", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Quantity", - "value": 5.999999999, - "unit": "g", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } }, { "name": "output", - "value": { - "type": "Quantity", - "value": 5.999999999, - "unit": "g", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } ] } - } - ] - } - }, - { - "name": "String", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], - "expression": { - "type": "Tuple", - "annotation": [], - "element": [ + }, { - "name": "StringTestEscapeQuotes", - "value": { - "type": "Tuple", + "name": "TimeAllMax", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "'I start with a single quote and end with a double quote\"", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "'I start with a single quote and end with a double quote\"", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -1272,26 +3546,27 @@ } }, { - "name": "StringUnicodeTest", - "value": { - "type": "Tuple", + "name": "TimeAllMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", "annotation": [], "element": [ { "name": "expression", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Hi", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } }, { "name": "output", - "value": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Hi", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", "annotation": [] } } @@ -1299,29 +3574,205 @@ } } ] - } - }, - { - "name": "Time", - "context": "Patient", - "accessLevel": "Public", - "annotation": [], + }, "expression": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "TimeUpperBoundHours", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeUpperBoundMinutes", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeUpperBoundSeconds", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeMillisParsing", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeProper", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAllMax", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + }, + { + "name": "TimeAllMin", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + } + } + ] + }, "element": [ { "name": "TimeUpperBoundHours", "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, "element": [ { "name": "skipped", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Translation Error: Invalid time input (T24:59:59.999). Use ISO 8601 time representation (hh:mm:ss.fff).", + "value": "Intentional Translator error: Invalid time input (T24:59:59.999). Use ISO 8601 time representation (hh:mm:ss.fff)", "annotation": [] } } @@ -1333,13 +3784,29 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, "element": [ { "name": "skipped", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Translation Error: Invalid time input (T23:60:59.999). Use ISO 8601 time representation (hh:mm:ss.fff).", + "value": "Translator error: Invalid time input[...]", "annotation": [] } } @@ -1351,13 +3818,29 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, "element": [ { "name": "skipped", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Translation Error: Invalid time input (T23:59:60.999). Use ISO 8601 time representation (hh:mm:ss.fff).", + "value": "Translator error: Invalid time input[...]", "annotation": [] } } @@ -1365,49 +3848,33 @@ } }, { - "name": "TimeUpperBoundMillis", + "name": "TimeMillisParsing", "value": { "type": "Tuple", "annotation": [], - "element": [ - { - "name": "expression", - "value": { - "type": "Time", + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", "annotation": [], - "signature": [], - "hour": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "23", - "annotation": [] - }, - "minute": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "second": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "59", - "annotation": [] - }, - "millisecond": { - "type": "Literal", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10000", + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } - }, + ] + }, + "element": [ { - "name": "invalid", + "name": "skipped", "value": { "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "semantic", + "value": "Wrong answer: @T23:59:59.100 vs @T23:59:59.10000", "annotation": [] } } @@ -1419,11 +3886,36 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -1456,6 +3948,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -1492,11 +3985,36 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -1529,6 +4047,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -1565,11 +4084,36 @@ "value": { "type": "Tuple", "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Time", + "annotation": [] + } + } + ] + }, "element": [ { "name": "expression", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { @@ -1602,6 +4146,7 @@ "name": "output", "value": { "type": "Time", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Time", "annotation": [], "signature": [], "hour": { diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index 642e4f220..51c64424b 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -1,4 +1,9 @@ # Invalid CQL (does not translate) +CqlTypesTest.Time.TimeUpperBoundHours Intentional Translator error: Invalid time input (T24:59:59.999). Use ISO 8601 time representation (hh:mm:ss.fff) +CqlTypesTest.Time.TimeUpperBoundMinutes Translator error: Invalid time input[...] +CqlTypesTest.Time.TimeUpperBoundSeconds Translator error: Invalid time input[...] +"CqlDateTimeOperatorsTest.Uncertainty tests.TimeDurationBetweenHourDiffPrecision" Translator error: Syntax error at Z +CqlDateTimeOperatorsTest.DateTimeComponentFrom.DateTimeComponentFromTimezoneOffset Translator error: Timezone keyword is only valid in 1.3 or lower # Invalid Translation (translates, but translates wrong) CqlAggregateTest.AggregateTests.RolledOutIntervals CQL adds an integer to a date ("S + duration in days of X"). Should be "S + Quantity{ value: duration in days of X, unit: 'days' }". Translator translates it, but probably shouldn't. @@ -11,14 +16,25 @@ CqlIntervalOperatorsTest.ProperIn.TimeProperInPrecisionFalse Wrong output: Ac CqlIntervalOperatorsTest.ProperIn.TimeProperInFalse Wrong output: According to spec, a contained point is properly in as long as the interval is not a unit interval CqlIntervalOperatorsTest.Expand.ExpandPer0D1 Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 CqlIntervalOperatorsTest.Expand.ExpandPer0D1IntervalOverload Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 +CqlIntervalOperatorsTest.Except.DecimalIntervalExcept1to3 # Wrong output: Interval Except should be precision-aware (based on interval Start/End). +CqlIntervalOperatorsTest.Except.QuantityIntervalExcept1to4 # Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale + 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 CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: Interval[null, null] is not a unit interval, nor is it null -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See test Divide1Q1Q which is correct +"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See https://github.com/cqframework/cql-tests/pull/148 "CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10By5DQuantity" Wrong output: The resulting Quantity should have an appropriate unit "CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide414By206DQuantity" Wrong output: The resulting Quantity should have an appropriate unit "CqlStringOperatorsTest.toString tests.QuantityToString" Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1D Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147 +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf101D Wrong output: As of 2.0 Successor of Decimal should be precision-aware +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCM Wrong output: As of 2.0 Successor of Decimal should be precision-aware +CqlArithmeticFunctionsTest.Successor.SuccessorOf1D Wrong output: As of 2.0 Successor of Decimal should be precision-aware +CqlArithmeticFunctionsTest.Successor.SuccessorOf101D Wrong output: As of 2.0 Successor of Decimal should be precision-aware +CqlComparisonOperatorsTest.Equal.TupleEqDifferentNamesWithOneNullId Wrong output: Tuple equality with a known-unequal element should return false +"CqlComparisonOperatorsTest.Not Equal.TupleNotEqDifferingNamesWithOneNullId" Wrong output: Tuple inequality with a known-unequal element should return true +CqlStringOperatorsTest.Substring.SubstringEmptyAnd0 Wrong output: Substring(x, x.length) should be null'. Note similar test SubstringAB2. See https://github.com/cqframework/cql-tests/issues/149 # Potentially Incorrect Expected Output "CqlStringOperatorsTest.toString tests.DateTimeToString2" Answer does not include timezone offset, but default offset depends on test environment @@ -27,8 +43,20 @@ CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: In # Incorrect answer CqlComparisonOperatorsTest.Equal.DateTimeEqNull Wrong answer (true vs null - due to not evaluating DateTime(null) as null) +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityMonthEqualMo" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityMonthNotEqualMo" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityMonthEquivalentMo" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityMonthsNotEqualMo" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityMonthsEquivalentMo" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityYearEqualA" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityYearNotEqualA" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityYearEquivalentA" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityYearsNotEqualA" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestQuantityYearsEquivalentA" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestYearEquivalentDays" Wrong answer: Quantity =/~ should have special semantics for calendar-based units +"CqlComparisonOperatorsTest.Unit Comparison.TestMonthEquivalentDays" Wrong answer: Quantity =/~ should have special semantics for calendar-based units + CqlIntervalOperatorsTest.Collapse.TestCollapseNull Wrong answer (Interval(null, null) vs null) -CqlIntervalOperatorsTest.Except.NullInterval Wrong answer (Interval(null, null) vs null) CqlIntervalOperatorsTest.Expand.ExpandListWithNull Wrong answer (should be empty list due to removing nulls) CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong answer (Interval[5, 10] vs Interval[5, null)) CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (different offsets) @@ -38,6 +66,13 @@ CqlTypeOperatorsTest.ToDateTime.ToDateTime3 Wrong answer (di ValueLiteralsAndSelectors.Decimal.Decimal10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number); intermediate value exceeds max Decimal ValueLiteralsAndSelectors.Decimal.DecimalPos10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number); intermediate value exceeds max Decimal +"CqlDateTimeOperatorsTest.Uncertainty tests.DateTimeDurationBetweenUncertainInterval" Wrong answer: [17, 44] vs [16, 44] +"CqlDateTimeOperatorsTest.Uncertainty tests.TimeDurationBetweenHourDiffPrecision2" Wrong answer: 1 vs uncertainty [0, 1] +CqlDateTimeOperatorsTest.Subtract.DateTimeSubtract1YearInSeconds Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05 +CqlTypesTest.DateTime.DateTimeNull Wrong answer: null vs DateTime with null components +CqlTypesTest.Time.TimeMillisParsing Wrong answer: @T23:59:59.100 vs @T23:59:59.10000 + + # Unimplemented CqlArithmeticFunctionsTest.HighBoundary HighBoundary not implemented CqlArithmeticFunctionsTest.LowBoundary LowBoundary not implemented diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index b68768ded..32f774aef 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -69,6 +69,13 @@ describe('CQL Spec Tests (from XML)', () => { if (!actual.equals(expected)) { should.fail(actual, expected, 'Intervals are not equal'); } + } else if (actual && actual.isDateTime && expected && expected.isDateTime) { + // DateTime equality includes its Decimal timezoneOffset. + // Use equals instead of eql (deep nested object equality) + // to apply CQL rules about Decimal equality + if (!actual.equals(expected)) { + should.fail(actual, expected, 'DateTimes are not equal'); + } } else if ( actual && actual.isUncertainty && diff --git a/test/spec-tests/xml/CqlAggregateFunctionsTest.xml b/test/spec-tests/xml/CqlAggregateFunctionsTest.xml index 9a7d40b31..b6369f9b3 100644 --- a/test/spec-tests/xml/CqlAggregateFunctionsTest.xml +++ b/test/spec-tests/xml/CqlAggregateFunctionsTest.xml @@ -1,232 +1,311 @@ + + + AllTrue({true,true}) true + AllTrue({true,false}) false + AllTrue({false,true}) false + AllTrue({true,false,true}) false + AllTrue({false,true,false}) false + AllTrue({null,true,true}) true + AllTrue({}) true + AllTrue(null) true + + AnyTrue({true,true}) true + AnyTrue({false,false}) false + AnyTrue({true,false,true}) true + AnyTrue({false,true,false}) true + AnyTrue({true,false}) true + AnyTrue({false,true}) true + AnyTrue({null,true}) true + AnyTrue({null,false}) false + AnyTrue({}) false + AnyTrue(null) false + + Avg({ 1.0, 2.0, 3.0, 6.0 }) 3.0 + + + Product({5L, 4L, 5L}) 100L + + Count({ 15, 5, 99, null, 1 }) 4 + + Count({ DateTime(2014), DateTime(2001), DateTime(2010) }) 3 + + Count({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 }) 3 + Count({}) 0 + + Max({ 5, 12, 1, 15, 0, 4, 90, 44 }) 90 + + Max({ 5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L }) 90L + Max({ 'hi', 'bye', 'zebra' }) 'zebra' + + Max({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) }) @2012-10-06T + + Max({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 }) @T20:59:59.999 + + Median({6.0, 5.0, 4.0, 3.0, 2.0, 1.0}) 3.5 + + Min({5, 12, 1, 15, 0, 4, 90, 44}) 0 + + Min({5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L}) 0L + Min({'hi', 'bye', 'zebra'}) 'bye' + + Min({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) }) @2012-09-05T + + Min({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 }) @T05:59:59.999 + + Mode({ 2, 1, 8, 2, 9, 1, 9, 9 }) 9 + + Mode({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) }) @2012-09-05T + + Mode({ DateTime(2012, 10, 5), DateTime(2012, 10, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) }) @2012-10-05T + + Mode({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999, @T05:59:59.999 }) @T05:59:59.999 + + PopulationStdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 }) 1.41421356 + PopulationStdDev({ null as Quantity, null as Quantity, null as Quantity }) null + + PopulationVariance({ 1.0, 2.0, 3.0, 4.0, 5.0 }) 2.0 + PopulationVariance({ null as Quantity, null as Quantity, null as Quantity }) null + + StdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 }) 1.58113883 + StdDev({ null as Quantity, null as Quantity, null as Quantity }) null + + Sum({ 6.0, 2.0, 3.0, 4.0, 5.0 }) 20.0 + + Sum({ 6L, 2L, 3L, 4L, 5L }) 20L + + Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) 15 'ml' + Sum({ null, 1, null }) 1 + + Variance({ 1.0, 2.0, 3.0, 4.0, 5.0 }) 2.5 diff --git a/test/spec-tests/xml/CqlAggregateTest.xml b/test/spec-tests/xml/CqlAggregateTest.xml index 98d8d232a..749bbb811 100644 --- a/test/spec-tests/xml/CqlAggregateTest.xml +++ b/test/spec-tests/xml/CqlAggregateTest.xml @@ -1,12 +1,18 @@ + + + + ({ 1, 2, 3, 4, 5 }) Num aggregate Result starting 1: Result * Num 120 + + ({ Interval[@2012-01-01, @2012-02-28], @@ -16,7 +22,7 @@ aggregate R starting (null as List<Interval<DateTime>>): R union ({ M X let S: Max({ end of Last(R) + 1 day, start of X }), - E: S + duration in days of X + E: S + Quantity{ value: duration in days of X, unit: 'days' } return Interval[S, E] }) @@ -27,9 +33,10 @@ Interval[@2012-04-29, @2012-06-28] } - + + ({ 1, 2, 3, 4, 5 }) Num aggregate Result starting 1: Result + Num @@ -38,6 +45,8 @@ + + ({ 1, 2, 3, 4, 5 }) Num aggregate Result: Coalesce(Result, 0) + Num @@ -46,6 +55,8 @@ + + ({ 1, 1, 2, 2, 2, 3, 4, 4, 5 }) Num aggregate all Result: Coalesce(Result, 0) + Num @@ -54,6 +65,8 @@ + + ({ 1, 1, 2, 2, 2, 3, 4, 4, 5 }) Num aggregate distinct Result: Coalesce(Result, 0) + Num @@ -62,6 +75,8 @@ + + from ({1}) X, ({2}) Y, ({3}) Z aggregate Agg: Coalesce(Agg, 0) + X + Y + Z @@ -69,6 +84,8 @@ 6 + + from ({1, 2}) X, ({1, 2}) Y, ({1, 2}) Z aggregate Agg starting 0: Agg + X + Y + Z @@ -77,6 +94,8 @@ + + from ({1, 2, 2, 1}) X, ({1, 2, 1, 2}) Y, ({2, 1, 2, 1}) Z aggregate distinct Agg starting 1: Agg + X + Y + Z diff --git a/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml b/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml index 3e580c82e..72e3d73c0 100644 --- a/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml +++ b/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml @@ -1,7 +1,10 @@ + + + Abs(null as Integer) null @@ -23,15 +26,18 @@ 0.0 + Abs(-1.0'cm') 1.0'cm' - + + Abs(-1L) 1L + 1 + null null @@ -40,7 +46,8 @@ 1 + 1 2 - + + 1L + 2L 3L @@ -49,6 +56,7 @@ 2.0 + 1'g/cm3' + 1'g/cm3' 2.0'g/cm3' @@ -56,12 +64,14 @@ 1 + 2.0 3.0 - + + 1L + 1L 2L + Ceiling(null as Decimal) null @@ -90,8 +100,49 @@ Ceiling(1) 1 + + Ceiling(2147483647) + 2147483647 + + + Ceiling(2147483647.0) + 2147483647 + + + Ceiling(2147483647.2) + null + + + Ceiling(2147483648) + null + + + Ceiling(2147483648.2) + null + + + Ceiling(-2147483648) + -2147483648 + + + Ceiling(-2147483648.0) + -2147483648 + + + Ceiling(-2147483648.2) + -2147483648 + + + Ceiling(-2147483649) + null + + + Ceiling(-2147483649.2) + null + + 1 / null null @@ -108,7 +159,8 @@ 1 / 1 1.0 - + + 1L / 1L 1.0 @@ -117,10 +169,12 @@ 1.0 + Round(10 / 3, 8) 3.33333333 + 1'g/cm3' / 1.0 1.0'g/cm3' @@ -128,6 +182,7 @@ Decimal value to a Quantity, with the default UCUM unit of (`1`). --> + 1'g/cm3' / 1'g/cm3' 1.0'1' + minimum Long -9223372036854775808L @@ -344,14 +474,17 @@ + minimum DateTime @0001-01-01T00:00:00.000Z + minimum Date @0001-01-01 + minimum Time @T00:00:00.000 @@ -361,11 +494,13 @@ + maximum Integer 2147483647 + maximum Long 9223372036854775807L @@ -375,14 +510,17 @@ + maximum DateTime @9999-12-31T23:59:59.999Z + maximum Date @9999-12-31 + maximum Time @T23:59:59.999 @@ -392,6 +530,7 @@ + 1 mod null null @@ -405,6 +544,7 @@ 0 + 4L mod 2L 0L @@ -429,19 +569,26 @@ 0.5 + + 3.5 'cm' mod 3 'cm' 0.5 'cm' + + 10.0 'g' mod 3.0 'g' 1.0 'g' + + 10.0 'g' mod 0.0 'g' null + 1 * null null @@ -450,7 +597,8 @@ 1 * 1 1 - + + 2L * 3L 6L @@ -458,7 +606,8 @@ 1.0 * 2.0 2.0 - + + 1 * 1L 1L @@ -467,12 +616,14 @@ 2.0 + 1.0 'cm' * 2.0 'cm' 2.0'cm2' + -(null as Integer) null @@ -489,11 +640,13 @@ -1 -1 - + + -1L -1L - + + -9223372036854775807L -9223372036854775807L @@ -501,7 +654,8 @@ -(-1) 1 - + + -(-1L) 1L @@ -522,11 +676,14 @@ 1.0 + -(1'cm') -1.0'cm' + + Precision(1.58700) 5 @@ -549,6 +706,8 @@ + + predecessor of (null as Integer) null @@ -561,7 +720,8 @@ predecessor of 1 0 - + + predecessor of 1L 0L @@ -574,6 +734,7 @@ 1.00999999 + predecessor of 1.0 'cm' 0.99999999'cm' @@ -595,6 +756,7 @@ + Power(null as Integer, null as Integer) null @@ -615,7 +777,8 @@ Power(2, -2) 0.25 - + + Power(2L, 2L) 4L @@ -643,7 +806,8 @@ 2^4 16 - + + 2L^3L 8L @@ -657,6 +821,7 @@ + Round(null as Decimal) null @@ -679,7 +844,7 @@ Round(-0.5) - 0.0 + -1.0 Round(-0.4) @@ -695,7 +860,7 @@ Round(-1.5) - -1.0 + -2.0 Round(-1.6) @@ -703,6 +868,7 @@ + 1 - null null @@ -711,7 +877,8 @@ 1 - 1 0 - + + 1L - 1L 0L @@ -720,6 +887,7 @@ -1.0 + 1.0 'cm' - 2.0 'cm' -1.0'cm' @@ -729,6 +897,8 @@ + + successor of (null as Integer) null @@ -741,7 +911,8 @@ successor of 1 2 - + + successor of 1L 2L @@ -771,6 +942,7 @@ + Truncate(null as Decimal) null @@ -821,6 +993,7 @@ + (null as Integer) div (null as Integer) null @@ -837,11 +1010,13 @@ 10 div 3 3 - + + 10L div 3L 3L - + + 10L div 0L null @@ -894,18 +1069,22 @@ 2.0 + 10.1 'cm' div -3.1 'cm' -3.0 'cm' + 10.0 'g' div 5.0 'g' 2.0 'g' + 4.14 'm' div 2.06 'm' 2.0 'm' + 10.0 'g' div 0.0 'g' null diff --git a/test/spec-tests/xml/CqlComparisonOperatorsTest.xml b/test/spec-tests/xml/CqlComparisonOperatorsTest.xml index 67eb1cee3..33aa9d7c4 100644 --- a/test/spec-tests/xml/CqlComparisonOperatorsTest.xml +++ b/test/spec-tests/xml/CqlComparisonOperatorsTest.xml @@ -1,13 +1,16 @@ + + 4 between 2 and 6 true + true = true true @@ -44,6 +47,11 @@ 1 = 2 false + + + 1L = 2L + false + 'a' = 'a' true @@ -60,6 +68,14 @@ 1.0 = 2.0 false + + 1.0 = 1.00 + true + + + 1.50 = 1.55 + false + 1.0 = 1 true @@ -73,6 +89,7 @@ true + 1'cm' = 0.01'm' true @@ -80,51 +97,80 @@ 2.0'cm' = 2.00'cm' true + + 1'cm':2'cm' = 1'cm':2'cm' + true + + + 1'cm':2'cm' = 1.1'cm':2'cm' + false + + + 1'cm':2'cm' = 1'cm':2.1'cm' + false + + Tuple { Id : 1, Name : 'John' } = Tuple { Id : 1, Name : 'John' } true + Tuple { Id : 1, Name : 'John' } = Tuple { Id : 2, Name : 'Jane' } false + Tuple { Id : 1, Name : 'John' } = Tuple { Id : 2, Name : 'John' } false + Tuple { Id : 1, Name : 'John' } = Tuple { Id : 2, Name : null } false + Tuple { Id : null, Name : 'John' } = Tuple { Id : 1, Name : 'James' } - false + null + Tuple { Id : 1, Name : null } = Tuple { Id : 1, Name : null } true + Tuple { Id : null, Name : 'John' } = Tuple { Id : null, Name : 'John' } true + Tuple { Id : 1, Name : 'John' } = Tuple { Id : 1, Name : null } null + Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 0, 0, 0, 0) } = Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 0, 0, 0, 0) } true + Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 0, 0, 0, 0) } = Tuple { dateId: 1, Date: DateTime(2012, 10, 5, 5, 0, 0, 0) } false + + + Tuple { dateId: 12, Date: DateTime(2012, 1, 1) } = Tuple { dateId: 12, Date: DateTime(2012, 1, 1) } + true + + Tuple { timeId: 55, TheTime: @T05:15:15.541 } = Tuple { timeId: 55, TheTime: @T05:15:15.541 } true + Tuple { timeId: 55, TheTime: @T05:15:15.541 } = Tuple { timeId: 55, TheTime: @T05:15:15.540 } false @@ -144,10 +190,18 @@ DateTime(2014, 1, 5, 5, 0, 0, 0, 0) = DateTime(2014, 7, 5, 5, 0, 0, 0, 0) false + + DateTime(2015, 1, 5, 5, 0, 0) = DateTime(2015, 1, 5, 5, 0, 0) + true + DateTime(null) = DateTime(null) null + + DateTime(2001, 1, 1, null) = DateTime(2001, 1, 1, null, null) + true + @2014-01-25T14:30:14.559+01:00 = @2014-01-25T14:30:14.559+01:00 true @@ -166,6 +220,7 @@ + 0 > 0 false @@ -174,6 +229,11 @@ 0 > 1 false + + + 0L > 10L + false + 0 > -1 true @@ -207,10 +267,12 @@ true + 1'm' > 1'cm' true + 1'm' > 10'cm' true @@ -268,6 +330,7 @@ + 0 >= 0 true @@ -276,6 +339,11 @@ 0 >= 1 false + + + 0L >= 10L + false + 0 >= -1 true @@ -309,10 +377,12 @@ true + 1'm' >= 1'cm' true + 1'm' >= 10'cm' true @@ -378,6 +448,7 @@ + 0 < 0 false @@ -386,6 +457,16 @@ 0 < 1 true + + + 0L < 10L + true + + + + -30L < -20L + true + 0 < -1 false @@ -419,10 +500,12 @@ false + 1'm' < 1'cm' false + 1'm' < 10'cm' false @@ -480,6 +563,7 @@ + 0 <= 0 true @@ -488,6 +572,11 @@ 0 <= 1 true + + + 0L <= 10L + true + 0 <= -1 false @@ -521,10 +610,12 @@ false + 1'm' <= 1'cm' false + 1'm' <= 10'cm' false @@ -590,6 +681,7 @@ + true ~ true true @@ -634,6 +726,10 @@ 'a' ~ 'b' false + + 'Abel' ~ 'abel' + true + 1.0 ~ 1.0 true @@ -642,6 +738,22 @@ 1.0 ~ 2.0 false + + 1.0 ~ 1.00 + true + + + 1.5 ~ 1.55 + false + + + 1.50 ~ 1.55 + false + + + 1.001 ~ 1.000 + true + 1.0 ~ 1 true @@ -655,22 +767,49 @@ true + 1'cm' ~ 0.01'm' true + + 1'cm':2'cm' ~ 1'cm':2'cm' + true + + + 1'cm':2'cm' ~ 3'cm':2'cm' + false + + + 1'cm':2'cm' ~ 1'cm':3'cm' + false + + Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 1, Name : 'John' } true + Tuple { Id : 1, Name : 'John', Position: null } ~ Tuple { Id : 1, Name : 'John', Position: null } true + + + Tuple { Id : 1, Name : 'John', Position: 'Shift Manager' } ~ Tuple { Id : 1, Name : 'John' } + + + + + Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 1, Name : 'John', Position: 'Shift Manager' } + + + Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 2, Name : 'Jane' } false + Tuple { Id : 1, Name : 'John' } ~ Tuple { Id : 2, Name : 'John' } false @@ -692,6 +831,7 @@ + true != true false @@ -728,6 +868,11 @@ 1 != 2 true + + + 1L != 2L + true + 'a' != 'a' false @@ -757,38 +902,47 @@ false + 1'cm' != 0.01'm' false + Tuple{ Id : 1, Name : 'John' } != Tuple{ Id : 1, Name : 'John' } false + Tuple{ Id : 1, Name : 'John' } != Tuple{ Id : 2, Name : 'Jane' } true + Tuple{ Id : 1, Name : 'John' } != Tuple{ Id : 2, Name : 'John' } true + Tuple{ Id : 1, Name : 'John' } != Tuple{ Id : 2, Name : null } true + Tuple{ Id : null, Name : 'John' } != Tuple{ Id : 1, Name : 'Joe' } - true + null + Tuple{ Id : 1, Name : null } != Tuple{ Id : 1, Name : null } false + Tuple{ Id : null, Name : 'John' } != Tuple{ Id : null, Name : 'John' } false + Tuple{ Id : 1, Name : 'John' } != Tuple{ Id : 1, Name : null } null @@ -809,4 +963,164 @@ true + + + 1 millisecond = 1 'ms' + true + + + 1 millisecond = 1 milliseconds + true + + + 1 milliseconds = 1 'ms' + true + + + 1 second = 1 's' + true + + + 1 second = 1 seconds + true + + + 1 seconds = 1 's' + true + + + 1 minute = 1 'min' + true + + + 1 minute = 1 minutes + true + + + 1 minutes = 1 'min' + true + + + 1 hour = 1 'h' + true + + + 1 hour = 1 hours + true + + + 1 hours = 1 'h' + true + + + 1 day = 1 'd' + true + + + 1 day = 1 days + true + + + 1 days = 1 'd' + true + + + 1 week = 1 'wk' + true + + + 1 week = 1 weeks + true + + + 1 weeks = 1 'wk' + true + + + 1 month = 1 'mo' + null + + + + 1 month != 1 'mo' + null + + + + 1 month ~ 1 'mo' + true + + + 1 month = 1 months + true + + + 1 months != 1 'mo' + null + + + + 1 months ~ 1 'mo' + true + + + 1 year = 1 'a' + null + + + + 1 year != 1 'a' + null + + + + 1 year ~ 1 'a' + true + + + 1 years = 1 year + true + + + 1 years != 1 'a' + null + + + + 1 years ~ 1 'a' + true + + + 1 year ~ 12 months + true + + + 1 year ~ 365 days + true + + + 1 month ~ 30 days + true + + + 1 week = 7 days + true + + + 1 day = 24 hours + true + + + 1 hour = 60 minutes + true + + + 1 minute = 60 seconds + true + + + 1 second = 1000 milliseconds + true + + diff --git a/test/spec-tests/xml/CqlConditionalOperatorsTest.xml b/test/spec-tests/xml/CqlConditionalOperatorsTest.xml index ab3203be0..95416287b 100644 --- a/test/spec-tests/xml/CqlConditionalOperatorsTest.xml +++ b/test/spec-tests/xml/CqlConditionalOperatorsTest.xml @@ -1,22 +1,43 @@ + + + + + + + + + if 10 > 5 then 5 else 10 5 + + + if 10 = 5 then 10 + 5 else 10 - 5 5 + + + if 10 = null then 5 else 10 10 + + + + + + case when 10 > 5 then 5 @@ -27,6 +48,9 @@ 5 + + + case when 5 > 10 then 5 + 10 @@ -37,6 +61,9 @@ 5 + + + case when null ~ 10 then null + 10 @@ -48,7 +75,13 @@ + + + + + + case 5 when 5 then 12 @@ -59,6 +92,9 @@ 12 + + + case 10 when 5 then 12 @@ -69,6 +105,9 @@ 15 + + + case 10 + 5 when 5 then 12 diff --git a/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml b/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml index e2008411f..193a3903e 100644 --- a/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml +++ b/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml @@ -1,24 +1,47 @@ + + + + + + + + + + + + + + + + + + + DateTime(2005, 10, 10) + 5 years @2010-10-10T + DateTime(2005, 10, 10) + 8000 years + DateTime(2005, 5, 10) + 5 months @2005-10-10T + DateTime(2005, 5, 10) + 10 months @2006-03-10T + DateTime(2018, 5, 2) + 3 weeks = DateTime(2018, 5, 23) true @@ -26,6 +49,7 @@ + DateTime(2018, 5, 23) + 52 weeks = DateTime(2019, 5, 22) true @@ -33,6 +57,7 @@ + DateTime(2023, 3, 2) + 52 weeks = DateTime(2024, 2, 29) true @@ -40,6 +65,7 @@ + DateTime(2024, 2, 28) + 52 weeks = DateTime(2025, 2, 26) true @@ -47,563 +73,742 @@ + DateTime(2005, 5, 10) + 5 days @2005-05-15T + DateTime(2016, 6, 10) + 21 days @2016-07-01T + DateTime(2005, 5, 10, 5) + 5 hours @2005-05-10T10 + DateTime(2005, 5, 10, 5, 20, 30) + 5 hours @2005-05-10T10:20:30 + DateTime(2005, 5, 10) + 5 hours = DateTime(2005, 5, 10) true + DateTime(2005, 5, 10) + 25 hours = DateTime(2005, 5, 11) true + Date(2014) + 24 months @2016 + Date(2014) + 25 months @2016 + Date(2014,6) + 33 days @2014-07 + Date(2014,6) + 1 year @2015-06 + DateTime(2016, 6, 10, 5) + 19 hours @2016-06-11T00 + DateTime(2005, 5, 10, 5, 5) + 5 minutes @2005-05-10T05:10 + DateTime(2016, 6, 10, 5, 5) + 55 minutes @2016-06-10T06:00 + DateTime(2005, 5, 10, 5, 5, 5) + 5 seconds @2005-05-10T05:05:10 + DateTime(2016, 6, 10, 5, 5, 5) + 55 seconds @2016-06-10T05:06:00 + DateTime(2005, 5, 10, 5, 5, 5, 5) + 5 milliseconds @2005-05-10T05:05:05.010 + DateTime(2016, 6, 10, 5, 5, 5, 5) + 995 milliseconds @2016-06-10T05:05:06.000 + DateTime(2012, 2, 29) + 1 year @2013-02-28T + DateTime(2014) + 24 months @2016T + DateTime(2014) + 730 days @2016T + DateTime(2014) + 735 days @2016T + @T15:59:59.999 + 5 hours @T20:59:59.999 + @T15:59:59.999 + 1 minute @T16:00:59.999 + @T15:59:59.999 + 1 seconds @T16:00:00.999 + @T15:59:59.999 + 1 milliseconds @T16:00:00.000 + @T15:59:59.999 + 5 hours + 1 minutes @T21:00:59.999 - @T15:59:59.999 + 300 minutes + + @T15:59:59.999 + 300 minutes @T20:59:59.999 + + DateTime(2005, 10, 10) after year of DateTime(2004, 10, 10) true + DateTime(2004, 11, 10) after year of DateTime(2004, 10, 10) false + DateTime(2004, 12, 10) after month of DateTime(2004, 11, 10) true + DateTime(2004, 9, 10) after month of DateTime(2004, 10, 10) false + DateTime(2004, 12, 11) after day of DateTime(2004, 10, 10) true + DateTime(2004, 12, 09) after day of DateTime(2003, 10, 10) true + DateTime(2004, 10, 9) after day of DateTime(2004, 10, 10) false + DateTime(2004, 10, 10, 10) after hour of DateTime(2004, 10, 10, 5) true + DateTime(2004, 10, 10, 20) after hour of DateTime(2004, 10, 10, 21) false + DateTime(2004, 10, 10, 20, 30) after minute of DateTime(2004, 10, 10, 20, 29) true + DateTime(2004, 10, 10, 20, 30) after minute of DateTime(2004, 10, 10, 20, 31) false + DateTime(2004, 10, 10, 20, 30, 15) after second of DateTime(2004, 10, 10, 20, 30, 14) true + DateTime(2004, 10, 10, 20, 30, 15) after second of DateTime(2004, 10, 10, 20, 30, 16) false + DateTime(2004, 10, 10, 20, 30, 15, 512) after millisecond of DateTime(2004, 10, 10, 20, 30, 15, 510) true + DateTime(2004, 10, 10, 20, 30, 15, 512) after millisecond of DateTime(2004, 10, 10, 20, 30, 15, 513) false + DateTime(2005, 10, 10) after day of DateTime(2005, 9) true + @2012-03-10T10:20:00.999+07:00 after hour of @2012-03-10T08:20:00.999+06:00 true + @2012-03-10T10:20:00.999+07:00 after hour of @2012-03-10T10:20:00.999+06:00 false + @T15:59:59.999 after hour of @T14:59:59.999 true + @T15:59:59.999 after hour of @T16:59:59.999 false + @T15:59:59.999 after minute of @T15:58:59.999 true + @T15:58:59.999 after minute of @T15:59:59.999 false + @T15:59:59.999 after second of @T15:59:58.999 true + @T15:59:58.999 after second of @T15:59:59.999 false + @T15:59:59.999 after millisecond of @T15:59:59.998 true + @T15:59:59.998 after millisecond of @T15:59:59.999 false + Time(12, 30) after hour of Time(11, 55) true + + DateTime(2003) before year of DateTime(2004, 10, 10) true + DateTime(2004, 11, 10) before year of DateTime(2003, 10, 10) false + DateTime(2004, 10, 10) before month of DateTime(2004, 11, 10) true + DateTime(2004, 11, 10) before month of DateTime(2004, 10, 10) false + DateTime(2004, 10, 1) before day of DateTime(2004, 10, 10) true + DateTime(2003, 10, 11) before day of DateTime(2004, 10, 10) true + DateTime(2004, 10, 11) before day of DateTime(2004, 10, 10) false + DateTime(2004, 10, 10, 1) before hour of DateTime(2004, 10, 10, 5) true + DateTime(2004, 10, 10, 23) before hour of DateTime(2004, 10, 10, 21) false + DateTime(2004, 10, 10, 20, 28) before minute of DateTime(2004, 10, 10, 20, 29) true + DateTime(2004, 10, 10, 20, 35) before minute of DateTime(2004, 10, 10, 20, 31) false + DateTime(2004, 10, 10, 20, 30, 12) before second of DateTime(2004, 10, 10, 20, 30, 14) true + DateTime(2004, 10, 10, 20, 30, 55) before second of DateTime(2004, 10, 10, 20, 30, 16) false + DateTime(2004, 10, 10, 20, 30, 15, 508) before millisecond of DateTime(2004, 10, 10, 20, 30, 15, 510) true + DateTime(2004, 10, 10, 20, 30, 15, 599) before millisecond of DateTime(2004, 10, 10, 20, 30, 15, 513) false + @2012-03-10T10:20:00.999+07:00 before hour of @2012-03-10T10:20:00.999+06:00 true + @2012-03-10T10:20:00.999+07:00 before hour of @2012-03-10T09:20:00.999+06:00 false + @T13:59:59.999 before hour of @T14:59:59.999 true + @T16:59:59.999 before hour of @T15:59:59.999 false + @T15:57:59.999 before minute of @T15:58:59.999 true + @T15:59:59.999 before minute of @T15:59:59.999 false + @T15:59:57.999 before second of @T15:59:58.999 true + @T15:59:56.999 before second of @T15:59:55.999 false + @T15:59:59.997 before millisecond of @T15:59:59.998 true + @T15:59:59.998 before millisecond of @T15:59:59.997 false + + DateTime(2003) @2003T + DateTime(2003, 10) @2003-10T + DateTime(2003, 10, 29) @2003-10-29T + DateTime(2003, 10, 29, 20) @2003-10-29T20 + DateTime(2003, 10, 29, 20, 50) @2003-10-29T20:50 + DateTime(2003, 10, 29, 20, 50, 33) @2003-10-29T20:50:33 + DateTime(2003, 10, 29, 20, 50, 33, 955) @2003-10-29T20:50:33.955 + + + + year from DateTime(2003, 10, 29, 20, 50, 33, 955) 2003 + + month from DateTime(2003, 10, 29, 20, 50, 33, 955) 10 + + month from DateTime(2003, 01, 29, 20, 50, 33, 955) 1 + + day from DateTime(2003, 10, 29, 20, 50, 33, 955) 29 + + hour from DateTime(2003, 10, 29, 20, 50, 33, 955) 20 + + minute from DateTime(2003, 10, 29, 20, 50, 33, 955) 50 + + second from DateTime(2003, 10, 29, 20, 50, 33, 955) 33 + + millisecond from DateTime(2003, 10, 29, 20, 50, 33, 955) 955 - timezone from DateTime(2003, 10, 29, 20, 50, 33, 955, 1) - - - + + timezoneoffset from DateTime(2003, 10, 29, 20, 50, 33, 955, 1) 1.00 + + + + timezone from DateTime(2003, 10, 29, 20, 50, 33, 955, 1) + 1.00 + + + + date from DateTime(2003, 10, 29, 20, 50, 33, 955, 1) @2003-10-29 + + hour from @T23:20:15.555 23 + + minute from @T23:20:15.555 20 + + second from @T23:20:15.555 15 + + millisecond from @T23:20:15.555 555 + + difference in years between DateTime(2000) and DateTime(2005, 12) 5 + difference in months between DateTime(2000, 2) and DateTime(2000, 10) 8 + difference in days between DateTime(2000, 10, 15, 10, 30) and DateTime(2000, 10, 25, 10, 0) 10 + difference in hours between DateTime(2000, 4, 1, 12) and DateTime(2000, 4, 1, 20) 8 + difference in minutes between DateTime(2005, 12, 10, 5, 16) and DateTime(2005, 12, 10, 5, 25) 9 + difference in seconds between DateTime(2000, 10, 10, 10, 5, 45) and DateTime(2000, 10, 10, 10, 5, 50) 5 + difference in milliseconds between DateTime(2000, 10, 10, 10, 5, 45, 500, -6.0) and DateTime(2000, 10, 10, 10, 5, 45, 900, -7.0) 3600400 + difference in weeks between DateTime(2000, 10, 15) and DateTime(2000, 10, 28) 1 + difference in weeks between DateTime(2000, 10, 15) and DateTime(2000, 10, 29) 2 + difference in weeks between @2012-03-10T22:05:09 and @2012-03-24T07:19:33 2 + difference in years between DateTime(2016) and DateTime(1998) -18 + difference in months between DateTime(2005) and DateTime(2006, 7) > 5 true + difference in hours between @T20 and @T23:25:15.555 3 + difference in minutes between @T20:20:15.555 and @T20:25:15.555 5 + difference in seconds between @T20:20:15.555 and @T20:20:20.555 5 + difference in milliseconds between @T20:20:15.555 and @T20:20:15.550 -5 + + + + @2017-03-12T01:00:00-07:00 @2017-03-12T01:00:00-07:00 + + DateTime(2017, 3, 12, 1, 0, 0, 0, -7.0) @2017-03-12T01:00:00.000-07:00 + + @2017-03-12T03:00:00-06:00 @2017-03-12T03:00:00-06:00 + + DateTime(2017, 3, 12, 3, 0, 0, 0, -6.0) @2017-03-12T03:00:00.000-06:00 + + @2017-11-05T01:30:00-06:00 @2017-11-05T01:30:00-06:00 + + DateTime(2017, 11, 5, 1, 30, 0, 0, -6.0) @2017-11-05T01:30:00.000-06:00 + + @2017-11-05T01:15:00-07:00 @2017-11-05T01:15:00-07:00 + + DateTime(2017, 11, 5, 1, 15, 0, 0, -7.0) @2017-11-05T01:15:00.000-07:00 + + @2017-03-12T00:00:00-07:00 @2017-03-12T00:00:00-07:00 + + DateTime(2017, 3, 12, 0, 0, 0, 0, -7.0) @2017-03-12T00:00:00.000-07:00 + + @2017-03-13T00:00:00-06:00 @2017-03-13T00:00:00-06:00 + + DateTime(2017, 3, 13, 0, 0, 0, 0, -6.0) @2017-03-13T00:00:00.000-06:00 + + difference in hours between @2017-03-12T01:00:00-07:00 and @2017-03-12T03:00:00-06:00 1 + + difference in minutes between @2017-11-05T01:30:00-06:00 and @2017-11-05T01:15:00-07:00 45 + + difference in days between @2017-03-12T00:00:00-07:00 and @2017-03-13T00:00:00-06:00 1 + + difference in hours between DateTime(2017, 3, 12, 1, 0, 0, 0, -7.0) and DateTime(2017, 3, 12, 3, 0, 0, 0, -6.0) 1 + + difference in minutes between DateTime(2017, 11, 5, 1, 30, 0, 0, -6.0) and DateTime(2017, 11, 5, 1, 15, 0, 0, -7.0) 45 + + difference in days between DateTime(2017, 3, 12, 0, 0, 0, 0, -7.0) and DateTime(2017, 3, 13, 0, 0, 0, 0, -6.0) 1 + + years between DateTime(2005) and DateTime(2010) Interval[ 4, 5 ] + years between DateTime(2005, 5) and DateTime(2010, 4) 4 + months between @2014-01-31 and @2014-02-01 0 + days between DateTime(2010, 10, 12, 12, 5) and DateTime(2008, 8, 15, 8, 8) -788 + + + + days between DateTime(2014, 1, 15) and DateTime(2014, 2) - Interval[ 16, 44 ] + Interval[ 17, 44 ] + + months between DateTime(2005) and DateTime(2006, 5) Interval[ 4, 16 ] + + (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) + (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) Interval[ 32, 88 ] @@ -651,6 +867,8 @@ currently Equivalent() results in null from comparing with an Interval. --> + + (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) - (months between DateTime(2005) and DateTime(2006, 5)) Interval[ 0, 40 ] @@ -660,6 +878,8 @@ currently Equivalent() results in null from comparing with an Interval. --> + + (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) * (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) Interval[ 256, 1936 ] @@ -669,541 +889,704 @@ currently Equivalent() results in null from comparing with an Interval. --> + + (days between DateTime(2014, 1, 15) and DateTime(2014, 2)) div (months between DateTime(2005) and DateTime(2006, 5)) + + months between DateTime(2005) and DateTime(2006, 7) > 5 true + + months between DateTime(2005) and DateTime(2006, 2) > 5 null + + months between DateTime(2005) and DateTime(2006, 7) > 25 false + + months between DateTime(2005) and DateTime(2006, 7) < 24 true + + months between DateTime(2005) and DateTime(2006, 7) = 24 false + + months between DateTime(2005) and DateTime(2006, 7) >= 5 true + + months between DateTime(2005) and DateTime(2006, 7) <= 24 true + + @2012-03-10T10:20:00 @2012-03-10T10:20:00 + + @2013-03-10T09:20:00 @2013-03-10T09:20:00 + + years between (date from @2012-03-10T10:20:00) and (date from @2013-03-10T09:20:00) 1 + + weeks between @2012-03-10T22:05:09 and @2012-03-20T07:19:33 1 + + weeks between @2012-03-10T22:05:09 and @2012-03-24T07:19:33 1 + + weeks between @2012-03-10T06:05:09 and @2012-03-24T07:19:33 2 + + hours between @T20:26:15.555 and @T23:25:15.555 2 + + hours between @T06Z and @T07:00:00Z + + hours between @T06 and @T07:00:00 1 + + minutes between @T23:20:16.555 and @T23:25:15.555 4 + + seconds between @T23:25:10.556 and @T23:25:15.555 4 + + milliseconds between @T23:25:25.555 and @T23:25:25.560 5 + + hours between @2017-03-12T01:00:00-07:00 and @2017-03-12T03:00:00-06:00 1 + + minutes between @2017-11-05T01:30:00-06:00 and @2017-11-05T01:15:00-07:00 45 + + days between @2017-03-12T00:00:00-07:00 and @2017-03-13T00:00:00-06:00 0 + + hours between DateTime(2017, 3, 12, 1, 0, 0, 0, -7.0) and DateTime(2017, 3, 12, 3, 0, 0, 0, -6.0) 1 + + minutes between DateTime(2017, 11, 5, 1, 30, 0, 0, -6.0) and DateTime(2017, 11, 5, 1, 15, 0, 0, -7.0) 45 + + days between DateTime(2017, 3, 12, 0, 0, 0, 0, -7.0) and DateTime(2017, 3, 13, 0, 0, 0, 0, -6.0) 0 + + Now() = Now() true + + DateTime(2014) same year as DateTime(2014) true + DateTime(2013) same year as DateTime(2014) false + DateTime(2014, 12) same month as DateTime(2014, 12) true + DateTime(2014, 12) same month as DateTime(2014, 10) false + DateTime(2014, 12, 10) same day as DateTime(2014, 12, 10) true + DateTime(2014, 10, 10) same day as DateTime(2014, 10, 11) false + DateTime(2014, 12, 10, 20) same hour as DateTime(2014, 12, 10, 20) true + DateTime(2014, 10, 10, 20) same hour as DateTime(2014, 10, 10, 21) false + DateTime(2014, 12, 10, 20, 55) same minute as DateTime(2014, 12, 10, 20, 55) true + DateTime(2014, 10, 10, 20, 55) same minute as DateTime(2014, 10, 10, 21, 56) false + DateTime(2014, 12, 10, 20, 55, 45) same second as DateTime(2014, 12, 10, 20, 55, 45) true + DateTime(2014, 10, 10, 20, 55, 45) same second as DateTime(2014, 10, 10, 21, 55, 44) false + DateTime(2014, 12, 10, 20, 55, 45, 500) same millisecond as DateTime(2014, 12, 10, 20, 55, 45, 500) true + DateTime(2014, 10, 10, 20, 55, 45, 500) same millisecond as DateTime(2014, 10, 10, 21, 55, 45, 501) false + DateTime(2014, 10) same day as DateTime(2014, 10, 12) null + @2012-03-10T10:20:00.999+07:00 same hour as @2012-03-10T09:20:00.999+06:00 true + @2012-03-10T10:20:00.999+07:00 same hour as @2012-03-10T10:20:00.999+06:00 false + @T23:25:25.555 same hour as @T23:55:25.900 true + @T22:25:25.555 same hour as @T23:25:25.555 false + @T23:55:22.555 same minute as @T23:55:25.900 true + @T23:26:25.555 same minute as @T23:25:25.555 false + @T23:55:25.555 same second as @T23:55:25.900 true + @T23:25:35.555 same second as @T23:25:25.555 false + @T23:55:25.555 same millisecond as @T23:55:25.555 true + @T23:25:25.555 same millisecond as @T23:25:25.554 false + + DateTime(2014) same year or after DateTime(2014) true + DateTime(2016) same year or after DateTime(2014) true + DateTime(2013) same year or after DateTime(2014) false + DateTime(2014, 12) same month or after DateTime(2014, 12) true + DateTime(2014, 10) same month or after DateTime(2014, 9) true + DateTime(2014, 10) same month or after DateTime(2014, 11) false + DateTime(2014, 12, 20) same day or after DateTime(2014, 12, 20) true + DateTime(2014, 10, 25) same day or after DateTime(2014, 10, 20) true + DateTime(2014, 10, 20) same day or after DateTime(2014, 10, 25) false + DateTime(2014, 12, 20, 12) same hour or after DateTime(2014, 12, 20, 12) true + DateTime(2014, 10, 25, 12) same hour or after DateTime(2014, 10, 25, 10) true + DateTime(2014, 10, 25, 12) same hour or after DateTime(2014, 10, 25, 15) false + DateTime(2014, 12, 20, 12, 30) same minute or after DateTime(2014, 12, 20, 12, 30) true + DateTime(2014, 10, 25, 10, 30) same minute or after DateTime(2014, 10, 25, 10, 25) true + DateTime(2014, 10, 25, 15, 30) same minute or after DateTime(2014, 10, 25, 15, 45) false + DateTime(2014, 12, 20, 12, 30, 15) same second or after DateTime(2014, 12, 20, 12, 30, 15) true + DateTime(2014, 10, 25, 10, 25, 25) same second or after DateTime(2014, 10, 25, 10, 25, 20) true + DateTime(2014, 10, 25, 15, 45, 20) same second or after DateTime(2014, 10, 25, 15, 45, 21) false + DateTime(2014, 12, 20, 12, 30, 15, 250) same millisecond or after DateTime(2014, 12, 20, 12, 30, 15, 250) true + DateTime(2014, 10, 25, 10, 25, 20, 500) same millisecond or after DateTime(2014, 10, 25, 10, 25, 20, 499) true + DateTime(2014, 10, 25, 15, 45, 20, 500) same millisecond or after DateTime(2014, 10, 25, 15, 45, 20, 501) false + DateTime(2014, 12, 20) same day or after DateTime(2014, 12) null + @2012-03-10T10:20:00.999+07:00 same hour or after @2012-03-10T09:20:00.999+06:00 true + @2012-03-10T10:20:00.999+07:00 same hour or after @2012-03-10T10:20:00.999+06:00 false + @T23:25:25.555 same hour or after @T23:55:25.900 true + @T23:25:25.555 same hour or after @T22:55:25.900 true + @T22:25:25.555 same hour or after @T23:55:25.900 false + @T23:25:25.555 same minute or after @T23:25:25.900 true + @T23:25:25.555 same minute or after @T22:15:25.900 true + @T23:25:25.555 same minute or after @T23:55:25.900 false + @T23:25:25.555 same second or after @T23:25:25.900 true + @T23:25:35.555 same second or after @T22:25:25.900 true + @T23:55:25.555 same second or after @T23:55:35.900 false + @T23:25:25.555 same millisecond or after @T23:25:25.555 true + @T23:25:25.555 same millisecond or after @T22:25:25.550 true + @T23:55:25.555 same millisecond or after @T23:55:25.900 false + @2017-12-20T11:00:00.000 on or after @2017-12-20T11:00:00.000 true + @2017-12-21T02:00:00.0 same or after @2017-12-20T11:00:00.0 true + + DateTime(2014) same year or before DateTime(2014) true + DateTime(2013) same year or before DateTime(2014) true + DateTime(2015) same year or before DateTime(2014) false + DateTime(2014, 12) same month or before DateTime(2014, 12) true + DateTime(2014, 8) same month or before DateTime(2014, 9) true + DateTime(2014, 12) same month or before DateTime(2014, 11) false + DateTime(2014, 12, 20) same day or before DateTime(2014, 12, 20) true + DateTime(2014, 10, 15) same day or before DateTime(2014, 10, 20) true + DateTime(2014, 10, 30) same day or before DateTime(2014, 10, 25) false + DateTime(2014, 12, 20, 12) same hour or before DateTime(2014, 12, 20, 12) true + DateTime(2014, 10, 25, 5) same hour or before DateTime(2014, 10, 25, 10) true + DateTime(2014, 10, 25, 20) same hour or before DateTime(2014, 10, 25, 15) false + DateTime(2014, 12, 20, 12, 30) same minute or before DateTime(2014, 12, 20, 12, 30) true + DateTime(2014, 10, 25, 10, 20) same minute or before DateTime(2014, 10, 25, 10, 25) true + DateTime(2014, 10, 25, 15, 55) same minute or before DateTime(2014, 10, 25, 15, 45) false + DateTime(2014, 12, 20, 12, 30, 15) same second or before DateTime(2014, 12, 20, 12, 30, 15) true + DateTime(2014, 10, 25, 10, 25, 15) same second or before DateTime(2014, 10, 25, 10, 25, 20) true + DateTime(2014, 10, 25, 15, 45, 25) same second or before DateTime(2014, 10, 25, 15, 45, 21) false + DateTime(2014, 12, 20, 12, 30, 15, 250) same millisecond or before DateTime(2014, 12, 20, 12, 30, 15, 250) true + DateTime(2014, 10, 25, 10, 25, 20, 450) same millisecond or before DateTime(2014, 10, 25, 10, 25, 20, 499) true + DateTime(2014, 10, 25, 15, 45, 20, 505) same millisecond or before DateTime(2014, 10, 25, 15, 45, 20, 501) false + DateTime(2014, 12, 20) same minute or before DateTime(2014, 12, 20, 15) null + @2012-03-10T09:20:00.999+07:00 same hour or before @2012-03-10T10:20:00.999+06:00 true + @2012-03-10T10:20:00.999+06:00 same hour or before @2012-03-10T10:20:00.999+07:00 false + @T23:25:25.555 same hour or before @T23:55:25.900 true + @T21:25:25.555 same hour or before @T22:55:25.900 true + @T22:25:25.555 same hour or before @T21:55:25.900 false + @T23:25:25.555 same minute or before @T23:25:25.900 true + @T23:10:25.555 same minute or before @T22:15:25.900 false + @T23:56:25.555 same minute or before @T23:55:25.900 false + @T23:25:25.555 same second or before @T23:25:25.900 true + @T23:25:35.555 same second or before @T22:25:45.900 false + @T23:55:45.555 same second or before @T23:55:35.900 false + @T23:25:25.555 same millisecond or before @T23:25:25.555 true + @T23:25:25.200 same millisecond or before @T22:25:25.550 false + @T23:55:25.966 same millisecond or before @T23:55:25.900 false + + DateTime(2005, 10, 10) - 5 years @2000-10-10T + DateTime(2005, 10, 10) - 2005 years + DateTime(2005, 6, 10) - 5 months @2005-01-10T + DateTime(2005, 5, 10) - 6 months @2004-11-10T + DateTime(2018, 5, 23) - 3 weeks = DateTime(2018, 5, 2) true @@ -1211,6 +1594,7 @@ + DateTime(2018, 5, 23) - 52 weeks = DateTime(2017, 5, 24) true @@ -1218,6 +1602,7 @@ + DateTime(2024, 2, 29) - 52 weeks = DateTime(2023, 3, 2) true @@ -1225,6 +1610,7 @@ + DateTime(2024, 3, 1) - 52 weeks = DateTime(2023, 3, 3) true @@ -1232,132 +1618,178 @@ + DateTime(2005, 5, 10) - 5 days @2005-05-05T + DateTime(2016, 6, 10) - 11 days @2016-05-30T + DateTime(2005, 5, 10, 10) - 5 hours @2005-05-10T05 + DateTime(2016, 6, 10, 5) - 6 hours @2016-06-09T23 + DateTime(2005, 5, 10, 5, 10) - 5 minutes @2005-05-10T05:05 + DateTime(2016, 6, 10, 5, 5) - 6 minutes @2016-06-10T04:59 + DateTime(2005, 5, 10, 5, 5, 10) - 5 seconds @2005-05-10T05:05:05 + DateTime(2016,5) - 31535999 seconds = DateTime(2015, 5) true + DateTime(2016, 10, 1, 10, 20, 30) - 15 hours @2016-09-30T19:20:30 + DateTime(2016, 6, 10, 5, 5, 5) - 6 seconds @2016-06-10T05:04:59 + DateTime(2005, 5, 10, 5, 5, 5, 10) - 5 milliseconds @2005-05-10T05:05:05.005 + DateTime(2016, 6, 10, 5, 5, 5, 5) - 6 milliseconds @2016-06-10T05:05:04.999 + DateTime(2014) - 24 months @2012T + DateTime(2014) - 25 months @2012T + Date(2014) - 24 months @2012 + Date(2014) - 25 months @2012 + Date(2014,6) - 33 days @2014-05 + Date(2014,6) - 1 year @2013-06 + @T15:59:59.999 - 5 hours @T10:59:59.999 + @T15:59:59.999 - 1 minutes @T15:58:59.999 + @T15:59:59.999 - 1 seconds @T15:59:58.999 + @T15:59:59.0 - 1 milliseconds @T15:59:58.999 + @T15:59:59.999 - 5 hours - 1 minutes @T10:58:59.999 + @T15:59:59.999 - 300 minutes @T10:59:59.999 + + @T23:59:59.999 @T23:59:59.999 + + TimeOfDay() = TimeOfDay() true + + + + + + Today() same day or before Today() true + + + Today() same day or before Today() + 1 days true + + + Today() + 1 years same day or before Today() false + + + Today() + 1 days > Today() true + + + Today() = Today() true diff --git a/test/spec-tests/xml/CqlErrorsAndMessagingOperatorsTest.xml b/test/spec-tests/xml/CqlErrorsAndMessagingOperatorsTest.xml index 6ff7602cf..0470b8aca 100644 --- a/test/spec-tests/xml/CqlErrorsAndMessagingOperatorsTest.xml +++ b/test/spec-tests/xml/CqlErrorsAndMessagingOperatorsTest.xml @@ -1,20 +1,26 @@ + + + Message(1, true, '100', 'Message', 'Test Message') 1 + Message(2, true, '200', 'Warning', 'You have been warned!') 2 + Message({3, 4, 5}, true, '300', 'Trace', 'This is a trace') {3, 4, 5} + Message(3 + 1, true, '400', 'Error', 'This is an error!') diff --git a/test/spec-tests/xml/CqlIntervalOperatorsTest.xml b/test/spec-tests/xml/CqlIntervalOperatorsTest.xml index c7072ec16..64c8e2b47 100644 --- a/test/spec-tests/xml/CqlIntervalOperatorsTest.xml +++ b/test/spec-tests/xml/CqlIntervalOperatorsTest.xml @@ -1,630 +1,789 @@ + + + (null as Integer) after Interval[1, 10] null + Interval[11, 20] after Interval[1, 10] true + Interval[1, 10] after Interval[11, 20] false + 12 after Interval[1, 10] true + 9 after Interval[1, 10] false + Interval[11, 20] after 5 true + Interval[11, 20] after 12 false + Interval[11.0, 20.0] after Interval[1.0, 10.0] true + Interval[1.0, 10.0] after Interval[11.0, 20.0] false + 12.0 after Interval[1.0, 10.0] true + 9.0 after Interval[1.0, 10.0] false + Interval[11.0, 20.0] after 5.0 true + Interval[11.0, 20.0] after 12.0 false + Interval[11.0 'g', 20.0 'g'] after Interval[1.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] after Interval[11.0 'g', 20.0 'g'] false + 12.0'g' after Interval[1.0 'g', 10.0 'g'] true + 9.0'g' after Interval[1.0 'g', 10.0 'g'] false + Interval[11.0 'g', 20.0 'g'] after 5.0'g' true + Interval[11.0 'g', 20.0 'g'] after 12.0'g' false + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] after DateTime(2011, 12, 31) true + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] after DateTime(2012, 12, 31) false + Interval[@T15:59:59.999, @T20:59:59.999] after @T12:59:59.999 true + Interval[@T15:59:59.999, @T20:59:59.999] after @T17:59:59.999 false + + (null as Integer) before Interval[1, 10] null + Interval[11, 20] before Interval[1, 10] false + Interval[1, 10] before Interval[11, 20] true + 9 before Interval[11, 20] true + 9 before Interval[1, 10] false + Interval[1, 10] before 11 true + Interval[1, 10] before 8 false + Interval[11.0, 20.0] before Interval[1.0, 10.0] false + Interval[1.0, 10.0] before Interval[11.0, 20.0] true + 9.0 before Interval[11.0, 20.0] true + 9.0 before Interval[1.0, 10.0] false + Interval[1.0, 10.0] before 11.0 true + Interval[1.0, 10.0] before 8.0 false + Interval[1.0 'g', 10.0 'g'] before Interval[11.0 'g', 20.0 'g'] true + Interval[11.0 'g', 20.0 'g'] before Interval[1.0 'g', 10.0 'g'] false + Interval[1.0 'g', 10.0 'g'] before 12.0'g' true + Interval[1.0 'g', 10.0 'g'] before 9.0'g' false + 5.0'g' before Interval[11.0 'g', 20.0 'g'] true + 12.0'g' before Interval[11.0 'g', 20.0 'g'] false + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] before DateTime(2012, 2, 27) true + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] before DateTime(2011, 12, 31) false + Interval[@T15:59:59.999, @T20:59:59.999] before @T22:59:59.999 true + Interval[@T15:59:59.999, @T20:59:59.999] before @T10:59:59.999 false + + collapse {Interval(null, null)} { } + collapse { Interval[1,5], Interval[3,7], Interval[12,19], Interval[7,10] } {Interval [ 1, 10 ], Interval [ 12, 19 ]} + + collapse { Interval[1,2], Interval[3,7], Interval[10,19], Interval[7,10] } {Interval [ 1, 19 ]} + collapse { Interval[4,6], Interval[7,8] } {Interval [ 4, 8 ]} + collapse { Interval[1.0,5.0], Interval[3.0,7.0], Interval[12.0,19.0], Interval[7.0,10.0] } {Interval [ 1.0, 10.0 ], Interval [ 12.0, 19.0 ]} + collapse { Interval[4.0,6.0], Interval[6.00000001,8.0] } {Interval [ 4.0, 8.0 ]} + collapse { Interval[1.0 'g',5.0 'g'], Interval[3.0 'g',7.0 'g'], Interval[12.0 'g',19.0 'g'], Interval[7.0 'g',10.0 'g'] } {Interval [ 1.0 'g', 10.0 'g' ], Interval [ 12.0 'g', 19.0 'g' ]} + collapse { Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)], Interval[DateTime(2012, 1, 10), DateTime(2012, 1, 25)], Interval[DateTime(2012, 5, 10), DateTime(2012, 5, 25)], Interval[DateTime(2012, 5, 20), DateTime(2012, 5, 30)] } {Interval [ @2012-01-01T, @2012-01-25T ], Interval [ @2012-05-10T, @2012-05-30T ]} + collapse { Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)], Interval[DateTime(2012, 1, 16), DateTime(2012, 5, 25)] } {Interval [ @2012-01-01T, @2012-05-25T ]} + collapse { Interval[@T01:59:59.999, @T10:59:59.999], Interval[@T08:59:59.999, @T15:59:59.999], Interval[@T17:59:59.999, @T20:59:59.999], Interval[@T18:59:59.999, @T22:59:59.999] } {Interval [ @T01:59:59.999, @T15:59:59.999 ], Interval [ @T17:59:59.999, @T22:59:59.999 ]} + collapse { Interval[@T01:59:59.999, @T10:59:59.999], Interval[@T11:00:00.000, @T15:59:59.999] } {Interval [ @T01:59:59.999, @T15:59:59.999 ]} + + expand null null + expand { } { } + expand { null } { } + expand { Interval[@2018-01-01, @2018-01-04] } per day { Interval[@2018-01-01, @2018-01-01], Interval[@2018-01-02, @2018-01-02], Interval[@2018-01-03, @2018-01-03], Interval[@2018-01-04, @2018-01-04] } + expand Interval[@2018-01-01, @2018-01-04] per day { @2018-01-01, @2018-01-02, @2018-01-03, @2018-01-04 } + expand { Interval[@2018-01-01, @2018-01-04] } per 2 days { Interval[@2018-01-01, @2018-01-02], Interval[@2018-01-03, @2018-01-04] } + expand Interval[@2018-01-01, @2018-01-04] per 2 days { @2018-01-01, @2018-01-03 } + expand { Interval[@T10:00, @T12:30] } per hour { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } + expand Interval[@T10:00, @T12:30] per hour { @T10, @T11, @T12 } + expand { Interval[@T10:00, @T12:30) } per hour { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } + expand Interval[@T10:00, @T12:30) per hour { @T10, @T11, @T12 } + expand { Interval[10.0, 12.5] } per 1 { Interval[10, 10], Interval[11, 11], Interval[12, 12] } + expand Interval[10.0, 12.5] per 1 { 10, 11, 12 } + expand { Interval[10.0, 12.5) } per 1 { Interval[10, 10], Interval[11, 11], Interval[12, 12] } + expand Interval[10.0, 12.5) per 1 { 10, 11, 12 } + expand { Interval[@T10, @T10] } per minute { } + expand Interval[@T10, @T10] per minute { } + expand { Interval[10, 10] } per 0.1 { Interval[10.0, 10.0], Interval[10.1, 10.1], Interval[10.2, 10.2], Interval[10.3, 10.3], Interval[10.4, 10.4], Interval[10.5, 10.5], Interval[10.6, 10.6], Interval[10.7, 10.7], Interval[10.8, 10.8], Interval[10.9, 10.9] } + expand Interval[10, 10] per 0.1 { 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 } + expand { Interval[1, 10] } { Interval[1, 1], Interval[2, 2], Interval[3, 3], Interval[4, 4], Interval[5, 5], Interval[6, 6], Interval[7, 7], Interval[8, 8], Interval[9, 9], Interval[10, 10] } + expand Interval[1, 10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } + expand { Interval[1, 10) } { Interval[1, 1], Interval[2, 2], Interval[3, 3], Interval[4, 4], Interval[5, 5], Interval[6, 6], Interval[7, 7], Interval[8, 8], Interval[9, 9] } + expand Interval[1, 10) { 1, 2, 3, 4, 5, 6, 7, 8, 9 } + expand { Interval[1, 10] } per 2 { Interval[1, 2], Interval[3, 4], Interval[5, 6], Interval[7, 8], Interval[9, 10] } + expand Interval[1, 10] per 2 { 1, 3, 5, 7, 9 } + expand { Interval[1, 10) } per 2 { Interval[1, 2], Interval[3, 4], Interval[5, 6], Interval[7, 8] } + expand Interval[1, 10) per 2 { 1, 3, 5, 7 } + + Interval[1, 10] contains null null - null contains 5 + + null as Interval<Integer> contains 5 false + Interval[null, 5] contains 10 false + Interval[1, 10] contains 5 true + Interval[1, 10] contains 25 false + Interval[1.0, 10.0] contains 8.0 true + Interval[1.0, 10.0] contains 255.0 false + Interval[1.0 'g', 10.0 'g'] contains 2.0 'g' true + Interval[1.0 'g', 10.0 'g'] contains 100.0 'g' false + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] contains DateTime(2012, 1, 10) true + Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] contains DateTime(2012, 1, 16) false + Interval[@T01:59:59.999, @T10:59:59.999] contains @T05:59:59.999 true + Interval[@T01:59:59.999, @T10:59:59.999] contains @T15:59:59.999 false + + end of Interval[1, 10] 10 + end of Interval[1.0, 10.0] 10.0 + end of Interval[1.0 'g', 10.0 'g'] 10.0'g' + end of Interval[@2016-05-01T00:00:00.000, @2016-05-02T00:00:00.000] @2016-05-02T00:00:00.000 + end of Interval[@T00:00:00.000, @T23:59:59.599] @T23:59:59.599 + + Interval[1, 10] ends Interval(null, null) null + Interval[4, 10] ends Interval[1, 10] true + Interval[44, 50] ends Interval[1, 10] false + Interval[4.0, 10.0] ends Interval[1.0, 10.0] true + Interval[11.0, 20.0] ends Interval[1.0, 10.0] false + Interval[5.0 'g', 10.0 'g'] ends Interval[1.0 'g', 10.0 'g'] true + Interval[11.0 'g', 20.0 'g'] ends Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] ends Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 15)] true + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] ends Interval[DateTime(2012, 1, 1), DateTime(2012, 1, 16)] false + Interval[@T05:59:59.999, @T10:59:59.999] ends Interval[@T01:59:59.999, @T10:59:59.999] true + Interval[@T05:59:59.999, @T10:59:59.999] ends Interval[@T01:59:59.999, @T11:59:59.999] false + + Interval[1, 10] = Interval(null, null) null + Interval[1, 10] = Interval[1, 10] true + Interval[1, 10] = Interval[11, 20] false + Interval[1.0, 10.0] = Interval[1.0, 10.0] true + Interval[1.0, 10.0] = Interval[11.0, 20.0] false + Interval[1.0 'g', 10.0 'g'] = Interval[1.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] = Interval[11.0 'g', 20.0 'g'] false + Interval[DateTime(2012, 1, 5, 0, 0, 0, 0), DateTime(2012, 1, 15, 0, 0, 0, 0)] = Interval[DateTime(2012, 1, 5, 0, 0, 0, 0), DateTime(2012, 1, 15, 0, 0, 0, 0)] true + Interval[DateTime(2012, 1, 5, 0, 0, 0, 0), DateTime(2012, 1, 15, 0, 0, 0, 0)] = Interval[DateTime(2012, 1, 5, 0, 0, 0, 0), DateTime(2012, 1, 16, 0, 0, 0, 0)] false + Interval[@T05:59:59.999, @T10:59:59.999] = Interval[@T05:59:59.999, @T10:59:59.999] true + Interval[@T05:59:59.999, @T10:59:59.999] = Interval[@T05:59:59.999, @T10:58:59.999] false - - Interval[null, null] - null - + + Interval[null, null] except Interval[null, null] null + Interval[1, 10] except Interval[4, 10] Interval [ 1, 3 ] + Interval[1, 10] except Interval[3, 7] null + Interval[1.0, 10.0] except Interval[4.0, 10.0] Interval [ 1.0, 3.99999999 ] + Interval[1.0, 10.0] except Interval[3.0, 7.0] null + Interval[1.0 'g', 10.0 'g'] except Interval[5.0 'g', 10.0 'g'] Interval [ 1.0 'g', 4.99999999 'g' ] + Interval[1, 4] except Interval[3, 6] Interval [ 1, 2 ] + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] except Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 15)] Interval [ @2012-01-05T, @2012-01-06T ] + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 16)] except Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 12)] Interval [ @2012-01-13T, @2012-01-16T ] + Interval[@T05:59:59.999, @T10:59:59.999] except Interval[@T08:59:59.999, @T10:59:59.999] Interval [ @T05:59:59.999, @T08:59:59.998 ] + Interval[@T08:59:59.999, @T11:59:59.999] except Interval[@T05:59:59.999, @T10:59:59.999] Interval [ @T11:00:00.000, @T11:59:59.999 ] + + 5 in Interval[null, null] false + 5 in Interval[1, 10] true + 500 in Interval[1, 10] false + 9.0 in Interval[1.0, 10.0] true + -2.0 in Interval[1.0, 10.0] false + 1.0 'g' in Interval[1.0 'g', 10.0 'g'] true + 55.0 'g' in Interval[1.0 'g', 10.0 'g'] false + DateTime(2012, 1, 7) in Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] true + DateTime(2012, 1, 17) in Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] false + DateTime(2012, 1, 7) in Interval[DateTime(2012, 1, 5), null] true + @T07:59:59.999 in Interval[@T05:59:59.999, @T10:59:59.999] true + @T17:59:59.999 in Interval[@T05:59:59.999, @T10:59:59.999] false + null in Interval[@T05:59:59.999, @T10:59:59.999] null + Interval[@2017-12-20T11:00:00, @2017-12-21T21:00:00] Interval [ @2017-12-20T11:00:00, @2017-12-21T21:00:00 ] + Interval[@2017-12-20T10:30:00, @2017-12-20T12:00:00] Interval [ @2017-12-20T10:30:00, @2017-12-20T12:00:00 ] + Interval[@2017-12-20T10:30:00, @2017-12-20T12:00:00] starts 1 day or less on or after day of start of @@ -634,1101 +793,1385 @@ + + Interval[1, 10] includes null null + Interval[1, 10] includes Interval[4, 10] true + Interval[1, 10] includes Interval[44, 50] false + Interval[1.0, 10.0] includes Interval[4.0, 10.0] true + Interval[1.0, 10.0] includes Interval[11.0, 20.0] false + Interval[1.0 'g', 10.0 'g'] includes Interval[5.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] includes Interval[11.0 'g', 20.0 'g'] false + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] includes Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] true + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] includes Interval[DateTime(2012, 1, 4), DateTime(2012, 1, 14)] false + Interval[@T05:59:59.999, @T10:59:59.999] includes Interval[@T06:59:59.999, @T09:59:59.999] true + Interval[@T05:59:59.999, @T10:59:59.999] includes Interval[@T04:59:59.999, @T09:59:59.999] false + + null included in Interval[1, 10] null + Interval[4, 10] included in Interval[1, 10] true + Interval[44, 50] included in Interval[1, 10] false + Interval[4.0, 10.0] included in Interval[1.0, 10.0] true + Interval[11.0, 20.0] included in Interval[1.0, 10.0] false + Interval[5.0 'g', 10.0 'g'] included in Interval[1.0 'g', 10.0 'g'] true + Interval[11.0 'g', 20.0 'g'] included in Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] included in Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] true + Interval[DateTime(2012, 1, 4), DateTime(2012, 1, 14)] included in Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 15)] false + Interval[@T06:59:59.999, @T09:59:59.999] included in Interval[@T05:59:59.999, @T10:59:59.999] true + Interval[@T04:59:59.999, @T09:59:59.999] included in Interval[@T05:59:59.999, @T10:59:59.999] false + Interval [@2017-09-01T00:00:00, @2017-09-01T00:00:00] included in Interval [@2017-09-01T00:00:00.000, @2017-12-30T23:59:59.999] null + Interval [@2017-09-01T00:00:00, @2017-09-01T00:00:00] included in day of Interval [@2017-09-01T00:00:00.000, @2017-12-30T23:59:59.999] true + Interval [@2017-09-01T00:00:00, @2017-09-01T00:00:00] included in millisecond of Interval [@2017-09-01T00:00:00.000, @2017-12-30T23:59:59.999] null + + Interval[1, 10] intersect Interval[5, null) Interval[5, null) + start of (Interval[1, 10] intersect Interval[5, null)) <= 10 true + start of (Interval[1, 10] intersect Interval[5, null)) >= 5 true + start of (Interval[1, 10] intersect Interval[5, null)) > 10 false + start of (Interval[1, 10] intersect Interval[5, null)) < 5 false + Interval[1, 10] intersect Interval[4, 10] Interval [ 4, 10 ] + Interval[1, 10] intersect Interval[11, 20] null + Interval[1.0, 10.0] intersect Interval[4.0, 10.0] Interval [ 4.0, 10.0 ] + Interval[1.0, 10.0] intersect Interval[11.0, 20.0] null + Interval[1.0 'g', 10.0 'g'] intersect Interval[5.0 'g', 10.0 'g'] Interval [ 5.0 'g', 10.0 'g' ] + Interval[1.0 'g', 10.0 'g'] intersect Interval[11.0 'g', 20.0 'g'] null + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] intersect Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 10)] Interval [ @2012-01-07T, @2012-01-10T ] + Interval[@T04:59:59.999, @T09:59:59.999] intersect Interval[@T04:59:59.999, @T06:59:59.999] Interval [ @T04:59:59.999, @T06:59:59.999 ] + + Interval[1, 10] ~ Interval[1, 10] true + Interval[44, 50] ~ Interval[1, 10] false + Interval[1.0, 10.0] ~ Interval[1.0, 10.0] true + Interval[11.0, 20.0] ~ Interval[1.0, 10.0] false + Interval[1.0 'g', 10.0 'g'] ~ Interval[1.0 'g', 10.0 'g'] true + Interval[11.0 'g', 20.0 'g'] ~ Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] ~ Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] true + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] ~ Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 15)] false + Interval[@T04:59:59.999, @T09:59:59.999] ~ Interval[@T04:59:59.999, @T09:59:59.999] true + Interval[@T04:59:59.999, @T09:59:59.999] ~ Interval[@T04:58:59.999, @T09:59:59.999] false + + Interval(null, 5] meets Interval(null, 15) null + Interval[1, 10] meets Interval[11, 20] true + Interval[1, 10] meets Interval[44, 50] false + Interval[3.01, 5.00000001] meets Interval[5.00000002, 8.50] true + Interval[3.01, 5.00000001] meets Interval[5.5, 8.50] false + Interval[3.01 'g', 5.00000001 'g'] meets Interval[5.00000002 'g', 8.50 'g'] true + Interval[3.01 'g', 5.00000001 'g'] meets Interval[5.5 'g', 8.50 'g'] false + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] meets Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 25)] true + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] meets Interval[DateTime(2012, 1, 20), DateTime(2012, 1, 25)] false + Interval[@T04:59:59.999, @T09:59:59.999] meets Interval[@T10:00:00.000, @T19:59:59.999] true + Interval[@T04:59:59.999, @T09:59:59.999] meets Interval[@T10:12:00.000, @T19:59:59.999] false + + Interval(null, 5] meets before Interval(null, 25] null + Interval[1, 10] meets before Interval[11, 20] true + Interval[1, 10] meets before Interval[44, 50] false + Interval[3.50000001, 5.00000011] meets before Interval[5.00000012, 8.50] true + Interval[8.01, 15.00000001] meets before Interval[15.00000000, 18.50] false + Interval[3.50000001 'g', 5.00000011 'g'] meets before Interval[5.00000012 'g', 8.50 'g'] true + Interval[8.01 'g', 15.00000001 'g'] meets before Interval[15.00000000 'g', 18.50 'g'] false + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] meets Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 25)] true + Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] meets Interval[DateTime(2012, 1, 20), DateTime(2012, 1, 25)] false + Interval[@T04:59:59.999, @T09:59:59.999] meets Interval[@T10:00:00.000, @T19:59:59.999] true + Interval[@T04:59:59.999, @T09:59:59.999] meets Interval[@T10:12:00.000, @T19:59:59.999] false + + Interval(null, 5] meets after Interval[11, null) false + Interval[11, 20] meets after Interval[1, 10] true + Interval[44, 50] meets after Interval[1, 10] false + Interval[55.00000123, 128.032156] meets after Interval[12.00258, 55.00000122] true + Interval[55.00000124, 150.222222] meets after Interval[12.00258, 55.00000122] false + Interval[55.00000123 'g', 128.032156 'g'] meets after Interval[12.00258 'g', 55.00000122 'g'] true + Interval[55.00000124 'g', 150.222222 'g'] meets after Interval[12.00258 'g', 55.00000122 'g'] false + Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 25)] meets Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] true + Interval[DateTime(2012, 1, 20), DateTime(2012, 1, 25)] meets Interval[DateTime(2012, 1, 7), DateTime(2012, 1, 14)] false + Interval[@T10:00:00.000, @T19:59:59.999] meets Interval[@T04:59:59.999, @T09:59:59.999] true + Interval[@T10:12:00.000, @T19:59:59.999] meets Interval[@T04:59:59.999, @T09:59:59.999] false + + Interval[1, 10] != Interval[11, 20] true + Interval[1, 10] != Interval[1, 10] false + Interval[1.0, 10.0] != Interval[11.0, 20.0] true + Interval[1.0, 10.0] != Interval[1.0, 10.0] false + Interval[1.0 'g', 10.0 'g'] != Interval[11.0 'g', 20.0 'g'] true + Interval[1.0 'g', 10.0 'g'] != Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 15, 0, 0, 0, 0), DateTime(2012, 1, 25, 0, 0, 0, 0)] != Interval[DateTime(2012, 1, 15, 0, 0, 0, 0), DateTime(2012, 1, 25, 0, 0, 0, 22)] true + Interval[DateTime(2012, 1, 15, 0, 0, 0, 0), DateTime(2012, 1, 25, 0, 0, 0, 0)] != Interval[DateTime(2012, 1, 15, 0, 0, 0, 0), DateTime(2012, 1, 25, 0, 0, 0, 0)] false + Interval[@T10:00:00.000, @T19:59:59.999] != Interval[@T10:10:00.000, @T19:59:59.999] true + Interval[@T10:00:00.000, @T19:59:59.999] != Interval[@T10:00:00.000, @T19:59:59.999] false + + Interval[@2012-12-01, @2013-12-01] on or after (null as Interval<Date>) null + Interval[@2012-12-01, @2013-12-01] on or after month of @2012-11-15 true + @2012-11-15 on or after month of Interval[@2012-12-01, @2013-12-01] false + Interval[@T10:00:00.000, @T19:59:59.999] on or after hour of Interval[@T08:00:00.000, @T09:59:59.999] true + Interval[@T10:00:00.000, @T19:59:59.999] on or after hour of Interval[@T08:00:00.000, @T11:59:59.999] false + Interval[6, 10] on or after 6 true + 2.5 on or after Interval[1.666, 2.50000001] false + 2.5 'mg' on or after Interval[1.666 'mg', 2.50000000 'mg'] true + + Interval[@2012-12-01, @2013-12-01] on or before (null as Interval<Date>) null + Interval[@2012-10-01, @2012-11-01] on or before month of @2012-11-15 true + @2012-11-15 on or before month of Interval[@2012-10-01, @2013-12-01] false + Interval[@T05:00:00.000, @T07:59:59.999] on or before hour of Interval[@T08:00:00.000, @T09:59:59.999] true + Interval[@T10:00:00.000, @T19:59:59.999] on or before hour of Interval[@T08:00:00.000, @T11:59:59.999] false + Interval[4, 6] on or before 6 true + 1.6667 on or before Interval[1.666, 2.50000001] false + 1.666 'mg' on or before Interval[1.666 'mg', 2.50000000 'mg'] true + + Interval[null, null] overlaps Interval[1, 10] null + Interval[1, 10] overlaps Interval[4, 10] true + Interval[4, 10] overlaps Interval[4, 10] true + Interval[10, 15] overlaps Interval[4, 10] true + Interval[1, 10] overlaps Interval[11, 20] false + Interval[4, 10) overlaps Interval[4, 10) true + Interval[4, 11) overlaps Interval[10, 20] true + Interval[4, 10] overlaps Interval(9, 20] true + Interval[4, 11) overlaps Interval(9, 20] true + Interval[4, 10] overlaps Interval(10, 20] false + + Interval[4, 10) overlaps Interval[10, 20] false + Interval[4, 10) overlaps Interval(10, 20] false + Interval[4, 10) overlaps Interval(9, 20] false + Interval[1.0, 10.0] overlaps Interval[4.0, 10.0] true + Interval[1.0, 10.0] overlaps Interval[11.0, 20.0] false + Interval[1.0 'g', 10.0 'g'] overlaps Interval[5.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] overlaps Interval[11.0 'g', 20.0 'g'] false + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] overlaps Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] true + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] overlaps Interval[DateTime(2012, 1, 26), DateTime(2012, 1, 28)] false + Interval[DateTime(2012, 2, 25), DateTime(2012, 3, 26)] overlaps Interval[DateTime(2012, 1, 10), DateTime(2012, 2)] null + Interval[DateTime(2012, 1, 25), DateTime(2012, 2, 26)] overlaps Interval[DateTime(2012, 2), DateTime(2012, 3, 28)] null + Interval[DateTime(2012, 2), DateTime(2012, 3)] overlaps Interval[DateTime(2011, 1, 10), DateTime(2012)] null + Interval[DateTime(2012), DateTime(2013, 3)] overlaps Interval[DateTime(2012, 2), DateTime(2013, 2)] true + Interval[DateTime(2012, 2), DateTime(2013)] overlaps Interval[DateTime(2012, 3), DateTime(2013, 2)] true + Interval[@T10:00:00.000, @T19:59:59.999] overlaps Interval[@T12:00:00.000, @T21:59:59.999] true + Interval[@T10:00:00.000, @T19:59:59.999] overlaps Interval[@T20:00:00.000, @T21:59:59.999] false + + Interval[null, null] overlaps before Interval[1, 10] null + Interval[1, 10] overlaps before Interval[4, 10] true + Interval[4, 10] overlaps before Interval[1, 10] false + Interval[4, 10] overlaps before Interval[4, 10] false + Interval[4, 10] overlaps before Interval(4, 10] true + Interval(3, 10] overlaps before Interval(4, 10] true + Interval(3, 10] overlaps before Interval[5, 10] true + Interval(3, 10] overlaps before Interval(3, 10] false + Interval(3, 10] overlaps before Interval[4, 10] false + Interval[4, 10] overlaps before Interval(3, 10] false + Interval[1.0, 10.0] overlaps before Interval[4.0, 10.0] true + Interval[4.0, 10.0] overlaps before Interval[1.0, 10.0] false + Interval[1.0 'g', 10.0 'g'] overlaps before Interval[5.0 'g', 10.0 'g'] true + Interval[5.0 'g', 10.0 'g'] overlaps before Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] overlaps Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] true + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] overlaps Interval[DateTime(2012, 1, 26), DateTime(2012, 1, 28)] false + Interval[@T10:00:00.000, @T19:59:59.999] overlaps Interval[@T12:00:00.000, @T21:59:59.999] true + Interval[@T10:00:00.000, @T19:59:59.999] overlaps Interval[@T20:00:00.000, @T21:59:59.999] false + + Interval[null, null] overlaps after Interval[1, 10] null + Interval[4, 15] overlaps after Interval[1, 10] true + Interval[4, 10] overlaps after Interval[1, 10] false + Interval[4, 10] overlaps after Interval[4, 10] false + Interval[4, 11) overlaps after Interval[4, 9] true + Interval[4, 11) overlaps after Interval[4, 10) true + Interval[4, 10] overlaps after Interval[4, 10) true + Interval[4, 11) overlaps after Interval[4, 11) false + Interval[4, 11) overlaps after Interval[4, 10] false + Interval[4, 10] overlaps after Interval[4, 11) false + Interval[4.0, 15.0] overlaps after Interval[1.0, 10.0] true + Interval[4.0, 10.0] overlaps after Interval[1.0, 10.0] false + Interval[5.0 'g', 15.0 'g'] overlaps after Interval[1.0 'g', 10.0 'g'] true + Interval[5.0 'g', 10.0 'g'] overlaps after Interval[1.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] overlaps Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] true + Interval[DateTime(2012, 1, 26), DateTime(2012, 1, 28)] overlaps Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] false + Interval[@T12:00:00.000, @T21:59:59.999] overlaps Interval[@T10:00:00.000, @T19:59:59.999] true + Interval[@T20:00:00.000, @T21:59:59.999] overlaps Interval[@T10:00:00.000, @T19:59:59.999] false + + point from Interval[null, null] null + point from Interval[1, 1] 1 + point from Interval[1.0, 1.0] 1.0 + point from Interval[1.0 'cm', 1.0 'cm'] 1.0'cm' + + Interval[@T12:00:00.000, @T21:59:59.999] properly includes @T12:00:00.001 true + Interval[@T12:00:00.000, @T21:59:59.999] properly includes @T12:00:00.000 false + Interval[@T12:00:00.001, @T21:59:59.999] properly includes @T12:00:00 null + Interval[@T12:00:00.000, @T21:59:59.999] properly includes second of @T12:00:01 true + Interval[@T12:00:00.001, @T21:59:59.999] properly includes second of @T12:00:00 false + Interval[@T12:00:00.001, @T21:59:59.999] properly includes millisecond of @T12:00:00 null + + @T12:00:00.001 properly included in Interval[@T12:00:00.000, @T21:59:59.999] true + @T12:00:00.000 properly included in Interval[@T12:00:00.000, @T21:59:59.999] false + @T12:00:00 properly included in Interval[@T12:00:00.001, @T21:59:59.999] null + @T12:00:01 properly included in second of Interval[@T12:00:00.000, @T21:59:59.999] true + @T12:00:00 properly included in second of Interval[@T12:00:00.001, @T21:59:59.999] false + @T12:00:00 properly included in millisecond of Interval[@T12:00:00.001, @T21:59:59.999] null + + Interval[null as Integer, null as Integer] properly includes Interval[1, 10] true + Interval[1, 10] properly includes Interval[4, 10] true + Interval[1, 10] properly includes Interval[4, 15] false + Interval[1.0, 10.0] properly includes Interval[4.0, 10.0] true + Interval[1.0, 10.0] properly includes Interval[4.0, 15.0] false + Interval[1.0 'g', 10.0 'g'] properly includes Interval[5.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] properly includes Interval[5.0 'g', 15.0 'g'] false + Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] properly includes Interval[DateTime(2012, 1, 16), DateTime(2012, 1, 27)] true + Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] properly includes Interval[DateTime(2012, 1, 16), DateTime(2012, 1, 29)] false + Interval[@T12:00:00.000, @T21:59:59.999] properly includes Interval[@T12:01:01.000, @T21:59:59.998] true + Interval[@T12:00:00.000, @T21:59:59.999] properly includes Interval[@T12:01:01.000, @T22:00:00.000] false + + Interval[1, 10] properly included in Interval[null, null] true + Interval[4, 10] properly included in Interval[1, 10] true + Interval[4, 15] properly included in Interval[1, 10] false + Interval[4.0, 10.0] properly included in Interval[1.0, 10.0] true + Interval[4.0, 15.0] properly included in Interval[1.0, 10.0] false + Interval[5.0 'g', 10.0 'g'] properly included in Interval[1.0 'g', 10.0 'g'] true + Interval[1.0 'g', 10.0 'g'] properly included in Interval[5.0 'g', 15.0 'g'] false + Interval[DateTime(2012, 1, 16), DateTime(2012, 1, 27)] properly included in Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] true + Interval[DateTime(2012, 1, 16), DateTime(2012, 1, 29)] properly included in Interval[DateTime(2012, 1, 15), DateTime(2012, 1, 28)] false + Interval[@T12:01:01.000, @T21:59:59.998] properly included in Interval[@T12:00:00.000, @T21:59:59.999] true + Interval[@T12:01:01.000, @T22:00:00.000] properly included in Interval[@T12:00:00.000, @T21:59:59.999] false + + start of Interval[1, 10] 1 + start of Interval[1.0, 10.0] 1.0 + start of Interval[1.0 'g', 10.0 'g'] 1.0'g' + start of Interval[@2016-05-01T00:00:00.000, @2016-05-02T00:00:00.000] @2016-05-01T00:00:00.000 + start of Interval[@T00:00:00.000, @T23:59:59.599] @T00:00:00.000 + + Interval[null, null] starts Interval[1, 10] null + Interval[4, 10] starts Interval[4, 15] true + Interval[1, 10] starts Interval[4, 10] false + Interval[4.0, 10.0] starts Interval[4.0, 15.0] true + Interval[1.0, 10.0] starts Interval[4.0, 10.0] false + Interval[5.0 'g', 10.0 'g'] starts Interval[5.0 'g', 15.0 'g'] true + Interval[1.0 'g', 10.0 'g'] starts Interval[5.0 'g', 10.0 'g'] false + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] starts Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 27)] true + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] starts Interval[DateTime(2012, 1, 6), DateTime(2012, 1, 27)] false + Interval[@T05:59:59.999, @T15:59:59.999] starts Interval[@T05:59:59.999, @T17:59:59.999] true + Interval[@T05:59:59.999, @T15:59:59.999] starts Interval[@T04:59:59.999, @T17:59:59.999] false + + Interval[null, null] union Interval[1, 10] null + Interval[1, 10] union Interval[4, 15] Interval [ 1, 15 ] + Interval[1, 10] union Interval[44, 50] null + Interval[1.0, 10.0] union Interval[4.0, 15.0] Interval [ 1.0, 15.0 ] + Interval[1.0, 10.0] union Interval[14.0, 15.0] null + Interval[1.0 'g', 10.0 'g'] union Interval[5.0 'g', 15.0 'g'] Interval [ 1.0 'g', 15.0 'g' ] + Interval[1.0 'g', 10.0 'g'] union Interval[14.0 'g', 15.0 'g'] null + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] union Interval[DateTime(2012, 1, 25), DateTime(2012, 1, 28)] Interval [ @2012-01-05T, @2012-01-28T ] + Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] union Interval[DateTime(2012, 1, 27), DateTime(2012, 1, 28)] null + Interval[@T05:59:59.999, @T15:59:59.999] union Interval[@T10:59:59.999, @T20:59:59.999] Interval [ @T05:59:59.999, @T20:59:59.999 ] + Interval[@T05:59:59.999, @T15:59:59.999] union Interval[@T16:59:59.999, @T20:59:59.999] null + + width of Interval[1, 10] 9 + width of (null as Interval<Any>) null + width of Interval[4.0, 15.0] 11.0 + width of Interval[5.0 'g', 10.0 'g'] 5.0'g' + width of Interval[DateTime(2012, 1, 5), DateTime(2012, 1, 25)] + width of Interval[@T05:59:59.999, @T15:59:59.999] + + Interval[1, 10] Interval[1, 10] + Interval[11, 20] Interval[11, 20] + Interval[44, 50] Interval[44, 50] + Interval[4, 10] Interval[4, 10] + Interval[4, 15] Interval[4, 15] + Interval[1.0, 10.0] Interval[1.0, 10.0] + Interval[11.0, 20.0] Interval[11.0, 20.0] + Interval[4.0, 10.0] Interval[4.0, 10.0] + Interval[4.0, 15.0] Interval[4.0, 15.0] + Interval[14.0, 15.0] Interval[14.0, 15.0] + Interval[1.0 'g', 10.0 'g'] Interval[1.0 'g', 10.0 'g'] + Interval[11.0 'g', 20.0 'g'] Interval[11.0 'g', 20.0 'g'] + Interval[5.0 'g', 10.0 'g'] Interval[5.0 'g', 10.0 'g'] + Interval[5.0 'g', 15.0 'g'] Interval[5.0 'g', 15.0 'g'] + Interval[14.0 'g', 15.0 'g'] Interval[14.0 'g', 15.0 'g'] + Interval[@2016-05-01T00:00:00.000, @2016-05-02T00:00:00.000] Interval[@2016-05-01T00:00:00.000, @2016-05-02T00:00:00.000] + Interval[@T00:00:00.000, @T23:59:59.599] Interval[@T00:00:00.000, @T23:59:59.599] + {Interval[1, 10], Interval[11, 20], Interval[44, 50]} {Interval[1, 10], Interval[11, 20], Interval[44, 50]} + Interval[5, 3] + Interval[5, 5) diff --git a/test/spec-tests/xml/CqlLogicalOperatorsTest.xml b/test/spec-tests/xml/CqlLogicalOperatorsTest.xml index 36062aa65..5b7137121 100644 --- a/test/spec-tests/xml/CqlLogicalOperatorsTest.xml +++ b/test/spec-tests/xml/CqlLogicalOperatorsTest.xml @@ -1,169 +1,214 @@ + + + true and true true + true and false false + true and null null + false and true false + false and false false + false and null false + null and true null + null and false false + null and null null + + true implies true true + true implies false false + true implies null null + false implies true true + false implies false true + false implies null true + null implies true true + null implies false null + null implies null null + + not true false + not false true + not null null + + true or true true + true or false true + true or null true + false or true true + false or false false + false or null null + null or true true + null or false null + null or null null + + true xor true false + true xor false true + true xor null null + false xor true true + false xor false false + false xor null null + null xor true null + null xor false null + null xor null null diff --git a/test/spec-tests/xml/CqlNullologicalOperatorsTest.xml b/test/spec-tests/xml/CqlNullologicalOperatorsTest.xml index 5af5c10d1..d3b89bc69 100644 --- a/test/spec-tests/xml/CqlNullologicalOperatorsTest.xml +++ b/test/spec-tests/xml/CqlNullologicalOperatorsTest.xml @@ -1,98 +1,125 @@ + + + Coalesce('a', null) 'a' + Coalesce(null, 'a') 'a' + Coalesce({}) null + Coalesce({'a', null, null}) 'a' + Coalesce({null, null, 'a'}) 'a' + Coalesce({'a'},null, null) {'a'} + Coalesce(null, null, {'a'}) {'a'} + Coalesce(null, null, DateTime(2012, 5, 18)) @2012-05-18T + Coalesce({ null, null, DateTime(2012, 5, 18) }) @2012-05-18T + Coalesce(null, null, @T05:15:33.556) @T05:15:33.556 + Coalesce({ null, null, @T05:15:33.556 }) @T05:15:33.556 + + IsNull(null) true + IsNull('') false + IsNull('abc') false + IsNull(1) false + IsNull(0) false + + IsFalse(false) true + IsFalse(true) false + IsFalse(null) false + + IsTrue(true) true + IsTrue(false) false + IsTrue(null) false diff --git a/test/spec-tests/xml/CqlQueryTests.xml b/test/spec-tests/xml/CqlQueryTests.xml index 43e738ea4..c7ce16750 100644 --- a/test/spec-tests/xml/CqlQueryTests.xml +++ b/test/spec-tests/xml/CqlQueryTests.xml @@ -1,56 +1,72 @@ + + + (4) l 4 + (4) l return 'Hello World' 'Hello World' + from ({2, 3}) A, ({5, 6}) B {{ A: 2, B: 5 }, { A: 2, B: 6 }, { A: 3, B: 5 }, { A: 3, B: 6 }} + + ({1, 2, 3}) l sort desc {3, 2, 1} + ({1, 3, 2}) l sort ascending {1, 2, 3} + ({@2013-01-02T00:00:00.000Z, @2014-01-02T00:00:00.000Z, @2015-01-02T00:00:00.000Z}) l sort desc {@2015-01-02T00:00:00.000Z, @2014-01-02T00:00:00.000Z, @2013-01-02T00:00:00.000Z} + ({@2013-01-02T00:00:00.000Z, @2015-01-02T00:00:00.000Z, @2014-01-02T00:00:00.000Z}) l sort ascending {@2013-01-02T00:00:00.000Z, @2014-01-02T00:00:00.000Z, @2015-01-02T00:00:00.000Z} + + ({1, 2, 3, 3, 4}) L aggregate A starting 1: A * L 72 + ({1, 2, 3, 3, 4}) L aggregate all A starting 1: A * L 72 + ({1, 2, 3, 3, 4}) L aggregate distinct A starting 1: A * L 24 + ({1, 2, 3}) L aggregate A : A * L null + from ({1, 2, 3}) B, (4) C aggregate A : A + B + C null diff --git a/test/spec-tests/xml/CqlStringOperatorsTest.xml b/test/spec-tests/xml/CqlStringOperatorsTest.xml index 007789f96..e1836aaa8 100644 --- a/test/spec-tests/xml/CqlStringOperatorsTest.xml +++ b/test/spec-tests/xml/CqlStringOperatorsTest.xml @@ -1,359 +1,461 @@ + + + Combine(null) null + Combine({}) null + Combine({'a', 'b', 'c'}) 'abc' + Combine({'a', 'b', 'c'}, '-') 'a-b-c' + + Concatenate(null, null) null + Concatenate('a', null) null + Concatenate(null, 'b') null + Concatenate('a', 'b') 'ab' + 'a' + 'b' 'ab' + + EndsWith(null, null) null + EndsWith('Chris Schuler is the man!!', 'n!!') true + EndsWith('Chris Schuler is the man!!', 'n!') false + + Indexer(null as String, null) null + Indexer('a', null) null + Indexer(null as String, 1) null + Indexer('ab', 0) 'a' + Indexer('ab', 1) 'b' + Indexer('ab', 2) null + Indexer('ab', -1) null + + LastPositionOf(null, null) null + LastPositionOf(null, 'hi') null + LastPositionOf('hi', null) null + LastPositionOf('hi', 'Ohio is the place to be!') 1 + LastPositionOf('hi', 'Say hi to Ohio!') 11 + + Length(null as String) null + Length('') 0 + Length('a') 1 + Length('ab') 2 + + Lower(null) null + Lower('') '' + Lower('A') 'a' + Lower('b') 'b' + Lower('Ab') 'ab' + + Matches('Not all who wander are lost', null) null + Matches('Not all who wander are lost', '.*\\d+') false + Matches('Not all who wander are lost - circa 2017', '.*\\d+') true + Matches('Not all who wander are lost', '.*') true + Matches('Not all who wander are lost', '[\\w|\\s]+') true + Matches('Not all who wander are lost - circa 2017', '^[\\w\\s]+$') false + Matches(' ', '\\W+') true + Matches(' \n\t', '\\s+') true + + PositionOf(null, null) null + PositionOf('a', null) null + PositionOf(null, 'a') null + PositionOf('a', 'ab') 0 + PositionOf('b', 'ab') 1 + PositionOf('c', 'ab') -1 + + ReplaceMatches('Not all who wander are lost', null, 'But I am...') null + ReplaceMatches('Not all who wander are lost', 'Not all who wander are lost', 'But still waters run deep') 'But still waters run deep' + ReplaceMatches('Who put the bop in the bop she bop she bop?', 'bop', 'bang') 'Who put the bang in the bang she bang she bang?' + ReplaceMatches('All that glitters is not gold', '\\s', '\\$') 'All$that$glitters$is$not$gold' + + Split(null, null) null + Split(null, ',') null + Split('a,b', null) {'a,b'} + Split('a,b', '-') {'a,b'} + Split('a,b', ',') {'a','b'} + + StartsWith(null, null) null + StartsWith('hi', null) null + StartsWith(null, 'hi') null + StartsWith('Breathe deep the gathering gloom', 'Bre') true + StartsWith('Breathe deep the gathering gloom', 'bre') false + + Substring(null, null) null + Substring('a', null) null + Substring(null, 1) null + Substring('ab', 0) 'ab' + Substring('ab', 1) 'b' + Substring('ab', 2) null + Substring('ab', -1) null + + + Substring('', 0) + '' + + Substring('ab', 0, 1) 'a' + Substring('abc', 1, 1) 'b' + Substring('ab', 0, 3) 'ab' + + Upper(null) null + Upper('') '' + Upper('a') 'A' + Upper('B') 'B' + Upper('aB') 'AB' + + ToString(125 'cm') '125 \'cm\'' + ToString(DateTime(2000, 1, 1)) '2000-01-01' + ToString(DateTime(2000, 1, 1, 15, 25, 25, 300)) '2000-01-01T15:25:25.300' + ToString(DateTime(2000, 1, 1, 8, 25, 25, 300, -7)) '2000-01-01T08:25:25.300-07:00' + ToString(@T09:30:01.003) '09:30:01.003' diff --git a/test/spec-tests/xml/CqlTypeOperatorsTest.xml b/test/spec-tests/xml/CqlTypeOperatorsTest.xml index e5f1d91a2..64bff2354 100644 --- a/test/spec-tests/xml/CqlTypeOperatorsTest.xml +++ b/test/spec-tests/xml/CqlTypeOperatorsTest.xml @@ -1,69 +1,89 @@ + + + 45.5 'g' as Quantity 45.5 'g' + cast 45.5 'g' as Quantity 45.5 'g' + DateTime(2014, 01, 01) as DateTime @2014-01-01T + + convert 5 to Decimal 5.0 + convert 5 to String '5' + convert 'foo' to Integer null + convert '2014-01-01' to DateTime @2014-01-01T + convert 'T14:30:00.0' to Time @T14:30:00.000 + convert '2014/01/01' to DateTime null + + 5 is Integer true + '5' is Integer false + System.ValueSet{id: '123'} is Vocabulary true This should return true because ValueSet is derived from Vocabulary. + + ToBoolean('NO') false + + ToConcept(Code { code: '8480-6' }) Concept { @@ -73,97 +93,124 @@ + + ToDateTime('2014-01-01') @2014-01-01T + ToDateTime('2014-01-01T12:05') @2014-01-01T12:05 + ToDateTime('2014-01-01T12:05:05.955') @2014-01-01T12:05:05.955 + ToDateTime('2014-01-01T12:05:05.955+01:30') @2014-01-01T12:05:05.955+01:30 + ToDateTime('2014-01-01T12:05:05.955-01:15') @2014-01-01T12:05:05.955-01:15 + ToDateTime('2014-01-01T12:05:05.955Z') @2014-01-01T12:05:05.955+00:00 + ToDateTime('2014/01/01T12:05:05.955Z') null + ToDateTime(@2014-01-01) @2014-01-01T + hour from ToDateTime(@2014-01-01) is null true + + ToDecimal('+25.5') 25.5 + + ToInteger('-25') -25 + + ToQuantity('5.5 \'cm\'') 5.5'cm' + + ToString(-5) '-5' + ToString(18.55) '18.55' + ToString(5.5 'cm') '5.5 \'cm\'' + ToString(true) 'true' + + ToTime('T14:30:00.0') @T14:30:00.000 + ToTime('T14:30:00.0+05:30') @T14:30:00.000 + ToTime('T14:30:00.0-05:45') @T14:30:00.000 + ToTime('T14:30:00.0Z') @T14:30:00.000 + ToTime('T14-30-00.0') null diff --git a/test/spec-tests/xml/CqlTypesTest.xml b/test/spec-tests/xml/CqlTypesTest.xml index 639776ae6..53df4b8f1 100644 --- a/test/spec-tests/xml/CqlTypesTest.xml +++ b/test/spec-tests/xml/CqlTypesTest.xml @@ -3,6 +3,7 @@ name="CqlTypesTest" reference="https://cql.hl7.org/09-b-cqlreference.html#types-2" version="1.0"> + + 5.0 'g' 5.0'g' + DateTime(2012, 4, 4) @2012-04-04T + @T09:00:00.000 @T09:00:00.000 + Interval[2, 7] Interval[2, 7] + {1, 2, 3} {1, 2, 3} + Tuple { id: 5, name: 'Chris'} Tuple { id: 5, name: 'Chris'} + Tuple { id: 5, name: 'Chris'}.name 'Chris' + + + DateTime(null) null + DateTime(10000, 12, 31, 23, 59, 59, 999) + DateTime(0000, 1, 1, 0, 0, 0, 0) + DateTime(2016, 7, 7, 6, 25, 33, 910) @2016-07-07T06:25:33.910 + DateTime(2015, 2, 10) @2015-02-10T + days between DateTime(2015, 2, 10) and DateTime(2015, 3) Interval [ 18, 49 ] + DateTime(0001, 1, 1, 0, 0, 0, 0) @0001-01-01T00:00:00.000 + DateTime(9999, 12, 31, 23, 59, 59, 999) @9999-12-31T23:59:59.999 + hour from @2015-02-10T is null true + + + + + 150.2 '[lb_av]' 150.2 '[lb_av]' - 2.5589 '{eskimo kisses}' - 2.5589 '{eskimo kisses}' + + 2.5589 '{eskimo_kisses}' + 2.5589 '{eskimo_kisses}' + 5.999999999 'g' 5.999999999 'g' + + '\'I start with a single quote and end with a double quote\"' '\u0027I start with a single quote and end with a double quote\u0022' + '\u0048\u0069' 'Hi' + + @T24:59:59.999 + @T23:60:59.999 + @T23:59:60.999 - - @T23:59:59.10000 - + + + @T23:59:59.10000 + @T23:59:59.100 + + @T10:25:12.863 @T10:25:12.863 + @T23:59:59.999 @T23:59:59.999 + @T00:00:00.000 @T00:00:00.000 diff --git a/test/spec-tests/xml/ValueLiteralsAndSelectors.xml b/test/spec-tests/xml/ValueLiteralsAndSelectors.xml index 35dd55f89..8317b89d4 100644 --- a/test/spec-tests/xml/ValueLiteralsAndSelectors.xml +++ b/test/spec-tests/xml/ValueLiteralsAndSelectors.xml @@ -1,10 +1,13 @@ + + + null null @@ -14,11 +17,14 @@ + + false false + true true @@ -28,92 +34,114 @@ + + 0 0 + +0 0 + -0 0 + 1 1 + +1 1 + -1 -1 + 2 2 + +2 2 + -2 -2 + Power(10,9) 1000000000 + +Power(10,9) 1000000000 + -Power(10,9) -1000000000 + Power(2,30)-1+Power(2,30) 2147483647 + +Power(2,30)-1+Power(2,30) 2147483647 + -Power(2,30)+1-Power(2,30) -2147483647 + 2147483648 + +2147483648 + -Power(2,30)-Power(2,30) -2147483648 + 2147483649 + +2147483649 + -2147483649 @@ -124,179 +152,222 @@ + + 0.0 0.0 + +0.0 0.0 + -0.0 0.0 + 1.0 1.0 + +1.0 1.0 + -1.0 -1.0 + 2.0 2.0 + +2.0 2.0 + -2.0 -2.0 + Power(10.0,9.0) 1000000000.0 + +Power(10.0,9.0) 1000000000.0 + -Power(10.0,9.0) -1000000000.0 + Power(2.0,30.0)-1+Power(2.0,30.0) 2147483647.0 + +Power(2.0,30.0)-1+Power(2.0,30.0) 2147483647.0 + -Power(2.0,30.0)+1.0-Power(2.0,30.0) -2147483647.0 + Power(2.0,30.0)+Power(2.0,30.0) 2147483648.0 + +Power(2.0,30.0)+Power(2.0,30.0) 2147483648.0 + -Power(2.0,30.0)-Power(2.0,30.0) -2147483648.0 + Power(2.0,30.0)+1.0+Power(2.0,30.0) 2147483649.0 + +Power(2.0,30.0)+1.0+Power(2.0,30.0) 2147483649.0 + -Power(2.0,30.0)-1.0-Power(2.0,30.0) -2147483649.0 + 0.00000000 0.00000000 + +0.00000000 0.00000000 + -0.00000000 0.00000000 + Power(10,-8) 0.00000001 + +Power(10,-8) 0.00000001 + -Power(10,-8) -0.00000001 + 2.0*Power(10,-8) 0.00000002 + +2.0*Power(10,-8) 0.00000002 + -2.0*Power(10,-8) -0.00000002 + Power(10,-7) 0.0000001 + +Power(10,-7) 0.0000001 + -Power(10,-7) -0.0000001 + 0.000000001 + +0.000000001 + -0.000000001 + 10*1000000000000000000000000000.00000000-0.00000001 9999999999999999999999999999.99999999 + +10*1000000000000000000000000000.00000000-0.00000001 9999999999999999999999999999.99999999 + -10*1000000000000000000000000000.00000000+0.00000001 -9999999999999999999999999999.99999999 + 10000000000000000000000000000.00000000 + +10000000000000000000000000000.00000000 + -10000000000000000000000000000.00000000 @@ -307,6 +378,7 @@ + @@ -315,6 +387,7 @@ + @@ -323,30 +396,38 @@ + + + + + + + + From bb8ac72c6f980c45eb4152a7161378d1d34d5cea Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 8 Sep 2026 14:09:23 -0400 Subject: [PATCH 21/62] Use Decimal equals in DateTime.isUTC --- src/datatypes/datetime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datatypes/datetime.ts b/src/datatypes/datetime.ts index 5b30779cb..096f5ad29 100644 --- a/src/datatypes/datetime.ts +++ b/src/datatypes/datetime.ts @@ -829,7 +829,7 @@ export class DateTime extends AbstractDate { isUTC() { // A timezoneOffset of 0 indicates UTC time. - return !this.timezoneOffset; + return this.timezoneOffset?.equals(0); } getPrecision() { From ffa7d8fb000bd34d9786c799c225df58235e821c Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 8 Sep 2026 14:11:25 -0400 Subject: [PATCH 22/62] Add scale field and support to Decimal class --- src/datatypes/decimal.ts | 190 ++++++++++++++++++++++++++++++--------- 1 file changed, 150 insertions(+), 40 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 3a04017c5..fb546ca39 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -11,19 +11,30 @@ export type DecimalInput = Decimal | string | number | bigint; export type DecimalRoundingMode = DecimalJS.Rounding; -const MIN_PRECISION_VALUE = CQLDecimalJS.pow(10, -8); - const CQL_IMPLICIT_SCALE = 8; const CQL_IMPLICIT_ROUNDING = CQLDecimalJS.ROUND_HALF_UP; +const TRUNCATE_TO_PRECISION = CQLDecimalJS.ROUND_DOWN; export class Decimal { - private value: DecimalJS; + private readonly value: DecimalJS; + public readonly scale: number; - private constructor(value: string | number | bigint | DecimalJS) { + private constructor(value: string | number | bigint | DecimalJS, scale?: number) { this.value = new CQLDecimalJS(value); if (!this.value.isFinite()) { throw new Error('Cannot create a decimal with a non-finite value'); } + + if (scale == null) { + scale = determineScale(value, this.value); + } else if (!Number.isInteger(scale) || scale < 0) { + throw new RangeError('Decimal scale must be a non-negative integer'); + } else if (scale < this.value.decimalPlaces()) { + // scale and value both provided, but the value has more decimal places, + // so apply the scale to the value to ensure internal consistency + this.value = this.value.toDecimalPlaces(scale, CQL_IMPLICIT_ROUNDING); + } + this.scale = scale; } static from(value: DecimalInput) { @@ -39,37 +50,82 @@ export class Decimal { } normalized() { - if (this.value.decimalPlaces() <= CQL_IMPLICIT_SCALE) { + if (this.scale <= CQL_IMPLICIT_SCALE) { return this; } - return this.setScale(CQL_IMPLICIT_SCALE, CQL_IMPLICIT_ROUNDING); + return this.withScale(CQL_IMPLICIT_SCALE); } // Helper function to reduce repeated boilerplate. // Apply the given function with the given operand, and wrap the result in a Decimal. - private applyWrapper(operation: (value: any) => DecimalJS, other: DecimalInput): Decimal { - const operand = other instanceof Decimal ? other.value : other; - - return new Decimal(operation.call(this.value, operand)); + // A function to set an appropriate scale based on the scales of the inputs may also be provided. + private applyWrapper( + operation: (value: DecimalJS) => DecimalJS, + other: DecimalInput, + scaleLogic?: (scaleL: number, scaleR: number) => number + ): Decimal { + const decimalOther = Decimal.from(other); + + const unscaledResult = new Decimal(operation.call(this.value, decimalOther.value)); + + if (scaleLogic) { + const targetScale = scaleLogic.call(null, this.scale, decimalOther.scale); + return unscaledResult.withScale(targetScale); + } + return unscaledResult; } add(other: DecimalInput): Decimal { - return this.applyWrapper(this.value.add, other); + // scale logic: max(scale(left), scale(right)) + return this.applyWrapper(this.value.add, other, Math.max); } subtract(other: DecimalInput): Decimal { - return this.applyWrapper(this.value.minus, other); + // scale logic: max(scale(left), scale(right)) + return this.applyWrapper(this.value.minus, other, Math.max); } multiplyBy(other: DecimalInput): Decimal { - return this.applyWrapper(this.value.times, other); + const scaleLogic = (l: number, r: number) => Math.min(l + r, CQL_IMPLICIT_SCALE); + return this.applyWrapper(this.value.times, other, scaleLogic); } divideBy(other: DecimalInput): Decimal { - if (Decimal.from(other).equals(0)) { + const decimalOther = Decimal.from(other); + if (decimalOther.equals(0)) { throw new RangeError('Cannot divide a decimal by zero'); } - return this.applyWrapper(this.value.dividedBy, other); + // division scaling is more complex, depends on whether the actual result can be represented exactly + const unscaledResult = this.applyWrapper(this.value.dividedBy, decimalOther); + const unscaledDecimalPlaces = unscaledResult.value.decimalPlaces(); + if (unscaledDecimalPlaces > CQL_IMPLICIT_SCALE) { + // it either doesn't terminate, or terminates with more than 8 digits, eg: + // 1/3 = 0.33333333... + // 1/512 = 0.001953125 (9 digits) + return unscaledResult.withScale(CQL_IMPLICIT_SCALE); + } + + // multiplication uses min(scale(l) + scale(r), cql_max_scale) + // division is the inverse of multiplication, so we'll define a lower bound "preferred scale" as the inverse: + // max(scale(l)-scale(r), 0) + const preferredScale = Math.max(this.scale - decimalOther.scale, 0); + + // examples: + // | | Preferred | Expected | + // | Expression | scale | result | + // | ------------- | --------: | ---------: | + // | 4.0 / 2 | 1 | 2.0 | + // | 9.9 / 3.0 | 0 | 3.3 | + // | 1.0 / 2.0 | 0 | 0.5 | + // | 1.0 / 4.0 | 0 | 0.25 | + // | 1.0 / 8.0 | 0 | 0.125 | + // | 1.0 / 3.0 | 0 | 0.33333333 | + // | 2.0 / 3.0 | 0 | 0.66666667 | + // | 1.00000 / 2.0 | 4 | 0.5000 | + // | 1.0 / 1.00000 | 0 | 1 | (as Decimal, scale 0) + // | 1.00000 / 1.0 | 4 | 1.0000 | + + return unscaledResult.withMinimumScale(preferredScale); } modulo(other: DecimalInput) { @@ -106,32 +162,59 @@ export class Decimal { return this.compareTo(other) === 0; } + equivalent(other: DecimalInput) { + // For decimals, equivalent means the values are the same + // with the comparison done on values rounded to + // the precision of the least precise operand; + // trailing zeroes after the decimal are ignored in determining precision + // for equivalent comparison. + + // Because it ignores trailing zeros, we use decimal.js .decimalPlaces() instead of this.scale + const decimalOther = Decimal.from(other); + const lessPreciseScale = Math.min( + this.value.decimalPlaces(), + decimalOther.value.decimalPlaces() + ); + + return this.withScale(lessPreciseScale).equals(decimalOther.withScale(lessPreciseScale)); + } + successor() { - // TODO: successor should be based on current precision - // For Decimal, successor is equivalent to adding 1 * the precision of the argument. - return new Decimal(this.value.add(MIN_PRECISION_VALUE)); + // "For Decimal, successor is equivalent to adding 1 * the precision of the argument." + // note that this is not 1 * Precision(this), since Precision is a number 0-8 + const precision = Decimal.from(0.1).power(this.scale); + return this.add(precision); } predecessor() { - // TODO: predecessor should be based on current precision - // For Decimal, predecessor is equivalent to subtracting 1 * the precision of the argument. - return new Decimal(this.value.minus(MIN_PRECISION_VALUE)); + // "For Decimal, predecessor is equivalent to subtracting 1 * the precision of the argument." + // note that this is not literally 1 * Precision(this), since Precision is a number 0-8 + const precision = Decimal.from(0.1).power(this.scale); + return this.subtract(precision); } negate() { - return new Decimal(this.value.neg()); + return new Decimal(this.value.neg(), this.scale); } abs() { - return new Decimal(this.value.abs()); + return new Decimal(this.value.abs(), this.scale); } truncate(): number { return this.value.truncated().toNumber(); } - truncated(): Decimal { - return new Decimal(this.value.truncated()); + truncated(scale?: number): Decimal { + // specifying a scale here allows for "truncating to a precision" + // this is currently used in Interval.expand + + if (!scale) { + // undefined or 0 both mean truncated to an integer + return new Decimal(this.truncate(), 0); + } + + return this.withScale(scale, TRUNCATE_TO_PRECISION); } ceil(): number { @@ -151,7 +234,7 @@ export class Decimal { } sqrt() { - return new Decimal(this.value.sqrt()); + return new Decimal(this.value.sqrt()).withMinimumScale(this.scale); } ln() { @@ -163,7 +246,7 @@ export class Decimal { } log(base: DecimalInput) { - return this.applyWrapper(this.value.log, base); + return this.applyWrapper(this.value.log, base).withMinimumScale(this.scale); } round(scale: number) { @@ -173,29 +256,33 @@ export class Decimal { // ROUND_HALF_CEIL "Rounds towards nearest neighbour. If equidistant, rounds towards Infinity" // rounds 0.5 -> 1.0, -0.5 -> 0.0 // https://mikemcl.github.io/decimal.js/#modes - return this.setScale(scale, CQLDecimalJS.ROUND_HALF_CEIL); + return this.withScale(scale, CQL_IMPLICIT_ROUNDING); } - setScale(scale: number, roundingMode: DecimalRoundingMode = CQLDecimalJS.ROUND_DOWN) { + withScale(scale: number, roundingMode: DecimalRoundingMode = CQL_IMPLICIT_ROUNDING) { if (!Number.isInteger(scale) || scale < 0) { throw new RangeError('Decimal scale must be a non-negative integer'); } - return new Decimal(this.value.toDecimalPlaces(scale, roundingMode)); + return new Decimal(this.value.toDecimalPlaces(scale, roundingMode), scale); } - toInteger() { - // note that this is permissive and converts non-integral values - return this.truncate(); + // Some functions would prefer a given scale for the result but will allow a greater one + // if needed to represent the value. + // Eg, 1.0 / 1.0 and 1.0 / 3.0 both have exactly the same input scales, but expect different output scales. + withMinimumScale(scale: number, roundingMode: DecimalRoundingMode = CQL_IMPLICIT_ROUNDING) { + if (this.scale > scale) { + return this; + } + return this.withScale(scale, roundingMode); } - toNumber() { - return this.value.toNumber(); + withoutTrailingZeros() { + return this.withScale(this.value.decimalPlaces()); } - toLong() { - // note that this is permissive and converts non-integral values - return BigInt(this.value.truncated().toString()); + toNumber() { + return this.value.toNumber(); } toString() { @@ -207,12 +294,35 @@ export class Decimal { // (# means any number of digits, including none; 0 means a digit must appear) // a regex for this is -?\d+\.\d+ // so Decimal.from(1).toString() --> "1.0" - const places = Math.max(1, this.value.decimalPlaces()); + const places = Math.max(1, this.scale); return this.value.toFixed(places); } toJSON() { - return this.toString(); + // The FHIR spec serializes `decimal` as a number, so we follow that convention here, + // but note the risk of loss of precision. + // https://hl7.org/fhir/json.html#primitive + return this.toNumber(); + } +} + +function determineScale(rawValue: string | number | bigint | DecimalJS, parsedValue?: DecimalJS) { + // decimal.js doesn't retain trailing zeros, + // so if provided a string we have to count the decimal places + if (typeof rawValue === 'string') { + const dpIndex = rawValue.indexOf('.'); + if (dpIndex >= 0) { + return rawValue.length - dpIndex - 1; + // note this may be larger than our max scale; handle that in calling functions if necessary + } else { + return 0; // No decimal point found + } + } else { + // If not a string, fall back to parsing by decimal.js and use its decimalPlaces function + if (!parsedValue) { + parsedValue = new DecimalJS(rawValue); + } + return parsedValue.decimalPlaces(); } } From 5c570a02ea3c7ac0bea6d4a512cb35ad3ddf9897 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:10:35 -0400 Subject: [PATCH 23/62] remove resultTypeName from generic number math --- src/elm/arithmetic.ts | 4 ++-- src/util/math.ts | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index ffff1a73f..cc8a5935a 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -43,7 +43,7 @@ export class Add extends Expression { return null; } - const sum = MathUtil.add(args[0], args[1], this.resultTypeName); + const sum = MathUtil.add(args[0], args[1]); return finalizeArithmeticResult(sum); } } @@ -59,7 +59,7 @@ export class Subtract extends Expression { return null; } - const difference = MathUtil.subtract(args[0], args[1], this.resultTypeName); + const difference = MathUtil.subtract(args[0], args[1]); return finalizeArithmeticResult(difference); } } diff --git a/src/util/math.ts b/src/util/math.ts index 48d913c00..487393751 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -110,7 +110,7 @@ export function isValidDecimal(decimal: any) { return true; } -export function add(a: any, b: any, type?: string): any { +export function add(a: any, b: any): any { if (a == null || b == null) { return null; } @@ -119,16 +119,16 @@ export function add(a: any, b: any, type?: string): any { const aHigh = a?.isUncertainty ? a.high : a; const bLow = b?.isUncertainty ? b.low : b; const bHigh = b?.isUncertainty ? b.high : b; - const low = add(aLow, bLow, type); - const high = add(aHigh, bHigh, type); + const low = add(aLow, bLow); + const high = add(aHigh, bHigh); return low == null || high == null ? null : new Uncertainty(low, high); } - if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { + if (a.isDecimal || b.isDecimal) { const sum = Decimal.from(a).add(Decimal.from(b)); return overflowsOrUnderflows(sum) ? null : sum; } - if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + if (typeof a === 'bigint' || typeof b === 'bigint') { const sum = BigInt(a) + BigInt(b); return overflowsOrUnderflows(sum) ? null : sum; } @@ -158,7 +158,7 @@ export function add(a: any, b: any, type?: string): any { throw new Error('Unsupported argument types.'); } -export function subtract(a: any, b: any, type?: string): any { +export function subtract(a: any, b: any): any { if (a == null || b == null) { return null; } @@ -167,30 +167,30 @@ export function subtract(a: any, b: any, type?: string): any { const aHigh = a?.isUncertainty ? a.high : a; const bLow = b?.isUncertainty ? b.low : b; const bHigh = b?.isUncertainty ? b.high : b; - const low = subtract(aLow, bHigh, type); - const high = subtract(aHigh, bLow, type); + const low = subtract(aLow, bHigh); + const high = subtract(aHigh, bLow); return low == null || high == null ? null : new Uncertainty(low, high); } if (typeof b === 'number' || typeof b === 'bigint') { - return add(a, -b, type); + return add(a, -b); } if (b?.isDecimal) { - return add(a, (b as Decimal).negate(), type); + return add(a, (b as Decimal).negate()); } if (b?.isQuantity) { // Note - this path uses a fake Quantity object to defer validation of the unit - return add(a, { isQuantity: true, value: b.value.negate(), unit: b.unit }, type); + return add(a, { isQuantity: true, value: b.value.negate(), unit: b.unit }); } throw new Error('Unsupported argument types.'); } -export function multiply(a: any, b: any, type?: string) { - if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { +export function multiply(a: any, b: any) { + if (a.isDecimal || b.isDecimal) { const product = Decimal.from(a).multiplyBy(b); return overflowsOrUnderflows(product) ? null : product; } - if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + if (typeof a === 'bigint' || typeof b === 'bigint') { const product = BigInt(a) * BigInt(b); return overflowsOrUnderflows(product) ? null : product; } @@ -202,8 +202,8 @@ export function multiply(a: any, b: any, type?: string) { throw new Error('Unsupported argument types.'); } -export function divide(a: any, b: any, type?: string) { - if (a.isDecimal || b.isDecimal || type === ELM_DECIMAL_TYPE) { +export function divide(a: any, b: any) { + if (a.isDecimal || b.isDecimal) { b = Decimal.from(b); if (b.equals(0)) { return null; @@ -211,7 +211,7 @@ export function divide(a: any, b: any, type?: string) { const quotient = Decimal.from(a).divideBy(b); return overflowsOrUnderflows(quotient) ? null : quotient; } - if (typeof a === 'bigint' || typeof b === 'bigint' || type === ELM_LONG_TYPE) { + if (typeof a === 'bigint' || typeof b === 'bigint') { if (b === 0 || b === 0n) { return null; } From 42b6246925111fa80f6c9cbf648489897f5f501f Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:11:13 -0400 Subject: [PATCH 24/62] reintroduce numeric integer check --- src/runtime/context.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/context.ts b/src/runtime/context.ts index 84ec265a0..d72ba99f5 100644 --- a/src/runtime/context.ts +++ b/src/runtime/context.ts @@ -343,7 +343,7 @@ export class Context { case ELM_DECIMAL_TYPE: return val && val.isDecimal; case ELM_INTEGER_TYPE: - return typeof val === 'number'; + return typeof val === 'number' && Number.isInteger(val); case ELM_LONG_TYPE: return typeof val === 'bigint'; case ELM_STRING_TYPE: @@ -390,7 +390,7 @@ export class Context { } else if (inst.isDecimalLiteral) { return val && val.isDecimal; } else if (inst.isIntegerLiteral) { - return typeof val === 'number'; + return typeof val === 'number' && Number.isInteger(val); } else if (inst.isLongLiteral) { return typeof val === 'bigint'; } else if (inst.isStringLiteral) { From 2965dc1feed148c48244fc5a1da737659b33cb94 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:12:17 -0400 Subject: [PATCH 25/62] Remove conversions that aren't supported in ELM, and clarify Decimal.ToString --- src/elm/type.ts | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/elm/type.ts b/src/elm/type.ts index e7184691d..ae95006b6 100644 --- a/src/elm/type.ts +++ b/src/elm/type.ts @@ -96,15 +96,10 @@ export class ToBoolean extends Expression { async exec(ctx: Context) { const arg = await this.execArgs(ctx); if (arg != null) { - if (typeof arg === 'boolean') { - return arg; - } else if (typeof arg === 'number' || typeof arg === 'bigint') { - if (arg == 1) { - return true; - } else if (arg == 0) { - return false; - } - } else if (arg instanceof Decimal) { + if (arg instanceof Decimal) { + // Unlike other types, Decimal.toString doesn't line up + // with the defined truthy/falsy values below. + // Check numeric equality (ignores scale) for the two values that map to boolean if (arg.equals('1.0')) { return true; } else if (arg.equals('0.0')) { @@ -230,11 +225,6 @@ export class ToInteger extends Expression { if (isValidInteger(integer)) { return integer; } - } else if (arg && arg.isDecimal) { - const integer = (arg as Decimal).toInteger(); - if (isValidInteger(integer)) { - return integer; - } } else if (typeof arg === 'string') { // check for blank string because Number('') and Number(' ') evaluate to 0. if (arg.trim().length === 0) { @@ -272,11 +262,6 @@ export class ToLong extends Expression { } catch { return null; } - } else if (arg && arg.isDecimal) { - const long = (arg as Decimal).toLong(); - if (isValidLong(long)) { - return long; - } } else if (typeof arg === 'string') { // check string format because BigInt throws for invalid strings if (!/^[+-]?\d+$/.test(arg)) { From e98761616302128f6255fde296b46367867375f5 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:12:55 -0400 Subject: [PATCH 26/62] use Decimal comparison methods for uncertainty boundaries --- src/datatypes/uncertainty.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/datatypes/uncertainty.ts b/src/datatypes/uncertainty.ts index 8a089e217..0264d08e9 100644 --- a/src/datatypes/uncertainty.ts +++ b/src/datatypes/uncertainty.ts @@ -22,6 +22,9 @@ export class Uncertainty { } if (typeof a.after === 'function') { return a.after(b); + } + if (typeof a.greaterThan === 'function') { + return a.greaterThan(b); } else { return a > b; } @@ -66,6 +69,8 @@ export class Uncertainty { if (typeof a.sameOrBefore === 'function') { return a.sameOrBefore(b); + } else if (typeof a.lessThanOrEquals === 'function') { + return a.lessThanOrEquals(b); } else { return a <= b; } @@ -75,8 +80,10 @@ export class Uncertainty { return null; } - if (typeof a.sameOrBefore === 'function') { + if (typeof a.sameOrAfter === 'function') { return a.sameOrAfter(b); + } else if (typeof a.greaterThanOrEquals === 'function') { + return a.greaterThanOrEquals(b); } else { return a >= b; } @@ -143,7 +150,7 @@ export class Uncertainty { if (typeof a.before === 'function') { return a.before(b, precision); - } else if (a.isDecimal) { + } else if (typeof a.lessThan === 'function') { return a.lessThan(b); } else { return a < b; From bd9772b1191fc2260d6c220efa5a1ddc46931226 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:19:24 -0400 Subject: [PATCH 27/62] update UCUM conversion logic to handle special cases and decimal scale --- src/types/ucum-lhc.d.ts | 11 +++- src/util/units.ts | 49 +++++++++++++++-- test/elm/convert/convert-test.ts | 4 ++ test/elm/convert/data.cql | 1 + test/elm/convert/data.js | 94 +++++++++++++++++++++++++++----- 5 files changed, 140 insertions(+), 19 deletions(-) diff --git a/src/types/ucum-lhc.d.ts b/src/types/ucum-lhc.d.ts index 15445e0f6..47c4f1db5 100644 --- a/src/types/ucum-lhc.d.ts +++ b/src/types/ucum-lhc.d.ts @@ -30,17 +30,26 @@ declare module '@lhncbc/ucum-lhc' { export interface ConversionResponse { status: 'succeeded' | 'failed' | 'error'; - toVal: string; + toVal: number; msg: string[]; suggestions?: ConversionSuggestion[]; fromUnit: Unit; toUnit: Unit; } + export interface BaseUnitConversionResponse { + status: 'succeeded' | 'invalid' | 'failed' | 'error'; + msg: string[]; + magnitude: number; + fromUnitIsSpecial?: boolean; + unitToExp: object; // a map of base units in fromUnit to their exponent + } + export class UcumLhcUtils { static getInstance(): UcumLhcUtils; validateUnitString(uStr: string, suggest?: boolean, valConv?: string): ValidationResponse; convertUnitTo(fromUnitCode: string, fromVal: number, toUnitCode: string): ConversionResponse; commensurablesList(fromName: string): [Unit[] | null, string[]]; + convertToBaseUnits(fromUnit: string, fromVal: number): BaseUnitConversionResponse; } } diff --git a/src/util/units.ts b/src/util/units.ts index 20abc8435..0a539c194 100644 --- a/src/util/units.ts +++ b/src/util/units.ts @@ -73,15 +73,54 @@ export function convertUnit(fromVal: Decimal, fromUnit: any, toUnit: any) { return fromVal; } // IMPORTANT: the UCUM library operates on raw JS numbers, not our Decimal - // this means that extremely large or extremely small numbers would lose precision via this function. + // this means that extremely large or extremely small numbers could lose precision via this function. // To prevent this, instead of converting fromVal directly, convert 1 unit to get the conversion factor, // and manually multiply the fromVal by it. - const result = utils.convertUnitTo(fromUnit, 1, toUnit); - if (result.status !== 'succeeded') { + // First though, make sure the units can be safely converted by simple scalar factor. + // Units that cannot because they require a special function, such as C <--> F, + // fall back to calling the UCUM library directly. + + const testFrom = utils.convertToBaseUnits(fromUnit, 1); + const testTo = utils.convertToBaseUnits(toUnit, 1); + + if (testFrom.status !== 'succeeded' || testTo.status !== 'succeeded') { return; } - const conversionFactor = result.toVal; - return fromVal.multiplyBy(conversionFactor).normalized(); + + let rawResult: Decimal; + if (testFrom.fromUnitIsSpecial === false && testTo.fromUnitIsSpecial === false) { + // try both directions to see if one is more exact, + // eg, days to weeks is * 0.142857... but weeks to days is * 7, so days to weeks could be / 7 instead + const fromToTo = utils.convertUnitTo(fromUnit, 1, toUnit); + const toToFrom = utils.convertUnitTo(toUnit, 1, fromUnit); + if (fromToTo.status !== 'succeeded' || toToFrom.status !== 'succeeded') { + return; + } + + const multFactor = fromToTo.toVal; + const divFactor = toToFrom.toVal; + // NOTE: conversion factor is a JS number and can itself be imprecise, eg, inches to m is 0.025400000000000002 + if (Number.isInteger(divFactor)) { + rawResult = fromVal.divideBy(divFactor); + } else { + // We could consider more heuristics here, but for now just fall back to the multiplication factor + rawResult = fromVal.multiplyBy(multFactor); + } + } else { + // units are special, so call the library with the exact value + const result = utils.convertUnitTo(fromUnit, fromVal.toNumber(), toUnit); + if (result.status !== 'succeeded') { + return; + } + rawResult = Decimal.from(result.toVal); + } + // IMPORTANT: Experimentation shows JS number issues are more common than one might anticipate, + // eg 0 C to F produces "31.999999999999943" which gets normalized to "32.00000000". + // Since Decimal scale is relevant, drop trailing zeros here, + // then ensure a minimum scale matching the input value's scale. + // This may produce results with different scale than pure Decimal arithmetic would, + // but should never impact the value, only the scale. + return rawResult.normalized().withoutTrailingZeros().withMinimumScale(fromVal.scale); } export function normalizeUnitsWhenPossible(val1: Decimal, unit1: any, val2: Decimal, unit2: any) { diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index f8986052c..c99fb3b18 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -1070,6 +1070,10 @@ describe('ConvertQuantity', () => { (await this.convertQuantityToKg.exec(this.ctx)).should.eql(new Quantity(5, 'kg')); }); + it('should return converted Quantity with Celsius', async function () { + (await this.convertQuantityToC.exec(this.ctx)).should.eql(new Quantity(0, 'Cel')); + }); + it('should return converted Quantity with weeks', async function () { (await this.convertQuantityToWeeks.exec(this.ctx)).should.eql(new Quantity(4, 'weeks')); }); diff --git a/test/elm/convert/data.cql b/test/elm/convert/data.cql index 68c1742c6..458b9ee5d 100644 --- a/test/elm/convert/data.cql +++ b/test/elm/convert/data.cql @@ -265,6 +265,7 @@ define IsNull: ConvertsToTime(null as String) define ConvertQuantityGood: ConvertQuantity(5 'mg', 'g') define ConvertSyntax: convert 5 'mg' to 'g' define ConvertQuantityToKg: ConvertQuantity(5000 'g', 'kg') +define ConvertQuantityToC: ConvertQuantity(32 '[degF]', 'Cel') define ConvertQuantityToWeeks: ConvertQuantity(28 'days', 'weeks') define NullConvertQuantity: ConvertQuantity(5 'mg', 'fox') diff --git a/test/elm/convert/data.js b/test/elm/convert/data.js index 764975694..c5eb11c97 100644 --- a/test/elm/convert/data.js +++ b/test/elm/convert/data.js @@ -13476,6 +13476,7 @@ context Patient define ConvertQuantityGood: ConvertQuantity(5 'mg', 'g') define ConvertSyntax: convert 5 'mg' to 'g' define ConvertQuantityToKg: ConvertQuantity(5000 'g', 'kg') +define ConvertQuantityToC: ConvertQuantity(32 '[degF]', 'Cel') define ConvertQuantityToWeeks: ConvertQuantity(28 'days', 'weeks') define NullConvertQuantity: ConvertQuantity(5 'mg', 'fox') */ @@ -13492,7 +13493,7 @@ module.exports['ConvertQuantity'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "261", + "r" : "274", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -13761,7 +13762,7 @@ module.exports['ConvertQuantity'] = { }, { "localId" : "248", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "ConvertQuantityToWeeks", + "name" : "ConvertQuantityToC", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -13770,7 +13771,7 @@ module.exports['ConvertQuantity'] = { "s" : { "r" : "248", "s" : [ { - "value" : [ "", "define ", "ConvertQuantityToWeeks", ": " ] + "value" : [ "", "define ", "ConvertQuantityToC", ": " ] }, { "r" : "256", "s" : [ { @@ -13778,14 +13779,14 @@ module.exports['ConvertQuantity'] = { }, { "r" : "249", "s" : [ { - "value" : [ "28 ", "'days'" ] + "value" : [ "32 ", "'[degF]'" ] } ] }, { "value" : [ ", " ] }, { "r" : "250", "s" : [ { - "value" : [ "'weeks'" ] + "value" : [ "'Cel'" ] } ] }, { "value" : [ ")" ] @@ -13813,22 +13814,22 @@ module.exports['ConvertQuantity'] = { "type" : "Quantity", "localId" : "249", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "value" : 28, - "unit" : "days", + "value" : 32, + "unit" : "[degF]", "annotation" : [ ] }, { "type" : "Literal", "localId" : "250", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", - "value" : "weeks", + "value" : "Cel", "annotation" : [ ] } ] } }, { "localId" : "261", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "NullConvertQuantity", + "name" : "ConvertQuantityToWeeks", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -13837,7 +13838,7 @@ module.exports['ConvertQuantity'] = { "s" : { "r" : "261", "s" : [ { - "value" : [ "", "define ", "NullConvertQuantity", ": " ] + "value" : [ "", "define ", "ConvertQuantityToWeeks", ": " ] }, { "r" : "269", "s" : [ { @@ -13845,14 +13846,14 @@ module.exports['ConvertQuantity'] = { }, { "r" : "262", "s" : [ { - "value" : [ "5 ", "'mg'" ] + "value" : [ "28 ", "'days'" ] } ] }, { "value" : [ ", " ] }, { "r" : "263", "s" : [ { - "value" : [ "'fox'" ] + "value" : [ "'weeks'" ] } ] }, { "value" : [ ")" ] @@ -13880,12 +13881,79 @@ module.exports['ConvertQuantity'] = { "type" : "Quantity", "localId" : "262", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 28, + "unit" : "days", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "263", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "weeks", + "annotation" : [ ] + } ] + } + }, { + "localId" : "274", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "NullConvertQuantity", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "274", + "s" : [ { + "value" : [ "", "define ", "NullConvertQuantity", ": " ] + }, { + "r" : "282", + "s" : [ { + "value" : [ "ConvertQuantity", "(" ] + }, { + "r" : "275", + "s" : [ { + "value" : [ "5 ", "'mg'" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "276", + "s" : [ { + "value" : [ "'fox'" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "ConvertQuantity", + "localId" : "282", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "283", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "284", + "name" : "{urn:hl7-org:elm-types:r1}String", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Quantity", + "localId" : "275", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "mg", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "263", + "localId" : "276", "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", "valueType" : "{urn:hl7-org:elm-types:r1}String", "value" : "fox", From 43aaa72d58849deaead831f189b9734f290c77f5 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:21:44 -0400 Subject: [PATCH 28/62] sum Quantities by value so values are only normalized once at the end --- src/elm/aggregate.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 6d9e91536..741fad6d9 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -67,8 +67,9 @@ export class Sum extends AggregateExpression { let sum; if (hasOnlyQuantities(items)) { - // note doAddition is Quantity addition - sum = items.reduce(doAddition); + // note that processQuantities above converted everything + // to match the unit of the first item in the list + sum = sumOfDecimals(items.map((q: Quantity) => q.value)); } else { if (hasDecimals(items)) { sum = sumOfDecimals(items.map(Decimal.from)); From ad82f420dc4b0f42c37271bd0b79a6218f1767c7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:23:00 -0400 Subject: [PATCH 29/62] cleanup aggregate file; use explicit lambda functions to avoid risk of passing in index from Array.map --- src/elm/aggregate.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 741fad6d9..caae0f591 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -1,6 +1,6 @@ import { Expression } from './expression'; import { typeIsArray, allTrue, anyTrue, removeNulls } from '../util/util'; -import { doAddition, Quantity } from '../datatypes/datatypes'; +import { Quantity } from '../datatypes/datatypes'; import { Decimal } from '../datatypes/decimal'; import { Context } from '../runtime/context'; import { Exception } from '../datatypes/exception'; @@ -72,7 +72,7 @@ export class Sum extends AggregateExpression { sum = sumOfDecimals(items.map((q: Quantity) => q.value)); } else { if (hasDecimals(items)) { - sum = sumOfDecimals(items.map(Decimal.from)); + sum = sumOfDecimals(items.map((x: any) => Decimal.from(x))); } else { sum = items.reduce((x: any, y: any) => x + y); } @@ -175,7 +175,7 @@ export class Avg extends AggregateExpression { decimals = getValuesFromQuantities(items); } else { // return type is always Decimal, so just map everything to Decimals - decimals = items.map(Decimal.from); + decimals = items.map((x: any) => Decimal.from(x)); } const sum = sumOfDecimals(decimals); const avg = sum.divideBy(items.length); @@ -210,7 +210,7 @@ export class Median extends AggregateExpression { // Note that the Median signature is Median(argument List) Decimal // because median on a list of even number of items takes the average of the 2 middle items // so we can treat all the input as decimals - decimals = items.map(Decimal.from); + decimals = items.map((x: any) => Decimal.from(x)); } const sorted = [...decimals].sort((a, b) => a.compareTo(b)); @@ -310,7 +310,7 @@ export class StdDev extends AggregateExpression { if (hasOnlyQuantities(items)) { values = getValuesFromQuantities(items); } else { - values = items.map(Decimal.from); + values = items.map((x: any) => Decimal.from(x)); } const stdDev = this.standardDeviation(values); @@ -378,7 +378,7 @@ export class Product extends AggregateExpression { if (hasOnlyQuantities(items)) { product = productOfDecimals(getValuesFromQuantities(items)); } else if (hasDecimals(items)) { - product = productOfDecimals(items.map(Decimal.from)); + product = productOfDecimals(items.map((x: any) => Decimal.from(x))); } else { product = items.reduce((x: number, y: number) => x * y); } @@ -412,7 +412,7 @@ export class GeometricMean extends AggregateExpression { if (hasOnlyQuantities(items)) { decimals = getValuesFromQuantities(items); } else { - decimals = items.map(Decimal.from); + decimals = items.map((x: any) => Decimal.from(x)); } try { @@ -476,7 +476,7 @@ export class AnyTrue extends AggregateExpression { } function hasDecimals(values: any[]) { - return values.some(value => value && value.isDecimal); + return values.some(value => value?.isDecimal); } function processQuantities(values: any[]) { From 293f03a7d2101a1448ff7cc1e3f1ad9c7da97b08 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:27:43 -0400 Subject: [PATCH 30/62] Power operator always returns Decimal --- src/elm/arithmetic.ts | 30 ++++---------------------- test/elm/arithmetic/arithmetic-test.ts | 20 ++++++++--------- test/spec-tests/skip-list.txt | 13 +++++++++++ 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index cc8a5935a..ac862c9f0 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -399,36 +399,14 @@ export class Power extends Expression { return null; } - // Note: The resultTypeName may be wrong if the exponent is a negative number. - // E.g., CQL-to-ELM says 10^-1 is an Integer result type, but the correct result is a 0.1 (a Decimal) - // doPower handles this scenario - let power; + // As of CQL 2.0.0, return type of Power is always a Decimal try { - power = doPower(args[0], args[1]); + const power = Decimal.from(args[0]).power(args[1]); + return finalizeArithmeticResult(power); } catch { + // if the value is too large to represent return null; } - - return finalizeArithmeticResult(power); - } -} - -function doPower(x: any, y: any) { - if ( - x.isDecimal || - y.isDecimal || - (typeof y == 'number' && y < 0) || - (typeof y === 'bigint' && y < 0n) - ) { - // Decimal values or negative powers always produce Decimal result - return Decimal.from(x).power(y); - } - - try { - return x ** y; - } catch { - // will throw if BigInt goes out of range - return null; } } diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index f3475e0c1..31e8ba6d5 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -318,27 +318,27 @@ describe('Power', () => { }); it('should be able to calculate the power of a number', async function () { - (await this.pow.exec(this.ctx)).should.eql(81); + (await this.pow.exec(this.ctx)).should.equalDecimal(81); }); it('should be able to calculate the negative power of a number', async function () { - (await this.negPow.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); + (await this.negPow.exec(this.ctx)).should.equalDecimal(0.1); }); it('should be able to calculate the power of a long', async function () { - (await this.threeExpFourLong.exec(this.ctx)).should.equal(81n); + (await this.threeExpFourLong.exec(this.ctx)).should.equalDecimal(81); }); it('should be able to calculate the long power of an integer', async function () { - (await this.threeExpFourMixed.exec(this.ctx)).should.equal(81n); + (await this.threeExpFourMixed.exec(this.ctx)).should.equalDecimal(81); }); it('should be able to calculate the integer power of a long', async function () { - (await this.threeExpFourReverseMixed.exec(this.ctx)).should.equal(81n); + (await this.threeExpFourReverseMixed.exec(this.ctx)).should.equalDecimal(81); }); it('should be able to calculate the negative power of a long', async function () { - (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); + (await this.tenLongExpNegativeOneLong.exec(this.ctx)).should.equalDecimal(0.1); }); it('should return null when a long power exponent is too large (beyond max Long value)', async function () { @@ -1071,11 +1071,11 @@ describe('OutOfBounds', () => { }); it('should return value for Power near overflow', async function () { - should(await this.integerPowerNearOverflow.exec(this.ctx)).equal(MAX_INT_VALUE); + should(await this.integerPowerNearOverflow.exec(this.ctx)).equalDecimal(MAX_INT_VALUE); }); it('should return value for Power near underflow', async function () { - should(await this.integerPowerNearUnderflow.exec(this.ctx)).equal(MIN_INT_VALUE); + should(await this.integerPowerNearUnderflow.exec(this.ctx)).equalDecimal(MIN_INT_VALUE); }); it('should return null for successor overflow', async function () { @@ -1182,11 +1182,11 @@ describe('OutOfBounds', () => { }); it('should return value for Power near overflow', async function () { - should(await this.longPowerNearOverflow.exec(this.ctx)).equal(MAX_LONG_VALUE); + should(await this.longPowerNearOverflow.exec(this.ctx)).equalDecimal(MAX_LONG_VALUE); }); it('should return value for Power near underflow', async function () { - should(await this.longPowerNearUnderflow.exec(this.ctx)).equal(MIN_LONG_VALUE); + should(await this.longPowerNearUnderflow.exec(this.ctx)).equalDecimal(MIN_LONG_VALUE); }); it('should return null for successor overflow', async function () { diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index 51c64424b..1c8fbd74d 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -32,6 +32,19 @@ CqlArithmeticFunctionsTest.Predecessor.PredecessorOf101D Wrong output: As CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCM Wrong output: As of 2.0 Successor of Decimal should be precision-aware CqlArithmeticFunctionsTest.Successor.SuccessorOf1D Wrong output: As of 2.0 Successor of Decimal should be precision-aware CqlArithmeticFunctionsTest.Successor.SuccessorOf101D Wrong output: As of 2.0 Successor of Decimal should be precision-aware +CqlArithmeticFunctionsTest.Power.Power0To0 Wrong output: As of CQL 2.0, Power always returns Decimal +CqlArithmeticFunctionsTest.Power.Power2To2 Wrong output: As of CQL 2.0, Power always returns Decimal +CqlArithmeticFunctionsTest.Power.PowerNeg2To2 Wrong output: As of CQL 2.0, Power always returns Decimal +CqlArithmeticFunctionsTest.Power.Power2LTo2L Wrong output: As of CQL 2.0, Power always returns Decimal +CqlArithmeticFunctionsTest.Power.Power2To4 Wrong output: As of CQL 2.0, Power always returns Decimal +CqlArithmeticFunctionsTest.Power.Power2LTo3L Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.Integer10Pow9 Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.IntegerPos10Pow9 Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.IntegerNeg10Pow9 Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.Integer2Pow31ToZero1IntegerMaxValue Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.IntegerPos2Pow31ToZero1IntegerMaxValue Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.IntegerNeg2Pow31ToZero1 Wrong output: As of CQL 2.0, Power always returns Decimal +ValueLiteralsAndSelectors.Integer.IntegerNeg2Pow31IntegerMinValue Wrong output: As of CQL 2.0, Power always returns Decimal CqlComparisonOperatorsTest.Equal.TupleEqDifferentNamesWithOneNullId Wrong output: Tuple equality with a known-unequal element should return false "CqlComparisonOperatorsTest.Not Equal.TupleNotEqDifferingNamesWithOneNullId" Wrong output: Tuple inequality with a known-unequal element should return true CqlStringOperatorsTest.Substring.SubstringEmptyAnd0 Wrong output: Substring(x, x.length) should be null'. Note similar test SubstringAB2. See https://github.com/cqframework/cql-tests/issues/149 From b3555d2b2b3e76029d2126d8fbd0735472d7fe21 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:33:15 -0400 Subject: [PATCH 31/62] remove/clarify calls to Quantity arithmetic --- src/elm/arithmetic.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index ac862c9f0..bf39d8b4b 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -1,6 +1,6 @@ import { Expression } from './expression'; import * as MathUtil from '../util/math'; -import { Quantity, doMultiplication, doDivision } from '../datatypes/quantity'; +import { Quantity, doMultiplication as doQuantityMultiplication } from '../datatypes/quantity'; import { Uncertainty } from '../datatypes/uncertainty'; import { Context } from '../runtime/context'; import { build } from './builder'; @@ -85,10 +85,13 @@ export class Multiply extends Expression { let product; if (x.isQuantity || y.isQuantity) { - product = doMultiplication(x, y); + product = doQuantityMultiplication(x, y); } else if (x.isUncertainty && y.isUncertainty) { if (x.low.isQuantity) { - product = new Uncertainty(doMultiplication(x.low, y.low), doMultiplication(x.high, y.high)); + product = new Uncertainty( + doQuantityMultiplication(x.low, y.low), + doQuantityMultiplication(x.high, y.high) + ); } else { product = new Uncertainty( MathUtil.multiply(x.low, y.low), @@ -124,12 +127,12 @@ export class Divide extends Expression { } if (x.isQuantity) { - quotient = doDivision(x, y); + quotient = x.dividedBy(y); } else if (x.isUncertainty && y.isUncertainty) { let low, high; if (x.low.isQuantity) { - low = doDivision(x.low, y.high); - high = doDivision(x.high, y.low); + low = x.low.dividedBy(y.high); + high = x.high.dividedBy(y.low); } else { low = MathUtil.divide(x.low, y.high); high = MathUtil.divide(x.high, y.low); @@ -161,7 +164,7 @@ export class TruncatedDivide extends Expression { const [x, y] = args; let quotient; if (x.isQuantity) { - quotient = doDivision(x, y); + quotient = x.dividedBy(y); if (quotient instanceof Quantity) { quotient = new Quantity(quotient.value.truncated(), quotient.unit); } From 7511707989d3b2117192b72f60d6bdab929b1d34 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:34:16 -0400 Subject: [PATCH 32/62] regenerate spec-tests with latest --- .../cql/CqlArithmeticFunctionsTest.cql | 24 +- .../cql/CqlArithmeticFunctionsTest.json | 438 ++--------- .../cql/ValueLiteralsAndSelectors.cql | 28 +- .../cql/ValueLiteralsAndSelectors.json | 717 ++---------------- 4 files changed, 175 insertions(+), 1032 deletions(-) diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql index 10d8a19ca..624ae2173 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql @@ -735,25 +735,33 @@ define "Power": Tuple{ output: null }, "Power0To0": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(0, 0), output: 1 - }, + */ }, "Power2To2": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(2, 2), output: 4 - }, + */ }, "PowerNeg2To2": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(-2, 2), output: 4 - }, + */ }, "Power2ToNeg2": Tuple{ expression: Power(2, -2), output: 0.25 }, "Power2LTo2L": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(2L, 2L), output: 4L - }, + */ }, "Power2DTo2D": Tuple{ expression: Power(2.0, 2.0), output: 4.0 @@ -775,13 +783,17 @@ define "Power": Tuple{ output: 4.0 }, "Power2To4": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: 2^4, output: 16 - }, + */ }, "Power2LTo3L": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: 2L^3L, output: 8L - }, + */ }, "Power2DTo4D": Tuple{ expression: 2.0^4.0, output: 16.0 diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json index a0552b7d3..82e90b7ee 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json @@ -19557,20 +19557,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19585,20 +19576,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19613,20 +19595,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19669,20 +19642,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19837,20 +19801,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19865,20 +19820,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -19986,20 +19932,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20014,20 +19951,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20042,20 +19970,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20098,20 +20017,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20266,20 +20176,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20294,20 +20195,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20471,20 +20363,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20492,37 +20375,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "0", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -20539,20 +20397,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20560,37 +20409,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -20607,20 +20431,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20628,43 +20443,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -20755,20 +20539,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -20776,37 +20551,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "2", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "4", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -21185,20 +20935,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21206,37 +20947,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "4", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "16", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -21253,20 +20969,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Long", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -21274,37 +20981,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "3", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Long", - "valueType": "{urn:hl7-org:elm-types:r1}Long", - "value": "8", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } diff --git a/test/spec-tests/cql/ValueLiteralsAndSelectors.cql b/test/spec-tests/cql/ValueLiteralsAndSelectors.cql index 1bf057dab..83aa557f0 100644 --- a/test/spec-tests/cql/ValueLiteralsAndSelectors.cql +++ b/test/spec-tests/cql/ValueLiteralsAndSelectors.cql @@ -58,29 +58,41 @@ define "Integer": Tuple{ output: -2 }, "Integer10Pow9": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(10,9), output: 1000000000 - }, + */ }, "IntegerPos10Pow9": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: +Power(10,9), output: 1000000000 - }, + */ }, "IntegerNeg10Pow9": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: -Power(10,9), output: -1000000000 - }, + */ }, "Integer2Pow31ToZero1IntegerMaxValue": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: Power(2,30)-1+Power(2,30), output: 2147483647 - }, + */ }, "IntegerPos2Pow31ToZero1IntegerMaxValue": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: +Power(2,30)-1+Power(2,30), output: 2147483647 - }, + */ }, "IntegerNeg2Pow31ToZero1": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: -Power(2,30)+1-Power(2,30), output: -2147483647 - }, + */ }, "Integer2Pow31": Tuple{ expression: 2147483648, invalid: true @@ -90,9 +102,11 @@ define "Integer": Tuple{ invalid: true }, "IntegerNeg2Pow31IntegerMinValue": Tuple{ + skipped: 'Wrong output: As of CQL 2.0, Power always returns Decimal' + /* expression: -Power(2,30)-Power(2,30), output: -2147483648 - }, + */ }, "Integer2Pow31ToInf1": Tuple{ expression: 2147483649, invalid: true diff --git a/test/spec-tests/cql/ValueLiteralsAndSelectors.json b/test/spec-tests/cql/ValueLiteralsAndSelectors.json index b4743e7c5..f653ed0ed 100644 --- a/test/spec-tests/cql/ValueLiteralsAndSelectors.json +++ b/test/spec-tests/cql/ValueLiteralsAndSelectors.json @@ -701,20 +701,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -729,20 +720,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -757,20 +739,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -785,20 +758,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -813,20 +777,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -841,20 +796,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -925,20 +871,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1298,20 +1235,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1326,20 +1254,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1354,20 +1273,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1382,20 +1292,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1410,20 +1311,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1438,20 +1330,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -1522,20 +1405,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2146,20 +2020,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2167,37 +2032,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1000000000", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -2214,20 +2054,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2235,37 +2066,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1000000000", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -2282,20 +2088,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2303,50 +2100,13 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "10", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "9", - "annotation": [] - } - ] - } - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1000000000", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", + "annotation": [] } } ] @@ -2362,20 +2122,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2383,82 +2134,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Add", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Subtract", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - ] - }, - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2147483647", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -2475,20 +2156,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2496,82 +2168,12 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Add", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Subtract", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - ] - }, - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2147483647", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", "annotation": [] } } @@ -2588,20 +2190,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2609,95 +2202,13 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Subtract", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Add", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "1", - "annotation": [] - } - ] - }, - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2147483647", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", + "annotation": [] } } ] @@ -2819,20 +2330,11 @@ "annotation": [], "element": [ { - "name": "expression", - "annotation": [], - "elementType": { - "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [] - } - }, - { - "name": "output", + "name": "skipped", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}Integer", + "name": "{urn:hl7-org:elm-types:r1}String", "annotation": [] } } @@ -2840,80 +2342,13 @@ }, "element": [ { - "name": "expression", - "value": { - "type": "Subtract", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - }, - { - "type": "Power", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": [ - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2", - "annotation": [] - }, - { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "30", - "annotation": [] - } - ] - } - ] - } - }, - { - "name": "output", + "name": "skipped", "value": { - "type": "Negate", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "annotation": [], - "signature": [], - "operand": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", - "valueType": "{urn:hl7-org:elm-types:r1}Integer", - "value": "2147483648", - "annotation": [] - } + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong output: As of CQL 2.0, Power always returns Decimal", + "annotation": [] } } ] From 986e48d397f31e330a954df1e06d529e577c72ff Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:39:47 -0400 Subject: [PATCH 33/62] replace limitDecimalPrecision with finalizeNumericResult --- src/datatypes/interval.ts | 10 ++++------ src/util/math.ts | 21 --------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/datatypes/interval.ts b/src/datatypes/interval.ts index 120b0b31d..af1343115 100644 --- a/src/datatypes/interval.ts +++ b/src/datatypes/interval.ts @@ -5,7 +5,7 @@ import { predecessor, maxValueForType, minValueForType, - limitDecimalPrecision, + finalizeNumericResult, subtract, add } from '../util/math'; @@ -673,7 +673,7 @@ export class Interval { // "The result of this operator is equivalent to invoking: (end of argument – start of argument)." const end = this.end(); const start = this.start(); - return limitDecimalPrecision(subtract(end, start, this.pointType)); + return finalizeNumericResult(subtract(end, start)); } // https://cql.hl7.org/R2/09-b-cqlreference.html#size @@ -691,9 +691,7 @@ export class Interval { // "The result of this operator is equivalent to invoking: // (end of argument – start of argument) + point-size, where point-size is determined by // successor of minimum T - minimum T." - return limitDecimalPrecision( - add(subtract(this.end(), this.start(), this.pointType), this.getPointSize(), this.pointType) - ); + return finalizeNumericResult(add(subtract(this.end(), this.start()), this.getPointSize())); } // https://cql.hl7.org/R2/09-b-cqlreference.html#size @@ -709,7 +707,7 @@ export class Interval { // E.g., point size of Interval[@2012-01, @2012-12] is 1 month, not 1 ms. return new Quantity(1, (this.low ?? this.high).getPrecision()); } - return subtract(successor(minValue), minValue, this.pointType); + return subtract(successor(minValue), minValue); } throw new Error('Point type of interval cannot be determined.'); diff --git a/src/util/math.ts b/src/util/math.ts index 487393751..934fe48eb 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -231,27 +231,6 @@ export function divide(a: any, b: any) { throw new Error('Unsupported argument types.'); } -export function limitDecimalPrecision< - T extends number | bigint | Quantity | Uncertainty | Decimal | undefined ->(val?: T): T | undefined { - if (val == null) { - return val; - } else if (typeof val === 'number') { - return (Math.round(val * Math.pow(10, 8)) / Math.pow(10, 8)) as T; - } else if ((val as Quantity).isQuantity) { - return new Quantity( - limitDecimalPrecision((val as Quantity).value) as Decimal, - (val as Quantity).unit - ) as T; - } else if ((val as Uncertainty).isUncertainty) { - return new Uncertainty( - limitDecimalPrecision((val as Uncertainty).low), - limitDecimalPrecision((val as Uncertainty).high) - ) as T; - } - return val; -} - export class OverFlowException extends Exception {} export function successor(val: any, precision?: string): any { From c2befb63f0208e4ee55f7f7b5a4de469a50872cd Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:42:07 -0400 Subject: [PATCH 34/62] update interval Expand with latest understanding --- src/elm/interval.ts | 87 +++++++++++++----------------- test/elm/interval/interval-test.ts | 44 +++++++-------- 2 files changed, 59 insertions(+), 72 deletions(-) diff --git a/src/elm/interval.ts b/src/elm/interval.ts index d4288fb70..a967726c2 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -1,7 +1,7 @@ import { Expression } from './expression'; import { MAX_DATETIME_VALUE, MIN_DATETIME_VALUE } from '../datatypes/datetime'; import { Quantity } from '../datatypes/quantity'; -import { add, successor, predecessor, subtract } from '../util/math'; +import { add, subtract } from '../util/math'; import { greaterThan, lessThan } from '../util/comparison'; import { convertUnit, compareUnits, convertToCQLDateUnit } from '../util/units'; import * as dtivl from '../datatypes/interval'; @@ -594,7 +594,7 @@ export class Expand extends Expression { return value; } - expandQuantityInterval(interval: any, per: any) { + expandQuantityInterval(interval: dtivl.Interval, per: Quantity) { // we want to convert everything to the more precise of the interval.low or per let result_units; const res = compareUnits(interval.low.unit, per.unit); @@ -604,28 +604,12 @@ export class Expand extends Expression { } else { result_units = interval.low.unit; } - let low_value = interval.low.value; - let high_value = interval.high.value; - // Quantity values are always Decimal, but successor is expected to know if the value is an integer - // this needs to happen before converting units - if (!interval.lowClosed) { - if (low_value.isInteger()) { - low_value = low_value.add(1); - } else { - low_value = successor(low_value); - } - } - if (!interval.highClosed) { - if (high_value.isInteger()) { - high_value = high_value.subtract(1); - } else { - high_value = predecessor(high_value); - } - } + const closed = interval.toClosed(); + // getting the closed form of the interval needs to happen before unit conversion - low_value = convertUnit(low_value, interval.low.unit, result_units); - high_value = convertUnit(high_value, interval.high.unit, result_units); + const low_value = convertUnit(closed.low.value, closed.low.unit, result_units); + const high_value = convertUnit(closed.high.value, closed.high.unit, result_units); const per_value = convertUnit(per.value, per.unit, result_units); // return null if unit conversion failed, must have mismatched units @@ -646,46 +630,49 @@ export class Expand extends Expression { if (per.unit !== '1' && per.unit !== '') { return null; } - const low = interval.lowClosed ? interval.low : successor(interval.low); - const high = interval.highClosed ? interval.high : predecessor(interval.high); - - return this.makeNumericIntervalList(low, high, per.value); + const closed = interval.toClosed(); + return this.makeNumericIntervalList(closed.low, closed.high, per.value); } - makeNumericIntervalList(low: any, high: any, perValue: any) { - // If the per value is a decimal, 8 decimal places are appropriate - // Integers should have 0 Decimal places + makeNumericIntervalList(lowValue: any, highValue: any, perValue: Decimal) { + if (lowValue == null || highValue == null) { + return []; + } const perIsIntegral = perValue.isInteger(); - const decimalPrecision = perIsIntegral ? 0 : 8; // For the purposes of this function, we'll perform all the arithmetic using Decimals, // then convert the results back to the required type as necessary - const origLow = low; - const origHigh = high; + let low = Decimal.from(lowValue); + let high = Decimal.from(highValue); - low = Decimal.from(low); - high = Decimal.from(high); + if (low.greaterThan(high)) { + return []; + } let convertBound: (d: Decimal) => Decimal | number | bigint; if (!perIsIntegral) { // If per is not an integer value, then regardless of the original point types, the values will be Decimals convertBound = d => d; - } else if (typeof origLow === 'bigint' || typeof origHigh === 'bigint') { - convertBound = d => d.toLong(); - } else if (typeof origLow === 'number' || typeof origHigh === 'number') { - convertBound = d => d.toInteger(); + } else if (typeof lowValue === 'bigint' || typeof highValue === 'bigint') { + // the bounds were integral and the per was integral, so there should be no risk of non-integral values + convertBound = d => BigInt(d.truncate()); + } else if (typeof lowValue === 'number' || typeof highValue === 'number') { + convertBound = d => d.truncate(); } else { - // per is an integer but the original bounds of the interval were Decimal. + // per is integral but the original bounds of the interval were Decimal. // Make the resulting intervals either Long or Integer based on the original bounds. + // TODO: this approach is based on the literals shown in the spec examples and may be incorrect. + // It's possible the correct approach should be to keep the point type as Decimal. + // See Zulip thread https://chat.fhir.org/#narrow/channel/179220-cql/topic/Ambiguous.20Decimal.2FInteger.20Literals.20in.20Spec.20and.20Tests/with/621765103 if ( low.lessThan(MIN_INT_VALUE) || low.greaterThan(MAX_INT_VALUE) || high.lessThan(MIN_INT_VALUE) || high.greaterThan(MAX_INT_VALUE) ) { - convertBound = d => d.toLong(); + convertBound = d => BigInt(d.truncate()); } else { - convertBound = d => d.toInteger(); + convertBound = d => d.truncate(); } } @@ -695,17 +682,17 @@ export class Expand extends Expression { // If the interval boundaries are more precise than the per quantity, the // more precise values will be truncated to the precision specified by the // per quantity. - low = low.setScale(decimalPrecision); - high = high.setScale(decimalPrecision); - - if (low == null || high == null) { - return []; - } - if (low.greaterThan(high)) { - return []; - } + low = low.truncated(perValue.scale); + high = high.truncated(perValue.scale); const perUnitSize = perIsIntegral ? 1 : 0.00000001; + // NOTE: This is based on the size of an interval being based on the point-size of the type. + // If, as currently seems to be the intent, the size of an interval changes to be based on + // Decimal precision, or if "intervals of size per" doesn't necessarily mean based on the size operator, + // use this: + // const perUnitSize = perValue.successor().subtract(perValue); + // And update both current_high below to: + // current_high = current_low.add(perValue).predecessor(); let current_low = low; const results = []; diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 77dc2c701..207073d11 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -9,8 +9,7 @@ import { MIN_INT_VALUE, MAX_INT_VALUE, MIN_LONG_VALUE, - MAX_LONG_VALUE, - MIN_FLOAT_PRECISION_VALUE + MAX_LONG_VALUE } from '../../../src/util/limits'; describe('Interval', () => { @@ -1621,7 +1620,8 @@ describe('Width', () => { // define RealWidth: width of Interval[1.23, 4.56] (await this.realWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.33)); // define RealOpenWidth: width of Interval(1.23, 4.56) - (await this.realOpenWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.32999998)); + // width of Interval(1.23, 4.56) = predecessor(4.56) - successor (1.23) = 4.55 - 1.24 = 3.31 + (await this.realOpenWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.31)); }); it('should calculate the width of infinite intervals', async function () { @@ -1686,13 +1686,10 @@ describe('Size', () => { it('should calculate the size of real intervals', async function () { // define RealSize: Size(Interval[1.23, 4.56]) - (await this.realSize.exec(this.ctx)).should.equalDecimal( - Decimal.from(3.33 + MIN_FLOAT_PRECISION_VALUE) - ); + (await this.realSize.exec(this.ctx)).should.equalDecimal(Decimal.from('3.33000001')); // define RealOpenSize: Size(Interval(1.23, 4.56)) - (await this.realOpenSize.exec(this.ctx)).should.equalDecimal( - Decimal.from(3.32999998 + MIN_FLOAT_PRECISION_VALUE) - ); + // (1.23, 4.56) --> [1.24, 4.55], 4.55 - 1.24 = 3.31 + (await this.realOpenSize.exec(this.ctx)).should.equalDecimal(Decimal.from('3.31000001')); }); it('should calculate the size of infinite intervals', async function () { @@ -3604,16 +3601,17 @@ describe('IntegerIntervalExpand', () => { // Skip for now until we have more clarity on what the expected result should be // https://jira.hl7.org/browse/FHIR-58705 and // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Interval.20Expand.20example/with/619051021 - // Note that as of this writing the produced result is { } (empty list) - // but I believe the correct answer is either { } or { [ Interval[10.0, 10.0 ] } - // depending on whether the size of the interval is based on the precision of the decimals (not currently supported) + // There are two possible answers to consider: + // 1. { } (empty list) - I believe this is the correct answer per how the spec is currently written + // 2. { Interval[10.0, 10.0 ] } - this is the other possible answer, suggested in the Zulip thread. + // This would be the correct answer if either: + // - "intervals of size per" does not require the Size operator on the resulting intervals to = per + // - the Size operator on an interval is based on the precision of its bounds, not Decimal point-size + // (this one is likely the _intent_, but not how it is currently defined) // define PerDecimalMorePrecise: expand { Interval[10, 10] } per 0.1 const a = await this.perDecimalMorePrecise.exec(this.ctx); - // JavaScript truncates 10.0 to 10. - prettyList(a).should.equal( - '{ [10, 10.09999999], [10.1, 10.19999999], [10.2, 10.29999999], [10.3, 10.39999999], [10.4, 10.49999999], [10.5, 10.59999999], [10.6, 10.69999999], [10.7, 10.79999999], [10.8, 10.89999999], [10.9, 10.99999999] }' - ); + prettyList(a).should.equal('{ }'); }); }); @@ -3686,14 +3684,16 @@ describe('LongIntervalExpand', () => { // Skip for now until we have more clarity on what the expected result should be // https://jira.hl7.org/browse/FHIR-58705 and // https://chat.fhir.org/#narrow/channel/179220-cql/topic/Interval.20Expand.20example/with/619051021 - // Note that as of this writing the produced result is { } (empty list) - // which I believe is the correct result. - // But an empty list doesn't clearly show the intent of the test. + // There are two possible answers to consider: + // 1. { } (empty list) - I believe this is the correct answer per how the spec is currently written + // 2. { Interval[10.0, 10.0 ] } - this is the other possible answer, suggested in the Zulip thread. + // This would be the correct answer if either: + // - "intervals of size per" does not require the Size operator on the resulting intervals to = per + // - the Size operator on an interval is based on the precision of its bounds, not Decimal point-size + // (this one is likely the _intent_, but not how it is currently defined) const a = await this.longPerDecimalMorePrecise.exec(this.ctx); - prettyList(a).should.equal( - '{ [10, 10.09999999], [10.1, 10.19999999], [10.2, 10.29999999], [10.3, 10.39999999], [10.4, 10.49999999], [10.5, 10.59999999], [10.6, 10.69999999], [10.7, 10.79999999], [10.8, 10.89999999], [10.9, 10.99999999] }' - ); + prettyList(a).should.equal('{ }'); }); }); From 31f143901c28256f472bfe233d4fbce4d476573e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:45:01 -0400 Subject: [PATCH 35/62] light cleanup --- src/datatypes/datetime.ts | 5 ++++- src/util/comparison.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/datatypes/datetime.ts b/src/datatypes/datetime.ts index 096f5ad29..b406d704b 100644 --- a/src/datatypes/datetime.ts +++ b/src/datatypes/datetime.ts @@ -1275,7 +1275,10 @@ function compareWithDefaultResult(a: any, b: any, defaultResult: any) { } // make a copy of other in the correct timezone offset if they don't match. - const differentTZ = (a.timeZoneOffset == null) ? (b.timezoneOffset != null) : !(a.timezoneOffset.equals(b.timezoneOffset)); + const differentTZ = + a.timeZoneOffset == null + ? b.timezoneOffset != null + : !a.timezoneOffset.equals(b.timezoneOffset); if (differentTZ) { b = b.convertToTimezoneOffset(a.timezoneOffset); } diff --git a/src/util/comparison.ts b/src/util/comparison.ts index ce1cf55ab..e31a97dc0 100644 --- a/src/util/comparison.ts +++ b/src/util/comparison.ts @@ -13,7 +13,7 @@ function areStrings(a: any, b: any) { } function areDecimals(a: any, b: any) { - return a && a.isDecimal && b && b.isDecimal; + return a?.isDecimal && b?.isDecimal; } function areDateTimesOrQuantities(a: any, b: any) { From d849e9684d80e4c67c4e5a1042816649a3dbf4c4 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:46:11 -0400 Subject: [PATCH 36/62] update equalDecimal to take all numeric types + string --- test/should-extensions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/should-extensions.ts b/test/should-extensions.ts index f57ba3890..0f5770141 100644 --- a/test/should-extensions.ts +++ b/test/should-extensions.ts @@ -5,7 +5,7 @@ import { Decimal } from '../src/datatypes/decimal'; declare module 'should' { interface Assertion { equalInterval(expected: Interval): this; - equalDecimal(expected: Decimal): this; + equalDecimal(expected: number | bigint | Decimal | string): this; } } @@ -33,7 +33,7 @@ declare module 'should' { (should as any).Assertion.add( 'equalDecimal', - function (this: any, expected: number | bigint | Decimal) { + function (this: any, expected: number | bigint | Decimal | string) { this.params = { operator: 'to equal Decimal', expected: expected.toString(), From 708ec6aff5e9ba3305c0969e2266ca29e2fa8e58 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 11:48:02 -0400 Subject: [PATCH 37/62] update tests to be explicit about decimal scale where necessary --- test/datatypes/interval-data.ts | 5 ++- test/datatypes/interval-test.ts | 52 ++++++++++++------------- test/elm/arithmetic/arithmetic-test.ts | 16 ++++---- test/elm/interval/data.cql | 18 ++++----- test/elm/interval/data.js | 54 +++++++++++++------------- test/spec-tests/spec-test.ts | 2 +- test/util/math-test.ts | 20 +++++----- 7 files changed, 86 insertions(+), 81 deletions(-) diff --git a/test/datatypes/interval-data.ts b/test/datatypes/interval-data.ts index 4ce09e61c..bb1f73eb0 100644 --- a/test/datatypes/interval-data.ts +++ b/test/datatypes/interval-data.ts @@ -298,6 +298,9 @@ export default () => { } }; data['zeroPointFiveToNinePointFive'] = new TestInterval(Decimal.from(0.5), Decimal.from(9.5)); - data['zeroToHundredMg'] = new TestInterval(new Quantity(0, 'mg'), new Quantity(100, 'mg')); + data['zeroToHundredMg'] = new TestInterval( + new Quantity('0.0', 'mg'), + new Quantity('100.0', 'mg') + ); return data; }; diff --git a/test/datatypes/interval-test.ts b/test/datatypes/interval-test.ts index 7772a8ac1..64a4408c4 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -158,7 +158,7 @@ describe('Interval', () => { d.zeroToHundred.closed.start().should.equal(0); d.zeroPointFiveToNinePointFive.closed.start().should.equalDecimal(Decimal.from(0.5)); d.zeroToHundredLong.closed.start().should.equal(0n); - d.zeroToHundredMg.closed.start().should.eql(new Quantity(0, 'mg')); + d.zeroToHundredMg.closed.start().should.eql(new Quantity('0.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()); @@ -166,11 +166,9 @@ describe('Interval', () => { it('should return successor of low for intervals with open low', () => { d.zeroToHundred.openClosed.start().should.equal(1); - d.zeroPointFiveToNinePointFive.openClosed - .start() - .should.equalDecimal(Decimal.from('0.50000001')); + d.zeroPointFiveToNinePointFive.openClosed.start().should.equalDecimal(Decimal.from('0.6')); d.zeroToHundredLong.openClosed.start().should.equal(1n); - d.zeroToHundredMg.openClosed.start().should.eql(new Quantity(0.00000001, 'mg')); + d.zeroToHundredMg.openClosed.start().should.eql(new Quantity('0.1', '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 @@ -210,7 +208,7 @@ describe('Interval', () => { d.zeroToHundredMg.withNullStart.openClosed .start() .should.eql( - new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(100, 'mg')) + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity('100.0', 'mg')) ); d.all2012date.withNullStart.openClosed .start() @@ -232,11 +230,11 @@ describe('Interval', () => { .should.eql(new Uncertainty(MIN_LONG_VALUE, 99n)); d.zeroPointFiveToNinePointFive.withNullStart.open .start() - .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, Decimal.from(9.49999999))); + .should.eql(new Uncertainty(MIN_DECIMAL_VALUE, Decimal.from(9.4))); d.zeroToHundredMg.withNullStart.open .start() .should.eql( - new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(99.99999999, 'mg')) + new Uncertainty(new Quantity(MIN_DECIMAL_VALUE, 'mg'), new Quantity(99.9, 'mg')) ); d.all2012date.withNullStart.open .start() @@ -305,9 +303,9 @@ describe('Interval', () => { it('should return high for intervals with closed high', () => { d.zeroToHundred.closed.end().should.equal(100); - d.zeroPointFiveToNinePointFive.closed.end().should.equalDecimal(Decimal.from(9.5)); + d.zeroPointFiveToNinePointFive.closed.end().should.equalDecimal(Decimal.from('9.5')); d.zeroToHundredLong.closed.end().should.equal(100n); - d.zeroToHundredMg.closed.end().should.eql(new Quantity(100, 'mg')); + d.zeroToHundredMg.closed.end().should.eql(new Quantity('100.0', '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()); @@ -315,9 +313,9 @@ describe('Interval', () => { it('should return predecessor of high for intervals with open high', () => { d.zeroToHundred.closedOpen.end().should.equal(99); - d.zeroPointFiveToNinePointFive.closedOpen.end().should.equalDecimal(Decimal.from(9.49999999)); + d.zeroPointFiveToNinePointFive.closedOpen.end().should.equalDecimal(Decimal.from('9.4')); d.zeroToHundredLong.closedOpen.end().should.equal(99n); - d.zeroToHundredMg.closedOpen.end().should.eql(new Quantity(99.99999999, 'mg')); + d.zeroToHundredMg.closedOpen.end().should.eql(new Quantity('99.9', '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()); @@ -348,7 +346,9 @@ describe('Interval', () => { .should.eql(new Uncertainty(Decimal.from(0.5), MAX_DECIMAL_VALUE)); d.zeroToHundredMg.withNullEnd.closedOpen .end() - .should.eql(new Uncertainty(new Quantity(0, 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg'))); + .should.eql( + new Uncertainty(new Quantity('0.0', 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg')) + ); d.all2012date.withNullEnd.closedOpen .end() .should.eql(new Uncertainty(Date.parse('2012-01-01'), MAX_DATE_VALUE)); @@ -367,11 +367,11 @@ describe('Interval', () => { d.zeroToHundredLong.withNullEnd.open.end().should.eql(new Uncertainty(1n, MAX_LONG_VALUE)); d.zeroPointFiveToNinePointFive.withNullEnd.open .end() - .should.eql(new Uncertainty(Decimal.from(0.50000001), MAX_DECIMAL_VALUE)); + .should.eql(new Uncertainty(Decimal.from('0.6'), MAX_DECIMAL_VALUE)); d.zeroToHundredMg.withNullEnd.open .end() .should.eql( - new Uncertainty(new Quantity(0.00000001, 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg')) + new Uncertainty(new Quantity('0.1', 'mg'), new Quantity(MAX_DECIMAL_VALUE, 'mg')) ); d.all2012date.withNullEnd.open .end() @@ -7028,25 +7028,25 @@ describe('DecimalInterval', () => { interval.size().should.equalDecimal(Decimal.from('3000000000.00000001')); }); - it('should close open decimal uncertainty endpoints using decimal point size', () => { + it('should close open decimal uncertainty endpoints using decimal precision', () => { const closed = new Interval( - new Uncertainty(Decimal.from(1), Decimal.from(2)), - new Uncertainty(Decimal.from(3), Decimal.from(4)), + new Uncertainty(Decimal.from('1.0'), Decimal.from('2.0')), + new Uncertainty(Decimal.from('3.0'), Decimal.from('4.0')), false, false, ELM_DECIMAL_TYPE ).toClosed(); - closed.low.should.eql(new Uncertainty(Decimal.from(1.00000001), Decimal.from(2.00000001))); - closed.high.should.eql(new Uncertainty(Decimal.from(2.99999999), Decimal.from(3.99999999))); + closed.low.should.eql(new Uncertainty(Decimal.from('1.1'), Decimal.from('2.1'))); + closed.high.should.eql(new Uncertainty(Decimal.from('2.9'), Decimal.from('3.9'))); closed.lowClosed.should.be.true(); closed.highClosed.should.be.true(); }); - it('should use decimal point size for meetsBefore decimal uncertainty bounds', () => { - const earlier = new Interval(Decimal.from(1), Decimal.from(1.99999999)); + it('should use decimal precision for meetsBefore decimal uncertainty bounds', () => { + const earlier = new Interval(Decimal.from('1.0'), Decimal.from('1.9')); const later = new Interval( - new Uncertainty(Decimal.from(2), Decimal.from(2)), + new Uncertainty(Decimal.from('2.0'), Decimal.from('2.0')), null, true, false, @@ -7056,15 +7056,15 @@ describe('DecimalInterval', () => { earlier.meetsBefore(later).should.be.true(); }); - it('should use decimal point size for meetsAfter decimal uncertainty bounds', () => { + it('should use decimal precision for meetsAfter decimal uncertainty bounds', () => { const earlier = new Interval( null, - new Uncertainty(Decimal.from(1), Decimal.from(1)), + new Uncertainty(Decimal.from('1.0'), Decimal.from('1.0')), false, true, ELM_DECIMAL_TYPE ); - const later = new Interval(Decimal.from(1.00000001), Decimal.from(2)); + const later = new Interval(Decimal.from('1.1'), Decimal.from('2.0')); later.meetsAfter(earlier).should.be.true(); }); diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 31e8ba6d5..df6cb69be 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -664,9 +664,9 @@ describe('Round', () => { (await this.down_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.4)); }); - it('should round negative exact-half values toward positive infinity', async function () { - (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); - (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(Decimal.from(-1)); + it('should round negative exact-half values toward nearest whole number', async function () { + (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(Decimal.from(-1)); + (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(Decimal.from(-2)); }); }); @@ -683,8 +683,9 @@ describe('Successor', () => { (await this.ls.exec(this.ctx)).should.equal(3n); }); - it('should be able to get Real Successor', async function () { - (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from(2.2 + Math.pow(10, -8))); + it('should be able to get Decimal Successor', async function () { + // successor of 2.2 + (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from(2.3)); }); it('should return null for Successor greater than Integer Max value', async function () { @@ -786,8 +787,9 @@ describe('Predecessor', () => { (await this.ls.exec(this.ctx)).should.equal(1n); }); - it('should be able to get Real Predecessor', async function () { - (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from('2.19999999')); + it('should be able to get Decimal Predecessor', async function () { + // Rs: predecessor of 2.2 + (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from('2.1')); }); it('should return null for Predecessor greater than Integer Max value', async function () { diff --git a/test/elm/interval/data.cql b/test/elm/interval/data.cql index 635fd182a..a0f21523c 100644 --- a/test/elm/interval/data.cql +++ b/test/elm/interval/data.cql @@ -653,9 +653,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets DateIvl @@ -724,9 +724,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets after Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets after Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets after Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets after Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets after Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets after Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets after Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets after Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets after Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets after Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets after DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets after DateIvl @@ -795,9 +795,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets before Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets before Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets before Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets before Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets before Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets before Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets before Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets before Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets before Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets before Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets before DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets before DateIvl diff --git a/test/elm/interval/data.js b/test/elm/interval/data.js index d07c26671..4ad13753e 100644 --- a/test/elm/interval/data.js +++ b/test/elm/interval/data.js @@ -125250,9 +125250,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets DateIvl @@ -126186,7 +126186,7 @@ module.exports['Meets'] = { "r" : "325", "s" : [ { "r" : "323", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] }, { "r" : "333", @@ -126249,7 +126249,7 @@ module.exports['Meets'] = { "localId" : "323", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -126323,7 +126323,7 @@ module.exports['Meets'] = { "r" : "348", "s" : [ { "r" : "346", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] } ] } ] @@ -126410,7 +126410,7 @@ module.exports['Meets'] = { "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -126451,7 +126451,7 @@ module.exports['Meets'] = { "r" : "366", "s" : [ { "r" : "364", - "value" : [ "Interval[", "1.1", ", ", "2.0", "]" ] + "value" : [ "Interval[", "1.2", ", ", "2.0", "]" ] } ] } ] } ] @@ -126538,7 +126538,7 @@ module.exports['Meets'] = { "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.1", + "value" : "1.2", "annotation" : [ ] }, "high" : { @@ -140748,9 +140748,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets after Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets after Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets after Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets after Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets after Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets after Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets after Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets after Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets after Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets after Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets after DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets after DateIvl @@ -141684,7 +141684,7 @@ module.exports['MeetsAfter'] = { "r" : "325", "s" : [ { "r" : "323", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] }, { "r" : "333", @@ -141747,7 +141747,7 @@ module.exports['MeetsAfter'] = { "localId" : "323", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -141821,7 +141821,7 @@ module.exports['MeetsAfter'] = { "r" : "348", "s" : [ { "r" : "346", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] } ] } ] @@ -141908,7 +141908,7 @@ module.exports['MeetsAfter'] = { "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -141949,7 +141949,7 @@ module.exports['MeetsAfter'] = { "r" : "366", "s" : [ { "r" : "364", - "value" : [ "Interval[", "1.1", ", ", "2.0", "]" ] + "value" : [ "Interval[", "1.2", ", ", "2.0", "]" ] } ] } ] } ] @@ -142036,7 +142036,7 @@ module.exports['MeetsAfter'] = { "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.1", + "value" : "1.2", "annotation" : [ ] }, "high" : { @@ -156246,9 +156246,9 @@ define NotMeetsIntIvl: Interval[1, 2] meets before Interval[5, 10] define MeetsAfterLongIvl: Interval[11L, 15L] meets before Interval[5L, 10L] define MeetsBeforeLongIvl: Interval[1L, 4L] meets before Interval[5L, 10L] define NotMeetsLongIvl: Interval[1L, 2L] meets before Interval[5L, 10L] -define MeetsAfterRealIvl: Interval[1.50000001, 2.5] meets before Interval[0.5, 1.5] -define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets before Interval[1.50000001, 2.5] -define NotMeetsRealIvl: Interval[0.0, 1.0] meets before Interval[1.1, 2.0] +define MeetsAfterRealIvl: Interval[1.6, 2.5] meets before Interval[0.5, 1.5] +define MeetsBeforeRealIvl: Interval[0.5, 1.5] meets before Interval[1.6, 2.5] +define NotMeetsRealIvl: Interval[0.0, 1.0] meets before Interval[1.2, 2.0] define DateIvl: Interval[DateTime(2012, 3, 1, 0, 0, 0, 0), DateTime(2012, 9, 1, 0, 0, 0, 0)) define MeetsAfterDateIvl: Interval[DateTime(2012, 9, 1, 0, 0, 0, 0), DateTime(2012, 12, 1, 0, 0, 0, 0)) meets before DateIvl define MeetsBeforeDateIvl: Interval[DateTime(2012, 1, 1, 0, 0, 0, 0), DateTime(2012, 3, 1, 0, 0, 0, 0)) meets before DateIvl @@ -157182,7 +157182,7 @@ module.exports['MeetsBefore'] = { "r" : "325", "s" : [ { "r" : "323", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] }, { "r" : "333", @@ -157245,7 +157245,7 @@ module.exports['MeetsBefore'] = { "localId" : "323", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -157319,7 +157319,7 @@ module.exports['MeetsBefore'] = { "r" : "348", "s" : [ { "r" : "346", - "value" : [ "Interval[", "1.50000001", ", ", "2.5", "]" ] + "value" : [ "Interval[", "1.6", ", ", "2.5", "]" ] } ] } ] } ] @@ -157406,7 +157406,7 @@ module.exports['MeetsBefore'] = { "localId" : "346", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.50000001", + "value" : "1.6", "annotation" : [ ] }, "high" : { @@ -157447,7 +157447,7 @@ module.exports['MeetsBefore'] = { "r" : "366", "s" : [ { "r" : "364", - "value" : [ "Interval[", "1.1", ", ", "2.0", "]" ] + "value" : [ "Interval[", "1.2", ", ", "2.0", "]" ] } ] } ] } ] @@ -157534,7 +157534,7 @@ module.exports['MeetsBefore'] = { "localId" : "364", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "1.1", + "value" : "1.2", "annotation" : [ ] }, "high" : { diff --git a/test/spec-tests/spec-test.ts b/test/spec-tests/spec-test.ts index 32f774aef..969df94a6 100644 --- a/test/spec-tests/spec-test.ts +++ b/test/spec-tests/spec-test.ts @@ -134,7 +134,7 @@ describe('CQL Spec Tests (from XML)', () => { function roundDecimalsWhenApplicable(item: any) { if (item instanceof Decimal) { // Round to 8 places since that's the number of places used by expected outputs - item = item.setScale(8); + item = item.withScale(8); } return item; } diff --git a/test/util/math-test.ts b/test/util/math-test.ts index ac82ebe3e..2576d29e1 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -11,14 +11,14 @@ describe('successor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); - result.low.should.equalDecimal(Decimal.from('1.00000001')); - result.high.should.equalDecimal(Decimal.from('2.00000001')); + const result = successor(new Uncertainty(Decimal.from('1.0'), Decimal.from('2.0'))); + result.low.should.equalDecimal(Decimal.from('1.1')); + result.high.should.equalDecimal(Decimal.from('2.1')); }); it('should leave the uncertainty high unchanged when it overflows', () => { - const result = successor(new Uncertainty(Decimal.from(1), MAX_FLOAT_VALUE)); - result.should.eql(new Uncertainty(Decimal.from('1.00000001'), MAX_FLOAT_VALUE)); + const result = successor(new Uncertainty(Decimal.from('1.0'), MAX_FLOAT_VALUE)); + result.should.eql(new Uncertainty(Decimal.from('1.1'), MAX_FLOAT_VALUE)); }); }); @@ -30,14 +30,14 @@ describe('predecessor', () => { }); it('should preserve decimals in an Uncertainty', () => { - const result = successor(new Uncertainty(Decimal.from(1.0), Decimal.from(2.0))); - result.low.should.equalDecimal(Decimal.from('1.00000001')); - result.high.should.equalDecimal(Decimal.from('2.00000001')); + const result = successor(new Uncertainty(Decimal.from('1.0'), Decimal.from('2.0'))); + result.low.should.equalDecimal(Decimal.from('1.1')); + result.high.should.equalDecimal(Decimal.from('2.1')); }); it('should leave the uncertainty low unchanged when it underflows', () => { - const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from(2))); - result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from('1.99999999'))); + const result = predecessor(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from('2.0'))); + result.should.eql(new Uncertainty(MIN_FLOAT_VALUE, Decimal.from('1.9'))); }); }); From 945238bbae06439d42e049cf1c5627316ecf3d80 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 12:33:00 -0400 Subject: [PATCH 38/62] update comment to point to reported issue --- test/elm/aggregate/data.cql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index 48c754ae4..60fa73630 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -170,7 +170,9 @@ define decimals_at_min_value_product: Product({-99999999999999999999.99999999, 1 define decimals_below_min_value_product: Product({-99999999999999999999.99999999, 2.0}) define quantity_product: Product({1.0 'g', 2.0 'g', 3.0 'g', 4.0 'g'}) // Max/Min-valued quantities are described using the "maximum" and "minimum" operators -// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +// to avoid them being represented in ELM as +/-1.0e20, which is not a legal Decimal +// (Note that the ELM for Quantity literals uses a plain number for the value) +// See https://jira.hl7.org/browse/FHIR-58825 define MaxValueGramQuantity: Quantity { value: maximum Decimal, unit: 'g' } define MinValueGramQuantity: Quantity { value: minimum Decimal, unit: 'g' } define quantities_at_max_value_product: Product({MaxValueGramQuantity, 1.0 'g'}) From 9e205824a1637a73ef2a4957c5ea7b6ab234695d Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 13:58:35 -0400 Subject: [PATCH 39/62] rework Decimal tests to cover all methods --- src/datatypes/decimal.ts | 2 +- test/datatypes/decimal-test.ts | 350 ++++++++++++++++++++++++++++----- 2 files changed, 304 insertions(+), 48 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index fb546ca39..b1edcf49f 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -271,7 +271,7 @@ export class Decimal { // if needed to represent the value. // Eg, 1.0 / 1.0 and 1.0 / 3.0 both have exactly the same input scales, but expect different output scales. withMinimumScale(scale: number, roundingMode: DecimalRoundingMode = CQL_IMPLICIT_ROUNDING) { - if (this.scale > scale) { + if (this.scale >= scale) { return this; } return this.withScale(scale, roundingMode); diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 171ca129d..f4511ae45 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -1,72 +1,328 @@ -import { Decimal as DecimalJS } from 'decimal.js'; import { Decimal } from '../../src/datatypes/decimal'; describe('Decimal', () => { - it('should retain Decimal runtime identity for a whole-number value', () => { - const decimal = Decimal.from('2.0'); + describe('from', () => { + it('should preserve Decimal instances', () => { + const decimal = Decimal.from('2.0'); + Decimal.from(decimal).should.equal(decimal); + Decimal.from(decimal).should.eql(decimal); + }); - decimal.isDecimal.should.equal(true); - (typeof decimal).should.equal('object'); - decimal.toNumber().should.equal(2); + it('should parse scale from passed-in strings', () => { + Decimal.from('2').scale.should.equal(0); + Decimal.from('2.0').scale.should.equal(1); + Decimal.from('2.00').scale.should.equal(2); + Decimal.from('2.000').scale.should.equal(3); + }); + + it('should reject invalid values', () => { + (() => Decimal.from('not a number')).should.throw(); + (() => Decimal.from('NaN')).should.throw(); + (() => Decimal.from('Infinity')).should.throw(); + (() => Decimal.from(Number.NaN)).should.throw(); + (() => Decimal.from(Number.POSITIVE_INFINITY)).should.throw(); + }); + }); + + describe('isDecimal', () => { + it('should identify Decimal values', () => { + Decimal.from(2).isDecimal.should.be.true(); + }); + }); + + describe('normalized', () => { + it('should round to CQL-implicit eight decimal places', () => { + Decimal.from('0.12345678901234').normalized().should.equalDecimal('0.12345679'); + }); + + it('should preserve an already normalized value', () => { + const value = Decimal.from('1.23456789'); + value.normalized().should.equal(value); + }); + }); + + describe('add', () => { + it('should add values with scale matching the most precise operand', () => { + const result = Decimal.from('1.2').add('0.03'); + result.should.equalDecimal('1.23'); + result.scale.should.equal(2); + }); }); - it('should expose arithmetic and comparison operations', () => { - const value = Decimal.from('1.5').subtract('0.5'); + describe('subtract', () => { + it('should subtract values with scale matching the most precise operand', () => { + const result = Decimal.from('3.14').subtract('3.1'); + result.should.equalDecimal('0.04'); + result.scale.should.equal(2); + }); + }); + + describe('multiplyBy', () => { + it('should cap the result scale at eight places', () => { + const result = Decimal.from('1.2345').multiplyBy('2.0000'); + result.should.equalDecimal('2.46900000'); + result.scale.should.equal(8); + }); + + it('should round when the product exceeds the eight-place scale cap', () => { + const result = Decimal.from('1.23456789').multiplyBy('1.00000001'); + result.should.equalDecimal('1.23456790'); + result.scale.should.equal(8); + }); + }); - value.compareTo('1').should.equal(0); - value.add(2).toString().should.equal('3.0'); - value.multiplyBy(2).toString().should.equal('2.0'); - value.divideBy(2).toString().should.equal('0.5'); - Decimal.from(3).modulo(2).toString().should.equal('1.0'); + describe('divideBy', () => { + it('should apply CQL rounding and preferred scale', () => { + Decimal.from('1.00000').divideBy('2.0').should.equalDecimal('0.5000'); + Decimal.from(1).divideBy(3).should.equalDecimal('0.33333333'); + (() => Decimal.from(1).divideBy('1e-1000')).should.not.throw(); + }); + + it('should round a terminating quotient that exceeds eight decimal places', () => { + const result = Decimal.from(1).divideBy(512); + result.should.equalDecimal('0.00195313'); + result.scale.should.equal(8); + }); + + it('should preserve the preferred scale of an exact quotient', () => { + const result = Decimal.from('4.0').divideBy(2); + result.should.equalDecimal('2.0'); + result.scale.should.equal(1); + }); + + it('should reject a zero divisor', () => { + (() => Decimal.from(1).divideBy(0)).should.throw(RangeError); + }); }); - it('should provide an explicit scale and JSON representation', () => { - Decimal.from('0.444444444').setScale(8).toString().should.equal('0.44444444'); - JSON.stringify({ value: Decimal.from('1.25') }).should.equal('{"value":"1.25"}'); + describe('modulo', () => { + it('should calculate a remainder', () => { + Decimal.from('5.5').modulo(2).should.equalDecimal('1.5'); + }); + + it('should reject a zero divisor', () => { + (() => Decimal.from(1).modulo(0)).should.throw(RangeError); + }); }); - it('should serialize using fixed-point CQL Decimal notation', () => { - Decimal.from(1).toString().should.equal('1.0'); - Decimal.from('-12.5').toString().should.equal('-12.5'); - Decimal.from('0.00000001').toString().should.equal('0.00000001'); - JSON.stringify({ value: Decimal.from(1) }).should.equal('{"value":"1.0"}'); + describe('compareTo', () => { + it('should order numeric values', () => { + Decimal.from('1.20').compareTo('1.2').should.equal(0); + Decimal.from('1.21').compareTo('1.2').should.equal(1); + Decimal.from('1.19').compareTo('1.2').should.equal(-1); + }); + }); + + describe('greaterThan', () => { + it('should compare values', () => { + Decimal.from('1.21').greaterThan('1.2').should.be.true(); + Decimal.from('1.2').greaterThan('1.2').should.be.false(); + }); + }); + + describe('greaterThanOrEquals', () => { + it('should compare values', () => { + Decimal.from('1.20').greaterThanOrEquals('1.2').should.be.true(); + Decimal.from('1.19').greaterThanOrEquals('1.2').should.be.false(); + }); + }); + + describe('lessThan', () => { + it('should compare values', () => { + Decimal.from('1.19').lessThan('1.2').should.be.true(); + Decimal.from('1.2').lessThan('1.2').should.be.false(); + }); + }); + + describe('lessThanOrEquals', () => { + it('should compare values', () => { + Decimal.from('1.20').lessThanOrEquals('1.2').should.be.true(); + Decimal.from('1.21').lessThanOrEquals('1.2').should.be.false(); + }); + }); + + describe('equals', () => { + it('should test numeric equality', () => { + Decimal.from('1.20').equals('1.2').should.be.true(); + Decimal.from('1.21').equals('1.2').should.be.false(); + }); + }); + + describe('equivalent', () => { + it('should compare at the least precise operand precision, ignoring trailing zeros', () => { + Decimal.from('1.2').equivalent('1.24').should.be.true(); + Decimal.from('1.20').equivalent('1.24').should.be.true(); + Decimal.from('1.20').equivalent('1.26').should.be.false(); + }); + }); + + describe('successor', () => { + it('should return the precision-aware successor', () => { + Decimal.from('1.0').successor().should.equalDecimal('1.1'); + Decimal.from('1.00').successor().should.equalDecimal('1.01'); + }); + + it('should preserve scale when crossing an integer boundary', () => { + const result = Decimal.from('1.99').successor(); + result.should.equalDecimal('2.00'); + result.scale.should.equal(2); + }); }); - it('should provide CQL arithmetic helpers without exposing a number', () => { - Decimal.from('-1.9').truncate().should.equal(-1); - Decimal.from('1.1').ceil().should.equal(2); - Decimal.from('1.9').floor().should.equal(1); - Decimal.from('-0.5').setScale(0).should.equalDecimal(Decimal.from(0)); - Decimal.from('2').power(3).should.equalDecimal(Decimal.from(8)); - Decimal.from('9').sqrt().should.equalDecimal(Decimal.from(3)); - Decimal.from('8').log(2).should.equalDecimal(Decimal.from(3)); + describe('predecessor', () => { + it('should return the precision-aware predecessor', () => { + Decimal.from('1.0').predecessor().should.equalDecimal('0.9'); + Decimal.from('1.00').predecessor().should.equalDecimal('0.99'); + }); }); - it('should reject an invalid scale', () => { - (() => Decimal.from(1).setScale(-1)).should.throw(RangeError); - (() => Decimal.from(1).setScale(1.5)).should.throw(RangeError); + describe('negate', () => { + it('should preserve scale', () => { + Decimal.from('1.20').negate().should.equalDecimal('-1.20'); + }); }); - it('should reject non-finite and divide-by-zero values', () => { - (() => Decimal.from('not a number')).should.throw(); - (() => Decimal.from(1).divideBy(0)).should.throw(); + describe('abs', () => { + it('should preserve scale', () => { + Decimal.from('-1.20').abs().should.equalDecimal('1.20'); + }); }); - it('should not coerce a nonzero Decimal divisor through a JavaScript number', () => { - (() => Decimal.from(1).divideBy('1e-1000')).should.not.throw(); + describe('truncate', () => { + it('should return the integer component', () => { + Decimal.from('-1.9').truncate().should.equal(-1); + }); }); - it('should keep CQL Decimal precision independent from the base decimal.js constructor', () => { - const basePrecision = DecimalJS.precision; - try { - DecimalJS.set({ precision: 5 }); + describe('truncated', () => { + it('should truncate to an optional decimal scale', () => { + Decimal.from('-1.239').truncated(2).should.equalDecimal('-1.23'); + Decimal.from('1.9').truncated().should.equalDecimal('1.0'); + }); - const oneThird = Decimal.from(1).divideBy(3); - oneThird.toString().should.equal('0.333333333333333333333333333333'); // we specify precision of 30 = significant figures + it('should treat scale zero as integer truncation', () => { + const result = Decimal.from('1.99').truncated(0); + result.should.equalDecimal('1.0'); + result.scale.should.equal(0); + }); + }); + + describe('ceil', () => { + it('should return the smallest integer not less than the value', () => { + Decimal.from('1.1').ceil().should.equal(2); + Decimal.from('-1.1').ceil().should.equal(-1); + }); + }); + + describe('floor', () => { + it('should return the largest integer not greater than the value', () => { + Decimal.from('1.1').floor().should.equal(1); + Decimal.from('-1.1').floor().should.equal(-2); + }); + }); + + describe('isInteger', () => { + it('should identify integer values', () => { + Decimal.from('2.0').isInteger().should.be.true(); + Decimal.from('2.1').isInteger().should.be.false(); + Decimal.from('2.0000000000001').isInteger().should.be.false(); + }); + }); + + describe('power', () => { + it('should raise values to a power', () => { + Decimal.from(2).power(3).should.equalDecimal('8.0'); + }); + }); + + describe('sqrt', () => { + it('should calculate square roots', () => { + const result = Decimal.from('9.00').sqrt(); + result.should.equalDecimal('3.00'); + result.scale.should.equal(2); + }); + }); + + describe('ln', () => { + it('should calculate natural logarithms', () => { + Decimal.from(1).ln().should.equalDecimal('0.0'); + }); + }); + + describe('exp', () => { + it('should calculate exponential values', () => { + Decimal.from(0).exp().should.equalDecimal('1.0'); + }); + }); + + describe('log', () => { + it('should calculate logarithms using the supplied base', () => { + const result = Decimal.from('8.00').log(2); + result.should.equalDecimal('3.00'); + result.scale.should.equal(2); + }); + }); + + describe('round', () => { + it('should round half away from zero to a requested scale', () => { + Decimal.from('1.235').round(2).should.equalDecimal('1.24'); + Decimal.from('-1.235').round(2).should.equalDecimal('-1.24'); + }); + }); + + describe('withScale', () => { + it('should use CQL half-up rounding', () => { + Decimal.from('-0.5').withScale(0).should.equalDecimal('-1.0'); + Decimal.from('0.444444444').withScale(8).should.equalDecimal('0.44444444'); + }); + + it('should reject invalid scales', () => { + (() => Decimal.from(1).withScale(-1)).should.throw(RangeError); + (() => Decimal.from(1).withScale(1.5)).should.throw(RangeError); + }); + }); + + describe('withMinimumScale', () => { + it('should only retain or extend scale', () => { + const value = Decimal.from('1.20'); + value.withMinimumScale(0).should.equal(value); + value.withMinimumScale(0).scale.should.equal(2); + value.withMinimumScale(1).should.equal(value); + value.withMinimumScale(1).scale.should.equal(2); + value.withMinimumScale(2).should.equal(value); + value.withMinimumScale(2).scale.should.equal(2); + value.withMinimumScale(3).should.equalDecimal('1.200'); + value.withMinimumScale(3).scale.should.equal(3); + value.withMinimumScale(4).should.equalDecimal('1.2000'); + value.withMinimumScale(4).scale.should.equal(4); + }); + }); + + describe('withoutTrailingZeros', () => { + it('should remove insignificant trailing zeros', () => { + const value = Decimal.from('1.200').withoutTrailingZeros(); + value.should.equalDecimal('1.2'); + value.scale.should.equal(1); + }); + }); + + describe('toNumber', () => { + it('should convert to a JavaScript number', () => { + Decimal.from('1.25').toNumber().should.equal(1.25); + }); + }); + + describe('toString', () => { + it('should serialize in fixed-point CQL Decimal notation', () => { + Decimal.from(1).toString().should.equal('1.0'); + Decimal.from('-12.5').toString().should.equal('-12.5'); + Decimal.from('0.00000001').toString().should.equal('0.00000001'); + }); + }); - oneThird.normalized().toString().should.equal('0.33333333'); - } finally { - DecimalJS.set({ precision: basePrecision }); - } + describe('toJSON', () => { + it('should serialize as a FHIR decimal number', () => { + JSON.stringify({ value: Decimal.from('1.25') }).should.equal('{"value":1.25}'); + }); }); }); From 4e5c81f1a9436c6e82b426c7c674b9eccc2a489d Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 14:06:31 -0400 Subject: [PATCH 40/62] remove redundant Decimal.from() in should.equalDecimal calls --- test/datatypes/date-test.ts | 6 +- test/datatypes/datetime-test.ts | 4 +- test/datatypes/interval-test.ts | 14 ++--- test/elm/aggregate/aggregate-test.ts | 42 ++++++------- test/elm/aggregate/data.js | 6 +- test/elm/arithmetic/arithmetic-test.ts | 82 +++++++++++--------------- test/elm/convert/convert-test.ts | 36 +++++------ test/elm/datetime/datetime-test.ts | 12 ++-- test/elm/interval/interval-test.ts | 22 +++---- test/elm/literal/literal-test.ts | 7 +-- test/elm/message/message-test.ts | 5 +- test/elm/parameters/parameters-test.ts | 6 +- test/elm/quantity/quantity-test.ts | 3 +- test/elm/query/query-test.ts | 5 +- test/util/math-test.ts | 18 +++--- test/util/units-test.ts | 22 +++---- 16 files changed, 136 insertions(+), 154 deletions(-) diff --git a/test/datatypes/date-test.ts b/test/datatypes/date-test.ts index dd8150016..c4e433b52 100644 --- a/test/datatypes/date-test.ts +++ b/test/datatypes/date-test.ts @@ -889,7 +889,7 @@ describe('Date.getDateTime', () => { dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); - dateTime.timezoneOffset.should.equalDecimal(Decimal.from(2)); + dateTime.timezoneOffset.should.equalDecimal(2); }); it('should return a DateTime with a timeZoneOffset when one is not passed in', () => { @@ -898,9 +898,7 @@ describe('Date.getDateTime', () => { dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); - dateTime.timezoneOffset.should.equalDecimal( - Decimal.from((new jsDate().getTimezoneOffset() / 60) * -1) - ); + dateTime.timezoneOffset.should.equalDecimal((new jsDate().getTimezoneOffset() / 60) * -1); }); it('should return a DateTime without a timeZoneOffset when a null timeZoneOffset is passed in', () => { diff --git a/test/datatypes/datetime-test.ts b/test/datatypes/datetime-test.ts index cc3105cb3..8d9102604 100644 --- a/test/datatypes/datetime-test.ts +++ b/test/datatypes/datetime-test.ts @@ -60,13 +60,13 @@ describe('DateTime', () => { d.minute.should.equal(25); d.second.should.equal(59); d.millisecond.should.equal(246); - d.timezoneOffset.should.equalDecimal(Decimal.from(5.5)); + d.timezoneOffset.should.equalDecimal(5.5); }); it('should leave unset properties as undefined', () => { const d = new DateTime(2000); d.year.should.equal(2000); - d.timezoneOffset.should.equalDecimal(Decimal.from((new Date().getTimezoneOffset() / 60) * -1)); + d.timezoneOffset.should.equalDecimal((new Date().getTimezoneOffset() / 60) * -1); should.not.exist(d.month); should.not.exist(d.day); should.not.exist(d.hour); diff --git a/test/datatypes/interval-test.ts b/test/datatypes/interval-test.ts index 64a4408c4..091ac09d6 100644 --- a/test/datatypes/interval-test.ts +++ b/test/datatypes/interval-test.ts @@ -134,7 +134,7 @@ describe('Interval', () => { it('should return the point size for Decimal intervals', () => { new Interval(Decimal.from(0.5), Decimal.from(9.5)) .getPointSize() - .should.equalDecimal(Decimal.from(0.00000001)); + .should.equalDecimal(0.00000001); }); it('should return the point size for Quantity intervals', () => { @@ -156,7 +156,7 @@ describe('Interval', () => { it('should return low for intervals with closed low', () => { d.zeroToHundred.closed.start().should.equal(0); - d.zeroPointFiveToNinePointFive.closed.start().should.equalDecimal(Decimal.from(0.5)); + d.zeroPointFiveToNinePointFive.closed.start().should.equalDecimal(0.5); d.zeroToHundredLong.closed.start().should.equal(0n); d.zeroToHundredMg.closed.start().should.eql(new Quantity('0.0', 'mg')); d.all2012date.closed.start().should.eql(Date.parse('2012-01-01')); @@ -166,7 +166,7 @@ describe('Interval', () => { it('should return successor of low for intervals with open low', () => { d.zeroToHundred.openClosed.start().should.equal(1); - d.zeroPointFiveToNinePointFive.openClosed.start().should.equalDecimal(Decimal.from('0.6')); + d.zeroPointFiveToNinePointFive.openClosed.start().should.equalDecimal('0.6'); d.zeroToHundredLong.openClosed.start().should.equal(1n); d.zeroToHundredMg.openClosed.start().should.eql(new Quantity('0.1', 'mg')); d.all2012date.openClosed.start().should.eql(Date.parse('2012-01-02')); @@ -303,7 +303,7 @@ describe('Interval', () => { it('should return high for intervals with closed high', () => { d.zeroToHundred.closed.end().should.equal(100); - d.zeroPointFiveToNinePointFive.closed.end().should.equalDecimal(Decimal.from('9.5')); + d.zeroPointFiveToNinePointFive.closed.end().should.equalDecimal('9.5'); d.zeroToHundredLong.closed.end().should.equal(100n); d.zeroToHundredMg.closed.end().should.eql(new Quantity('100.0', 'mg')); d.all2012date.closed.end().should.eql(Date.parse('2012-12-31')); @@ -313,7 +313,7 @@ describe('Interval', () => { it('should return predecessor of high for intervals with open high', () => { d.zeroToHundred.closedOpen.end().should.equal(99); - d.zeroPointFiveToNinePointFive.closedOpen.end().should.equalDecimal(Decimal.from('9.4')); + d.zeroPointFiveToNinePointFive.closedOpen.end().should.equalDecimal('9.4'); d.zeroToHundredLong.closedOpen.end().should.equal(99n); d.zeroToHundredMg.closedOpen.end().should.eql(new Quantity('99.9', 'mg')); d.all2012date.closedOpen.end().should.eql(Date.parse('2012-12-30')); @@ -7024,8 +7024,8 @@ describe('DecimalInterval', () => { ELM_DECIMAL_TYPE ); - interval.width().should.equalDecimal(Decimal.from('3000000000.0')); - interval.size().should.equalDecimal(Decimal.from('3000000000.00000001')); + interval.width().should.equalDecimal('3000000000.0'); + interval.size().should.equalDecimal('3000000000.00000001'); }); it('should close open decimal uncertainty endpoints using decimal precision', () => { diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index f9300bc0c..1f41fff0a 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -1,6 +1,6 @@ import should from 'should'; import setup from '../../setup'; -import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; +import { MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; const data = require('./data'); const validateQuantity = function (object: any, expectedValue: any, expectedUnit: any) { object.isQuantity.should.be.true(); @@ -73,7 +73,7 @@ describe('Sum', () => { }); it('should be able to sum lists with decimals', async function () { - (await this.decimals.exec(this.ctx)).should.equalDecimal(Decimal.from(16.5)); + (await this.decimals.exec(this.ctx)).should.equalDecimal(16.5); }); it('should be able to sum decimals up to max decimal value', async function () { @@ -176,7 +176,7 @@ describe('Min', () => { }); it('list of Decimals', async function () { - (await this.decimalMin.exec(this.ctx)).should.equalDecimal(Decimal.from(-5)); + (await this.decimalMin.exec(this.ctx)).should.equalDecimal(-5); }); it('list of DateTimes', async function () { @@ -253,7 +253,7 @@ describe('Max', () => { }); it('list of Decimals', async function () { - (await this.decimalMax.exec(this.ctx)).should.equalDecimal(Decimal.from(5.1)); + (await this.decimalMax.exec(this.ctx)).should.equalDecimal(5.1); }); it('list of DateTimes', async function () { @@ -302,15 +302,15 @@ describe('Avg', () => { }); it('should be able to find average for lists without nulls', async function () { - (await this.not_null.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); + (await this.not_null.exec(this.ctx)).should.equalDecimal(3); }); it('should be able to find average for lists with nulls', async function () { - (await this.has_null.exec(this.ctx)).should.equalDecimal(Decimal.from(1.5)); + (await this.has_null.exec(this.ctx)).should.equalDecimal(1.5); }); it('should normalize repeating Decimal averages at the aggregate boundary', async function () { - (await this.repeating_decimal.exec(this.ctx)).should.equalDecimal(Decimal.from('1.66666667')); + (await this.repeating_decimal.exec(this.ctx)).should.equalDecimal('1.66666667'); }); it('should return null for empty list', async function () { @@ -347,19 +347,19 @@ describe('Median', () => { }); it('should be able to find median of odd numbered list', async function () { - (await this.odd.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); + (await this.odd.exec(this.ctx)).should.equalDecimal(3); }); it('should be able to find median of even numbered list', async function () { - (await this.even.exec(this.ctx)).should.equalDecimal(Decimal.from(3.5)); + (await this.even.exec(this.ctx)).should.equalDecimal(3.5); }); it('should be able to find median of odd numbered list that contains duplicates', async function () { - (await this.dup_vals_odd.exec(this.ctx)).should.equalDecimal(Decimal.from(3)); + (await this.dup_vals_odd.exec(this.ctx)).should.equalDecimal(3); }); it('should be able to find median of even numbered list that contians duplicates', async function () { - (await this.dup_vals_even.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.dup_vals_even.exec(this.ctx)).should.equalDecimal(2.5); }); it('should return null for empty list', async function () { @@ -443,7 +443,7 @@ describe('PopulationVariance', () => { setup(this, data); }); it('should be able to find PopulationVariance of a list ', async function () { - (await this.v.exec(this.ctx)).should.equalDecimal(Decimal.from(2)); + (await this.v.exec(this.ctx)).should.equalDecimal(2); }); it('should be able to find PopulationVariance of a list of like quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2, 'ml'); @@ -459,7 +459,7 @@ describe('PopulationVariance', () => { }); it('should return zero for a single-item population variance', async function () { - (await this.single_value.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + (await this.single_value.exec(this.ctx)).should.equalDecimal(0); validateQuantity(await this.single_value_q.exec(this.ctx), 0, 'ml'); }); }); @@ -469,7 +469,7 @@ describe('Variance', () => { setup(this, data); }); it('should be able to find Variance of a list ', async function () { - (await this.v.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.v.exec(this.ctx)).should.equalDecimal(2.5); }); it('should be able to find Variance of a list of matched quantities', async function () { validateQuantity(await this.v_q.exec(this.ctx), 2.5, 'ml'); @@ -494,7 +494,7 @@ describe('StdDev', () => { setup(this, data); }); it('should be able to find Standard Dev of a list ', async function () { - (await this.std.exec(this.ctx)).should.equalDecimal(Decimal.from('1.58113883')); + (await this.std.exec(this.ctx)).should.equalDecimal('1.58113883'); }); it('should be able to find Standard Dev of a list of like quantities', async function () { validateQuantity(await this.std_q.exec(this.ctx), '1.58113883', 'ml'); @@ -519,7 +519,7 @@ describe('PopulationStdDev', () => { setup(this, data); }); it('should be able to find Population Standard Dev of a list ', async function () { - (await this.dev.exec(this.ctx)).should.equalDecimal(Decimal.from('1.41421356')); + (await this.dev.exec(this.ctx)).should.equalDecimal('1.41421356'); }); it('should be able to find Population Standard Dev of a list of quantities', async function () { validateQuantity(await this.dev_q.exec(this.ctx), '1.41421356', 'ml'); @@ -535,7 +535,7 @@ describe('PopulationStdDev', () => { }); it('should return zero for a single-item population standard deviation', async function () { - (await this.single_value.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + (await this.single_value.exec(this.ctx)).should.equalDecimal(0); validateQuantity(await this.single_value_q.exec(this.ctx), 0, 'ml'); }); }); @@ -586,7 +586,7 @@ describe('Product', () => { }); it('should return a decimal product', async function () { - (await this.decimal_product.exec(this.ctx)).should.equalDecimal(Decimal.from(24.0)); + (await this.decimal_product.exec(this.ctx)).should.equalDecimal(24.0); }); it('should return decimal product up to max decimal value', async function () { @@ -673,15 +673,15 @@ describe('GeometricMean', () => { }); it('should return decimal geometric mean', async function () { - (await this.decimal_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from(4.0)); + (await this.decimal_geometric_mean.exec(this.ctx)).should.equalDecimal(4.0); }); it('should retun 0 as a geometric mean', async function () { - (await this.zero_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from(0)); + (await this.zero_geometric_mean.exec(this.ctx)).should.equalDecimal(0); }); it('should return value when pass in list that contains nulls', async function () { - (await this.null_geometric_mean.exec(this.ctx)).should.equalDecimal(Decimal.from('1.41421356')); + (await this.null_geometric_mean.exec(this.ctx)).should.equalDecimal('1.41421356'); }); it('should return null when list is all null', async function () { diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index f3ef86c20..7173f9b42 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -15985,7 +15985,9 @@ define decimals_at_min_value_product: Product({-99999999999999999999.99999999, 1 define decimals_below_min_value_product: Product({-99999999999999999999.99999999, 2.0}) define quantity_product: Product({1.0 'g', 2.0 'g', 3.0 'g', 4.0 'g'}) // Max/Min-valued quantities are described using the "maximum" and "minimum" operators -// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal +// to avoid them being represented in ELM as +/-1.0e20, which is not a legal Decimal +// (Note that the ELM for Quantity literals uses a plain number for the value) +// See https://jira.hl7.org/browse/FHIR-58825 define MaxValueGramQuantity: Quantity { value: maximum Decimal, unit: 'g' } define MinValueGramQuantity: Quantity { value: minimum Decimal, unit: 'g' } define quantities_at_max_value_product: Product({MaxValueGramQuantity, 1.0 'g'}) @@ -17540,7 +17542,7 @@ module.exports['Product'] = { "s" : { "r" : "475", "s" : [ { - "value" : [ "// Max/Min-valued quantities are described using the \"maximum\" and \"minimum\" operators\n// to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal\n", "define ", "MaxValueGramQuantity", ": " ] + "value" : [ "// Max/Min-valued quantities are described using the \"maximum\" and \"minimum\" operators\n// to avoid them being represented in ELM as +/-1.0e20, which is not a legal Decimal\n// (Note that the ELM for Quantity literals uses a plain number for the value)\n// See https://jira.hl7.org/browse/FHIR-58825\n", "define ", "MaxValueGramQuantity", ": " ] }, { "r" : "476", "s" : [ { diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index df6cb69be..67f80f136 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -215,64 +215,64 @@ describe('Divide', () => { }); it('should divide two numbers', async function () { - (await this.tenDividedByTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.tenDividedByTwo.exec(this.ctx)).should.equalDecimal(5); }); it("should divide two numbers that don't evenly divide", async function () { - (await this.tenDividedByFour.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.tenDividedByFour.exec(this.ctx)).should.equalDecimal(2.5); }); it('should divide multiple numbers', async function () { - (await this.divideMultiple.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.divideMultiple.exec(this.ctx)).should.equalDecimal(5); }); it('should divide variables', async function () { - (await this.divideVariables.exec(this.ctx)).should.equalDecimal(Decimal.from(25)); + (await this.divideVariables.exec(this.ctx)).should.equalDecimal(25); }); it('should divide two longs', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoLong.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.tenDividedByTwoLong.exec(this.ctx)).should.equalDecimal(5); }); it('should divide integer by long', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.tenDividedByTwoMixed.exec(this.ctx)).should.equalDecimal(5); }); it('should divide long by integer', async function () { // NOTE: Divide always returns a Decimal - (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); + (await this.tenDividedByTwoReverseMixed.exec(this.ctx)).should.equalDecimal(5); }); it('should divide two longs with decimal result', async function () { - (await this.tenDividedByFourLong.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.tenDividedByFourLong.exec(this.ctx)).should.equalDecimal(2.5); }); it('should divide integer by long with decimal result', async function () { - (await this.tenDividedByFourMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.tenDividedByFourMixed.exec(this.ctx)).should.equalDecimal(2.5); }); it('should divide long by integer with decimal result', async function () { - (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.equalDecimal(Decimal.from(2.5)); + (await this.tenDividedByFourReverseMixed.exec(this.ctx)).should.equalDecimal(2.5); }); it('should divide uncertainty by uncertainty', async function () { const result = await this.divideUncertainties.exec(this.ctx); - result.low.should.equalDecimal(Decimal.from('0.42857143')); // 6/14 - result.high.should.equalDecimal(Decimal.from(9)); + result.low.should.equalDecimal('0.42857143'); // 6/14 + result.high.should.equalDecimal(9); }); it('should divide uncertainty by number', async function () { const result = await this.divideUncertaintyByNumber.exec(this.ctx); - result.low.should.equalDecimal(Decimal.from(3)); - result.high.should.equalDecimal(Decimal.from(9)); + result.low.should.equalDecimal(3); + result.high.should.equalDecimal(9); }); it('should divide number by uncertainty', async function () { const result = await this.divideNumberByUncertainty.exec(this.ctx); - result.low.should.equalDecimal(Decimal.from(2)); - result.high.should.equalDecimal(Decimal.from(6)); + result.low.should.equalDecimal(2); + result.high.should.equalDecimal(6); }); }); @@ -304,11 +304,11 @@ describe('MathPrecedence', () => { }); it('should follow order of operations', async function () { - (await this.mixed.exec(this.ctx)).should.equalDecimal(Decimal.from(46)); + (await this.mixed.exec(this.ctx)).should.equalDecimal(46); }); it('should allow parentheses to override order of operations', async function () { - (await this.parenthetical.exec(this.ctx)).should.equalDecimal(Decimal.from(-10)); + (await this.parenthetical.exec(this.ctx)).should.equalDecimal(-10); }); }); @@ -346,13 +346,11 @@ describe('Power', () => { }); it('should return an infinitesimally small number when the exponent is the minimum Long value', async function () { - (await this.twoLongExpMinLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.0)); + (await this.twoLongExpMinLong.exec(this.ctx)).should.equalDecimal(0.0); }); it('should normalize Decimal power results at the ELM boundary', async function () { - (await this.decimalPowerNeedsNormalization.exec(this.ctx)).should.equalDecimal( - Decimal.from('1.52415788') - ); + (await this.decimalPowerNeedsNormalization.exec(this.ctx)).should.equalDecimal('1.52415788'); }); it('should return null for Decimal powers that cannot be represented', async function () { @@ -583,11 +581,11 @@ describe('Log', () => { }); it('should be able to return the log of a number based on an arbitrary base value', async function () { - (await this.log.exec(this.ctx)).should.equalDecimal(Decimal.from(0.25)); + (await this.log.exec(this.ctx)).should.equalDecimal(0.25); }); it('should be able to return the log of a long based on an arbitrary base value', async function () { - (await this.logLong.exec(this.ctx)).should.equalDecimal(Decimal.from(0.25)); + (await this.logLong.exec(this.ctx)).should.equalDecimal(0.25); }); }); @@ -656,17 +654,17 @@ describe('Round', () => { }); it('should be able to round a number up or down to the closest integer value', async function () { - (await this.up.exec(this.ctx)).should.equalDecimal(Decimal.from(5)); - (await this.down.exec(this.ctx)).should.equalDecimal(Decimal.from(4)); + (await this.up.exec(this.ctx)).should.equalDecimal(5); + (await this.down.exec(this.ctx)).should.equalDecimal(4); }); it('should be able to round a number up or down to the closest decimal place ', async function () { - (await this.up_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.6)); - (await this.down_percent.exec(this.ctx)).should.equalDecimal(Decimal.from(4.4)); + (await this.up_percent.exec(this.ctx)).should.equalDecimal(4.6); + (await this.down_percent.exec(this.ctx)).should.equalDecimal(4.4); }); it('should round negative exact-half values toward nearest whole number', async function () { - (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(Decimal.from(-1)); - (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(Decimal.from(-2)); + (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(-1); + (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(-2); }); }); @@ -685,7 +683,7 @@ describe('Successor', () => { it('should be able to get Decimal Successor', async function () { // successor of 2.2 - (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from(2.3)); + (await this.rs.exec(this.ctx)).should.equalDecimal(2.3); }); it('should return null for Successor greater than Integer Max value', async function () { @@ -789,7 +787,7 @@ describe('Predecessor', () => { it('should be able to get Decimal Predecessor', async function () { // Rs: predecessor of 2.2 - (await this.rs.exec(this.ctx)).should.equalDecimal(Decimal.from('2.1')); + (await this.rs.exec(this.ctx)).should.equalDecimal('2.1'); }); it('should return null for Predecessor greater than Integer Max value', async function () { @@ -916,13 +914,13 @@ describe('Quantity', () => { it('should be able to perform Quantity Absolution', async function () { const q = await this.abs.exec(this.ctx); - q.value.should.equalDecimal(Decimal.from(10)); + q.value.should.equalDecimal(10); q.unit.should.equal('days'); }); it('should be able to perform Quantity Negation', async function () { const q = await this.neg.exec(this.ctx); - q.value.should.equalDecimal(Decimal.from(-10)); + q.value.should.equalDecimal(-10); q.unit.should.equal('days'); }); @@ -1048,16 +1046,12 @@ describe('OutOfBounds', () => { it('should return value for Divide near overflow', async function () { // not really near overflow, but more than max integer and near JavaScript max safe number - should(await this.integerDivideNearOverflow.exec(this.ctx)).equalDecimal( - Decimal.from(8589934588000000) - ); + should(await this.integerDivideNearOverflow.exec(this.ctx)).equalDecimal(8589934588000000); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but less than min integer and near JavaScript min safe number - should(await this.integerDivideNearUnderflow.exec(this.ctx)).equalDecimal( - Decimal.from(-8589934592000000) - ); + should(await this.integerDivideNearUnderflow.exec(this.ctx)).equalDecimal(-8589934592000000); }); it('should return null for Divide By Zero', async function () { @@ -1159,16 +1153,12 @@ describe('OutOfBounds', () => { // note that all division in CQL (except truncated division) is really decimal division // note also that MAX_LONG_VALUE is (2^63)-1, // 9223372036854775807 = 7^2 * 73 * 127 * 337 * 92737 * 649657 - should(await this.longDivideNearOverflow.exec(this.ctx)).equalDecimal( - Decimal.from(99457304386111n) - ); + should(await this.longDivideNearOverflow.exec(this.ctx)).equalDecimal(99457304386111n); }); it('should return value for Divide near underflow', async function () { // not really near underflow, but near JavaScript min safe number - should(await this.longDivideNearUnderflow.exec(this.ctx)).equalDecimal( - Decimal.from(-9007199254740992n) - ); + should(await this.longDivideNearUnderflow.exec(this.ctx)).equalDecimal(-9007199254740992n); }); it('should return null for Divide By Zero', async function () { diff --git a/test/elm/convert/convert-test.ts b/test/elm/convert/convert-test.ts index c99fb3b18..ec396ae65 100644 --- a/test/elm/convert/convert-test.ts +++ b/test/elm/convert/convert-test.ts @@ -29,7 +29,7 @@ describe('FromString', () => { }); it("should convert '10.2' to Decimal", async function () { - (await this.decimalValid.exec(this.ctx)).should.equalDecimal(Decimal.from(10.2)); + (await this.decimalValid.exec(this.ctx)).should.equalDecimal(10.2); }); it("should be null trying to convert 'abc' to Decimal", async function () { @@ -62,25 +62,25 @@ describe('FromString', () => { it('should convert "10 \'A\'" to Quantity', async function () { const quantity = await this.quantityStr.exec(this.ctx); - quantity.value.should.equalDecimal(Decimal.from(10)); + quantity.value.should.equalDecimal(10); quantity.unit.should.equal('A'); }); it('should convert "+10 \'A\'" to Quantity', async function () { const quantity = await this.posQuantityStr.exec(this.ctx); - quantity.value.should.equalDecimal(Decimal.from(10)); + quantity.value.should.equalDecimal(10); quantity.unit.should.equal('A'); }); it('should convert "-10 \'A\'" to Quantity', async function () { const quantity = await this.negQuantityStr.exec(this.ctx); - quantity.value.should.equalDecimal(Decimal.from(-10)); + quantity.value.should.equalDecimal(-10); quantity.unit.should.equal('A'); }); it('should convert "10.0\'mA\'" to Quantity', async function () { const quantity = await this.quantityStrDecimal.exec(this.ctx); - quantity.value.should.equalDecimal(Decimal.from(10.0)); + quantity.value.should.equalDecimal(10.0); quantity.unit.should.equal('mA'); }); @@ -129,7 +129,7 @@ describe('FromInteger', () => { }); it('should convert 10 to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.equalDecimal(Decimal.from(10.0)); + (await this.decimal10.exec(this.ctx)).should.equalDecimal(10.0); }); it('should convert null to null', async function () { @@ -155,7 +155,7 @@ describe('FromLong', () => { }); it('should convert 10L to 10.0', async function () { - (await this.decimal10.exec(this.ctx)).should.equalDecimal(Decimal.from(10.0)); + (await this.decimal10.exec(this.ctx)).should.equalDecimal(10.0); }); it('should convert null to null', async function () { @@ -186,7 +186,7 @@ describe('FromQuantity', () => { it('should convert "10 \'A\'" to "10 \'A\'"', async function () { const quantity = await this.quantityQuantity.exec(this.ctx); - quantity.value.should.equalDecimal(Decimal.from(10)); + quantity.value.should.equalDecimal(10); quantity.unit.should.equal('A'); }); }); @@ -243,7 +243,7 @@ describe('FromDateTime', () => { dateTime.minute.should.equal(1); dateTime.second.should.equal(2); dateTime.millisecond.should.equal(321); - dateTime.timezoneOffset.should.equalDecimal(Decimal.from(-6)); + dateTime.timezoneOffset.should.equalDecimal(-6); }); }); @@ -345,19 +345,19 @@ describe('ToDecimal', () => { }); it("should convert '0.0' to 0.0", async function () { - (await this.noSign.exec(this.ctx)).should.equalDecimal(Decimal.from(0.0)); + (await this.noSign.exec(this.ctx)).should.equalDecimal(0.0); }); it("should convert '+1.1' to 1.1", async function () { - (await this.positiveSign.exec(this.ctx)).should.equalDecimal(Decimal.from(1.1)); + (await this.positiveSign.exec(this.ctx)).should.equalDecimal(1.1); }); it("should convert '-1.1' to -1.1", async function () { - (await this.negativeSign.exec(this.ctx)).should.equalDecimal(Decimal.from(-1.1)); + (await this.negativeSign.exec(this.ctx)).should.equalDecimal(-1.1); }); it('should truncate decimal to 8 digits after decimal point', async function () { - (await this.tooPrecise.exec(this.ctx)).should.equalDecimal(Decimal.from('0.44444444')); + (await this.tooPrecise.exec(this.ctx)).should.equalDecimal('0.44444444'); }); it('should be null for decimal that is above max decimal value', async function () { @@ -384,7 +384,7 @@ describe('ToDecimal', () => { }); it('should accept an integer-form Decimal string', async function () { - (await this.integerFormat.exec(this.ctx)).should.equalDecimal(Decimal.from(1)); + (await this.integerFormat.exec(this.ctx)).should.equalDecimal(1); }); it('should format Decimals in fixed-point notation', async function () { @@ -576,17 +576,17 @@ describe('ToRatio', () => { it('should be valid given quantities with custom UCUM units', async function () { const ratio = await this.isValidWithCustomUCUM.exec(this.ctx); - ratio.numerator.value.should.equalDecimal(Decimal.from(1.0)); + ratio.numerator.value.should.equalDecimal(1.0); ratio.numerator.unit.should.eql('{foo:bar}'); - ratio.denominator.value.should.equalDecimal(Decimal.from(2.0)); + ratio.denominator.value.should.equalDecimal(2.0); ratio.denominator.unit.should.eql('mg'); }); it('should create valid ratio', async function () { const ratio = await this.isValid.exec(this.ctx); - ratio.numerator.value.should.equalDecimal(Decimal.from(1.0)); + ratio.numerator.value.should.equalDecimal(1.0); ratio.numerator.unit.should.eql('mg'); - ratio.denominator.value.should.equalDecimal(Decimal.from(2.0)); + ratio.denominator.value.should.equalDecimal(2.0); ratio.denominator.unit.should.eql('mg'); }); }); diff --git a/test/elm/datetime/datetime-test.ts b/test/elm/datetime/datetime-test.ts index 95c449818..bc35d166e 100644 --- a/test/elm/datetime/datetime-test.ts +++ b/test/elm/datetime/datetime-test.ts @@ -100,7 +100,7 @@ describe('DateTime', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.equalDecimal(Decimal.from(-8)); + d.timezoneOffset.should.equalDecimal(-8); }); }); @@ -239,7 +239,7 @@ describe('Now', () => { should.exist(now.minute); should.exist(now.second); should.exist(now.millisecond); - now.timezoneOffset.should.equalDecimal(Decimal.from(0)); + now.timezoneOffset.should.equalDecimal(0); }); it('should return all date components representing now using a passed in timezone using a child context', async function () { @@ -261,7 +261,7 @@ describe('Now', () => { should.exist(now.second); should.exist(now.millisecond); now.timezoneOffset.should.equalDecimal(this.child_ctx.getTimezoneOffset()); - now.timezoneOffset.should.equalDecimal(Decimal.from(0)); + now.timezoneOffset.should.equalDecimal(0); }); }); @@ -409,13 +409,13 @@ describe('TimezoneOffsetFrom', () => { }); it('should return the timezoneoffset from a fully defined DateTime', async function () { - (await this.centralEuropean.exec(this.ctx)).should.equalDecimal(Decimal.from(1)); - (await this.easternStandard.exec(this.ctx)).should.equalDecimal(Decimal.from(-5)); + (await this.centralEuropean.exec(this.ctx)).should.equalDecimal(1); + (await this.easternStandard.exec(this.ctx)).should.equalDecimal(-5); }); it('should return the default timezone when not specified', async function () { (await this.defaultTimezone.exec(this.ctx)).should.equalDecimal( - Decimal.from((new Date().getTimezoneOffset() / 60) * -1) + (new Date().getTimezoneOffset() / 60) * -1 ); }); diff --git a/test/elm/interval/interval-test.ts b/test/elm/interval/interval-test.ts index 207073d11..0be46dff7 100644 --- a/test/elm/interval/interval-test.ts +++ b/test/elm/interval/interval-test.ts @@ -4,7 +4,7 @@ const data = require('./data'); import { Interval } from '../../../src/datatypes/interval'; import { DateTime, MIN_DATETIME_VALUE, MAX_DATETIME_VALUE } from '../../../src/datatypes/datetime'; import { Uncertainty } from '../../../src/datatypes/uncertainty'; -import { Decimal, MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; +import { MAX_DECIMAL_VALUE, MIN_DECIMAL_VALUE } from '../../../src/datatypes/decimal'; import { MIN_INT_VALUE, MAX_INT_VALUE, @@ -1618,10 +1618,10 @@ describe('Width', () => { it('should calculate the width of real intervals', async function () { // define RealWidth: width of Interval[1.23, 4.56] - (await this.realWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.33)); + (await this.realWidth.exec(this.ctx)).should.equalDecimal(3.33); // define RealOpenWidth: width of Interval(1.23, 4.56) // width of Interval(1.23, 4.56) = predecessor(4.56) - successor (1.23) = 4.55 - 1.24 = 3.31 - (await this.realOpenWidth.exec(this.ctx)).should.equalDecimal(Decimal.from(3.31)); + (await this.realOpenWidth.exec(this.ctx)).should.equalDecimal(3.31); }); it('should calculate the width of infinite intervals', async function () { @@ -1645,7 +1645,7 @@ describe('Width', () => { it('should calculate the width of interval of quantities', async function () { // define WidthOfQuantityInterval: width of Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}] const width = await this.widthOfQuantityInterval.exec(this.ctx); - width.value.should.equalDecimal(Decimal.from(9)); + width.value.should.equalDecimal(9); width.unit.should.equal('mm'); }); @@ -1686,10 +1686,10 @@ describe('Size', () => { it('should calculate the size of real intervals', async function () { // define RealSize: Size(Interval[1.23, 4.56]) - (await this.realSize.exec(this.ctx)).should.equalDecimal(Decimal.from('3.33000001')); + (await this.realSize.exec(this.ctx)).should.equalDecimal('3.33000001'); // define RealOpenSize: Size(Interval(1.23, 4.56)) // (1.23, 4.56) --> [1.24, 4.55], 4.55 - 1.24 = 3.31 - (await this.realOpenSize.exec(this.ctx)).should.equalDecimal(Decimal.from('3.31000001')); + (await this.realOpenSize.exec(this.ctx)).should.equalDecimal('3.31000001'); }); it('should calculate the size of infinite intervals', async function () { @@ -1723,7 +1723,7 @@ describe('Size', () => { it('should calculate size of interval of quantities', async function () { // define SizeOfQuantityInterval: Size(Interval[Quantity{value: 1, unit: 'mm'}, Quantity{value: 10, unit: 'mm'}]) const size = await this.sizeOfQuantityInterval.exec(this.ctx); - size.value.should.equalDecimal(Decimal.from(9.00000001)); + size.value.should.equalDecimal(9.00000001); size.unit.should.equal('mm'); }); @@ -1759,9 +1759,7 @@ describe('Start', () => { it('should return the minimum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal( - Decimal.from(5) - ); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(5); }); it('should return the minimum possible Integer', async function () { @@ -1811,9 +1809,7 @@ describe('End', () => { it('should return the maximum possible DateTime in timzoneOffset of context', async function () { // set execution timestamp to be +5 this.ctx.executionDateTime = new DateTime(2019, 10, 1, 12, 31, 31, 2, 5); - (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal( - Decimal.from(5) - ); + (await this.closedNullDateTime.exec(this.ctx)).timezoneOffset.should.equalDecimal(5); }); it('should return the maximum possible Integer', async function () { diff --git a/test/elm/literal/literal-test.ts b/test/elm/literal/literal-test.ts index c409a696d..fc0813845 100644 --- a/test/elm/literal/literal-test.ts +++ b/test/elm/literal/literal-test.ts @@ -1,6 +1,5 @@ import should from 'should'; import setup from '../../setup'; -import { Decimal } from '../../../src/datatypes/decimal'; const data = require('./data'); describe('Literal', () => { @@ -41,11 +40,11 @@ describe('Literal', () => { }); it('should convert .1 to decimal .1', function () { - this.decimalTenth.value.should.equalDecimal(Decimal.from(0.1)); + this.decimalTenth.value.should.equalDecimal(0.1); }); it('should execute .1 as .1', async function () { - (await this.decimalTenth.exec(this.ctx)).should.equalDecimal(Decimal.from(0.1)); + (await this.decimalTenth.exec(this.ctx)).should.equalDecimal(0.1); }); it("should convert 'true' to string 'true'", function () { @@ -66,7 +65,7 @@ describe('Literal', () => { d.minute.should.equal(10); d.second.should.equal(59); d.millisecond.should.equal(456); - d.timezoneOffset.should.equalDecimal(Decimal.from(0)); + d.timezoneOffset.should.equalDecimal(0); }); it("should execute '' as correct Time", async function () { diff --git a/test/elm/message/message-test.ts b/test/elm/message/message-test.ts index 67d1243c0..c52f4851f 100644 --- a/test/elm/message/message-test.ts +++ b/test/elm/message/message-test.ts @@ -2,7 +2,6 @@ import should from 'should'; import setup from '../../setup'; const data = require('./data'); import { Repository } from '../../../src/cql'; -import { Decimal } from '../../../src/datatypes/decimal'; describe('Message', () => { let messageCollector: any; @@ -14,7 +13,7 @@ describe('Message', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(0.5)); + (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(0.5); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); @@ -40,7 +39,7 @@ describe('Retrieve', () => { }); it('should always return the first argument as-is', async function () { - (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(Decimal.from(0.5)); + (await this.oneOverTwo.exec(this.ctx)).should.equalDecimal(0.5); should(await this.oneOverZero.exec(this.ctx)).be.null(); }); diff --git a/test/elm/parameters/parameters-test.ts b/test/elm/parameters/parameters-test.ts index b450a217e..82ae5eb38 100644 --- a/test/elm/parameters/parameters-test.ts +++ b/test/elm/parameters/parameters-test.ts @@ -101,7 +101,7 @@ describe('DecimalParameterTypes', () => { it('should execute to provided valid value', async function () { (await this.foo.exec(this.ctx.withParameters({ FooP: Decimal.from(3.0) }))).should.equalDecimal( - Decimal.from(3.0) + 3.0 ); }); @@ -110,13 +110,13 @@ describe('DecimalParameterTypes', () => { }); it('should execute to default value', async function () { - (await this.foo2.exec(this.ctx)).should.equalDecimal(Decimal.from(1.5)); + (await this.foo2.exec(this.ctx)).should.equalDecimal(1.5); }); it('should execute to overriding valid value', async function () { ( await this.foo2.exec(this.ctx.withParameters({ FooDP: Decimal.from(3.0) })) - ).should.equalDecimal(Decimal.from(3.0)); + ).should.equalDecimal(3.0); }); it('should throw when overriding value is wrong type', function () { diff --git a/test/elm/quantity/quantity-test.ts b/test/elm/quantity/quantity-test.ts index 81a4afb99..74817d03c 100644 --- a/test/elm/quantity/quantity-test.ts +++ b/test/elm/quantity/quantity-test.ts @@ -6,7 +6,6 @@ import { doSubtraction, Quantity } from '../../../src/datatypes/quantity'; -import { Decimal } from '../../../src/datatypes/decimal'; describe('Quantity', () => { it('should allow creation of Quantity with valid ucum units', () => @@ -63,7 +62,7 @@ describe('Quantity', () => { const denominator = new Quantity(2.0, 'mg'); const result = numerator.dividedBy(denominator); result.unit.should.equal('1'); - result.value.should.equalDecimal(Decimal.from(-2.75)); + result.value.should.equalDecimal(-2.75); }); it('should allow for singular time units', () => { diff --git a/test/elm/query/query-test.ts b/test/elm/query/query-test.ts index cc25054c5..7a237d8eb 100644 --- a/test/elm/query/query-test.ts +++ b/test/elm/query/query-test.ts @@ -7,7 +7,6 @@ import { Interval } from '../../../src/datatypes/interval'; import { DateTime } from '../../../src/datatypes/datetime'; import { Quantity } from '../../../src/datatypes/quantity'; import { getLocalIdByPath } from '../../testHelpers'; -import { Decimal } from '../../../src/datatypes/decimal'; describe('DateRangeOptimizedQuery', () => { beforeEach(function () { @@ -197,12 +196,12 @@ describe('Sorting', () => { it('should correctly sort quantities asc', async function () { const e = await this.quantityListAsc.exec(this.ctx); e.should.have.length(2); - e[0]['value'].should.equalDecimal(Decimal.from(2)); + e[0]['value'].should.equalDecimal(2); }); it('should correctly sort quantities', async function () { const e = await this.quantityListSort.exec(this.ctx); - e[0]['N']['value'].should.equalDecimal(Decimal.from(2)); + e[0]['N']['value'].should.equalDecimal(2); }); it('should be able to sort by a tuple field asc', async function () { diff --git a/test/util/math-test.ts b/test/util/math-test.ts index 2576d29e1..11a411043 100644 --- a/test/util/math-test.ts +++ b/test/util/math-test.ts @@ -12,8 +12,8 @@ describe('successor', () => { it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from('1.0'), Decimal.from('2.0'))); - result.low.should.equalDecimal(Decimal.from('1.1')); - result.high.should.equalDecimal(Decimal.from('2.1')); + result.low.should.equalDecimal('1.1'); + result.high.should.equalDecimal('2.1'); }); it('should leave the uncertainty high unchanged when it overflows', () => { @@ -31,8 +31,8 @@ describe('predecessor', () => { it('should preserve decimals in an Uncertainty', () => { const result = successor(new Uncertainty(Decimal.from('1.0'), Decimal.from('2.0'))); - result.low.should.equalDecimal(Decimal.from('1.1')); - result.high.should.equalDecimal(Decimal.from('2.1')); + result.low.should.equalDecimal('1.1'); + result.high.should.equalDecimal('2.1'); }); it('should leave the uncertainty low unchanged when it underflows', () => { @@ -45,7 +45,7 @@ describe('finalizeNumericResult', () => { it('should normalize Decimal results to eight places using the implicit rounding mode', () => { const result = finalizeNumericResult(Decimal.from('1.234567895')); - result.should.equalDecimal(Decimal.from('1.23456790')); + result.should.equalDecimal('1.23456790'); }); it('should return a new normalized Uncertainty without modifying the input', () => { @@ -53,9 +53,9 @@ describe('finalizeNumericResult', () => { const result = finalizeNumericResult(input); result.should.not.equal(input); - input.low.should.equalDecimal(Decimal.from('1.234567895')); - input.high.should.equalDecimal(Decimal.from('2.345678995')); - result.low.should.equalDecimal(Decimal.from('1.23456790')); - result.high.should.equalDecimal(Decimal.from('2.34567900')); + input.low.should.equalDecimal('1.234567895'); + input.high.should.equalDecimal('2.345678995'); + result.low.should.equalDecimal('1.23456790'); + result.high.should.equalDecimal('2.34567900'); }); }); diff --git a/test/util/units-test.ts b/test/util/units-test.ts index 21c8771c9..670ad1dd9 100644 --- a/test/util/units-test.ts +++ b/test/util/units-test.ts @@ -109,30 +109,30 @@ describe('checkUnit', () => { describe('convertUnit', () => { it('should convert compatible units', () => { - convertUnit(Decimal.from(18), '[in_i]', '[ft_i]').should.equalDecimal(Decimal.from(1.5)); + convertUnit(Decimal.from(18), '[in_i]', '[ft_i]').should.equalDecimal(1.5); }); it('should return same value for same units', () => { - convertUnit(Decimal.from(18), '[in_i]', '[in_i]').should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(18), '[in_i]', '[in_i]').should.equalDecimal(18); }); it('should consider empty as 1 during conversion', () => { - convertUnit(Decimal.from(18), '', '').should.equalDecimal(Decimal.from(18)); - convertUnit(Decimal.from(18), null, null).should.equalDecimal(Decimal.from(18)); - convertUnit(Decimal.from(18), '', null).should.equalDecimal(Decimal.from(18)); - convertUnit(Decimal.from(18), null, '').should.equalDecimal(Decimal.from(18)); + convertUnit(Decimal.from(18), '', '').should.equalDecimal(18); + convertUnit(Decimal.from(18), null, null).should.equalDecimal(18); + convertUnit(Decimal.from(18), '', null).should.equalDecimal(18); + convertUnit(Decimal.from(18), null, '').should.equalDecimal(18); }); it('should support CQL date units during conversion', () => { - convertUnit(Decimal.from(18), 'months', 'years').should.equalDecimal(Decimal.from(1.5)); - convertUnit(Decimal.from(1.5), 'years', 'months').should.equalDecimal(Decimal.from(18)); - convertUnit(Decimal.from(2), 'seconds', 'milliseconds').should.equalDecimal(Decimal.from(2000)); - convertUnit(Decimal.from(2000), 'milliseconds', 'seconds').should.equalDecimal(Decimal.from(2)); + convertUnit(Decimal.from(18), 'months', 'years').should.equalDecimal(1.5); + convertUnit(Decimal.from(1.5), 'years', 'months').should.equalDecimal(18); + convertUnit(Decimal.from(2), 'seconds', 'milliseconds').should.equalDecimal(2000); + convertUnit(Decimal.from(2000), 'milliseconds', 'seconds').should.equalDecimal(2); }); it('should truncate precision to 8 decimals by default', () => { const result = convertUnit(Decimal.from(1), '[ft_i]', '[mi_i]'); - result.should.equalDecimal(Decimal.from('0.00018939')); + result.should.equalDecimal('0.00018939'); }); it('should return undefined for incompatible units', () => { From 4a7f549dbb8c8aa24bdde48a94afa70386dfc743 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 14:50:35 -0400 Subject: [PATCH 41/62] bump dependency, add csv-parse override to pass npm audit --- package-lock.json | 12 ++++++------ package.json | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e391eb81..c80f83831 100644 --- a/package-lock.json +++ b/package-lock.json @@ -793,9 +793,9 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.1.tgz", - "integrity": "sha512-S99WuO3HlhO3XN41EtYUNl9zzXjoJx7QvmipxsJVxtCBT0YHEFy+iOJhjSvrmV12nYhWpZaM8lPHkJm0yUMbag==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "dev": true, "license": "MIT", "dependencies": { @@ -2027,9 +2027,9 @@ } }, "node_modules/csv-parse": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", - "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-7.0.2.tgz", + "integrity": "sha512-uKZghv9UmPkMVLYy//KZ9HFAIJsl7wkhoEdIL0+rhuSY9pZQlhaeGEDPIe+/w7eh81MOql8Q/9+inAGWG6ZHYA==", "license": "MIT" }, "node_modules/csv-stringify": { diff --git a/package.json b/package.json index c06af919c..cc350928a 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,8 @@ "overrides": { "mocha": { "serialize-javascript": "^7.0.3" - } + }, + "csv-parse": "^7.0.2" }, "main": "lib/cql", "types": "lib/cql.d.ts", From b3a28d875cd1c08395fc3c4fe3994031783ccc6e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 15:08:32 -0400 Subject: [PATCH 42/62] quick test cleanup --- test/elm/arithmetic/arithmetic-test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 67f80f136..80780898f 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -565,13 +565,11 @@ describe('Ln', () => { }); it('should be able to return the natural log of a number', async function () { - const log4 = Decimal.from('1.3862943611198906').normalized(); - (await this.ln.exec(this.ctx)).should.equalDecimal(log4); + (await this.ln.exec(this.ctx)).should.equalDecimal('1.38629436'); // 1.3862943611198906 to 8 decimal places }); it('should be able to return the natural log of a long', async function () { - const log4 = Decimal.from('1.3862943611198906').normalized(); - (await this.lnFourLong.exec(this.ctx)).should.equalDecimal(log4); + (await this.lnFourLong.exec(this.ctx)).should.equalDecimal('1.38629436'); }); }); From f189a0dceb64f3f427cb2ea6d28b5cfe14a7d353 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 15:23:55 -0400 Subject: [PATCH 43/62] add number type option to Date.getDateTime parameter --- src/datatypes/datetime.ts | 2 +- test/datatypes/date-test.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/datatypes/datetime.ts b/src/datatypes/datetime.ts index b406d704b..aac32cc77 100644 --- a/src/datatypes/datetime.ts +++ b/src/datatypes/datetime.ts @@ -1213,7 +1213,7 @@ export class Date extends AbstractDate { return str; } - getDateTime(timeZoneOffset?: Decimal | null) { + getDateTime(timeZoneOffset?: Decimal | number | null) { // from the spec: the result will be a DateTime with the time components unspecified, // except for the timezone offset, which will be set to the timezone offset of the evaluation // request timestamp. (this last part is achieved by passing in the timeZoneOffset from the context) diff --git a/test/datatypes/date-test.ts b/test/datatypes/date-test.ts index c4e433b52..e2d1bb8f6 100644 --- a/test/datatypes/date-test.ts +++ b/test/datatypes/date-test.ts @@ -3,7 +3,6 @@ import should from 'should'; import { Date, DateTime, MAX_DATE_VALUE, MIN_DATE_VALUE } from '../../src/datatypes/datetime'; import { Uncertainty } from '../../src/datatypes/uncertainty'; import { jsDate } from '../../src/util/util'; -import { Decimal } from '../../src/datatypes/decimal'; describe('Date', () => { it('should properly set all properties when constructed', () => { @@ -885,7 +884,7 @@ describe('Date.getPrecisionValue', () => { describe('Date.getDateTime', () => { it('should return a DateTime that has the passed in timeZoneOffset', () => { const d = new Date(2000, 12, 1); - const dateTime = d.getDateTime(Decimal.from(2)); + const dateTime = d.getDateTime(2); dateTime.year.should.equal(2000); dateTime.month.should.equal(12); dateTime.day.should.equal(1); From 405bd94c0a9e2d5db77de28689c8c2f8e98b5757 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 9 Sep 2026 15:36:49 -0400 Subject: [PATCH 44/62] make edge case tests more clearly edge cases --- test/elm/aggregate/data.cql | 8 +- test/elm/aggregate/data.js | 327 +++++++++++++++++++----------------- 2 files changed, 177 insertions(+), 158 deletions(-) diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index 60fa73630..1ab8bb24b 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -17,18 +17,18 @@ define longs_at_min_value: Sum({-1L,-2L,-9223372036854775805L}) // -922337203685 define longs_below_min_value: Sum({-1L,-2L,-9223372036854775806L}) //-9223372036854775809 define decimals: Sum({1.1,2.2,3.3,4.4,5.5}) define decimals_at_max_value: Sum({99999999999999999999.99999999}) -define decimals_above_max_value: Sum({99999999999999999999.99999999, 99999999999999999999.99999999}) +define decimals_above_max_value: Sum({99999999999999999999.99999999, 0.00000001}) define decimals_at_min_value: Sum({-99999999999999999999.99999999}) -define decimals_below_min_value: Sum({-99999999999999999999.99999999, -99999999999999999999.99999999}) +define decimals_below_min_value: Sum({-99999999999999999999.99999999, -0.00000001}) define quantities: Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) // Max/Min-valued quantities are described using the "maximum" and "minimum" operators // to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal define MaxValueMLQuantity: Quantity { value: maximum Decimal, unit: 'ml' } define MinValueMLQuantity: Quantity { value: minimum Decimal, unit: 'ml' } define quantities_at_max_value: Sum({MaxValueMLQuantity}) -define quantities_above_max_value: Sum({MaxValueMLQuantity, MaxValueMLQuantity}) +define quantities_above_max_value: Sum({MaxValueMLQuantity, 0.00000001'ml' }) define quantities_at_min_value: Sum({MinValueMLQuantity}) -define quantities_below_min_value: Sum({MinValueMLQuantity, MinValueMLQuantity}) +define quantities_below_min_value: Sum({MinValueMLQuantity, -0.00000001'ml'}) define has_null: Sum({1,null,null,null,2}) define has_null_q: Sum({1 'ml',null,null,null,2 'ml'}) define unmatched_units_q: Min({1 'ml',2 'm',3 'ml',4 'ml',5 'ml',0 'ml'}) diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index 7173f9b42..e1ef717a5 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -495,18 +495,18 @@ define longs_at_min_value: Sum({-1L,-2L,-9223372036854775805L}) // -922337203685 define longs_below_min_value: Sum({-1L,-2L,-9223372036854775806L}) //-9223372036854775809 define decimals: Sum({1.1,2.2,3.3,4.4,5.5}) define decimals_at_max_value: Sum({99999999999999999999.99999999}) -define decimals_above_max_value: Sum({99999999999999999999.99999999, 99999999999999999999.99999999}) +define decimals_above_max_value: Sum({99999999999999999999.99999999, 0.00000001}) define decimals_at_min_value: Sum({-99999999999999999999.99999999}) -define decimals_below_min_value: Sum({-99999999999999999999.99999999, -99999999999999999999.99999999}) +define decimals_below_min_value: Sum({-99999999999999999999.99999999, -0.00000001}) define quantities: Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'}) // Max/Min-valued quantities are described using the "maximum" and "minimum" operators // to avoid the translator rounding them to +/-1.0e20, which is not a legal Decimal define MaxValueMLQuantity: Quantity { value: maximum Decimal, unit: 'ml' } define MinValueMLQuantity: Quantity { value: minimum Decimal, unit: 'ml' } define quantities_at_max_value: Sum({MaxValueMLQuantity}) -define quantities_above_max_value: Sum({MaxValueMLQuantity, MaxValueMLQuantity}) +define quantities_above_max_value: Sum({MaxValueMLQuantity, 0.00000001'ml' }) define quantities_at_min_value: Sum({MinValueMLQuantity}) -define quantities_below_min_value: Sum({MinValueMLQuantity, MinValueMLQuantity}) +define quantities_below_min_value: Sum({MinValueMLQuantity, -0.00000001'ml'}) define has_null: Sum({1,null,null,null,2}) define has_null_q: Sum({1 'ml',null,null,null,2 'ml'}) define unmatched_units_q: Min({1 'ml',2 'm',3 'ml',4 'ml',5 'ml',0 'ml'}) @@ -528,7 +528,7 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "694", + "r" : "696", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -1893,7 +1893,7 @@ module.exports['Sum'] = { "r" : "435", "s" : [ { "r" : "436", - "value" : [ "{", "99999999999999999999.99999999", ", ", "99999999999999999999.99999999", "}" ] + "value" : [ "{", "99999999999999999999.99999999", ", ", "0.00000001", "}" ] } ] }, { "value" : [ ")" ] @@ -1944,7 +1944,7 @@ module.exports['Sum'] = { "localId" : "437", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "99999999999999999999.99999999", + "value" : "0.00000001", "annotation" : [ ] } ] } @@ -2071,7 +2071,7 @@ module.exports['Sum'] = { "r" : "470", "s" : [ { "r" : "471", - "value" : [ "-", "99999999999999999999.99999999" ] + "value" : [ "-", "0.00000001" ] } ] }, { "value" : [ "}" ] @@ -2148,7 +2148,7 @@ module.exports['Sum'] = { "localId" : "471", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "99999999999999999999.99999999", + "value" : "0.00000001", "annotation" : [ ] } } ] @@ -2542,10 +2542,10 @@ module.exports['Sum'] = { }, { "r" : "537", "s" : [ { - "value" : [ "MaxValueMLQuantity" ] + "value" : [ "0.00000001", "'ml'" ] } ] }, { - "value" : [ "}" ] + "value" : [ " }" ] } ] }, { "value" : [ ")" ] @@ -2591,10 +2591,11 @@ module.exports['Sum'] = { "name" : "MaxValueMLQuantity", "annotation" : [ ] }, { - "type" : "ExpressionRef", + "type" : "Quantity", "localId" : "537", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "MaxValueMLQuantity", + "value" : 1.0E-8, + "unit" : "ml", "annotation" : [ ] } ] } @@ -2688,7 +2689,7 @@ module.exports['Sum'] = { "s" : [ { "value" : [ "", "define ", "quantities_below_min_value", ": " ] }, { - "r" : "573", + "r" : "575", "s" : [ { "value" : [ "Sum", "(" ] }, { @@ -2705,7 +2706,12 @@ module.exports['Sum'] = { }, { "r" : "566", "s" : [ { - "value" : [ "MinValueMLQuantity" ] + "value" : [ "-" ] + }, { + "r" : "567", + "s" : [ { + "value" : [ "0.00000001", "'ml'" ] + } ] } ] }, { "value" : [ "}" ] @@ -2718,16 +2724,16 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "573", + "localId" : "575", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "574", + "localId" : "576", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "575", + "localId" : "577", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -2738,11 +2744,11 @@ module.exports['Sum'] = { "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "567", + "localId" : "569", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "568", + "localId" : "570", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } @@ -2754,16 +2760,29 @@ module.exports['Sum'] = { "name" : "MinValueMLQuantity", "annotation" : [ ] }, { - "type" : "ExpressionRef", + "type" : "Negate", "localId" : "566", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", - "name" : "MinValueMLQuantity", - "annotation" : [ ] + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "568", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Quantity", + "localId" : "567", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "value" : 1.0E-8, + "unit" : "ml", + "annotation" : [ ] + } } ] } } }, { - "localId" : "578", + "localId" : "580", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "has_null", "context" : "Patient", @@ -2772,17 +2791,17 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "578", + "r" : "580", "s" : [ { "value" : [ "", "define ", "has_null", ": " ] }, { - "r" : "594", + "r" : "596", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "579", + "r" : "581", "s" : [ { - "r" : "580", + "r" : "582", "value" : [ "{", "1", ",", "null", ",", "null", ",", "null", ",", "2", "}" ] } ] }, { @@ -2793,81 +2812,81 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "594", + "localId" : "596", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "595", + "localId" : "597", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "596", + "localId" : "598", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "579", + "localId" : "581", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "588", + "localId" : "590", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "589", + "localId" : "591", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } }, "element" : [ { "type" : "Literal", - "localId" : "580", + "localId" : "582", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", "annotation" : [ ] }, { "type" : "As", - "localId" : "585", + "localId" : "587", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "581", + "localId" : "583", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "586", + "localId" : "588", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "582", + "localId" : "584", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "587", + "localId" : "589", "asType" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "583", + "localId" : "585", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "Literal", - "localId" : "584", + "localId" : "586", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "2", @@ -2876,7 +2895,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "599", + "localId" : "601", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "has_null_q", "context" : "Patient", @@ -2885,27 +2904,27 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "599", + "r" : "601", "s" : [ { "value" : [ "", "define ", "has_null_q", ": " ] }, { - "r" : "615", + "r" : "617", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "600", + "r" : "602", "s" : [ { "value" : [ "{" ] }, { - "r" : "601", + "r" : "603", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { - "r" : "602", + "r" : "604", "value" : [ ",", "null", ",", "null", ",", "null", "," ] }, { - "r" : "605", + "r" : "607", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] @@ -2920,81 +2939,81 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "615", + "localId" : "617", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "616", + "localId" : "618", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "617", + "localId" : "619", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "600", + "localId" : "602", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "609", + "localId" : "611", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "610", + "localId" : "612", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "601", + "localId" : "603", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "As", - "localId" : "606", + "localId" : "608", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "602", + "localId" : "604", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "607", + "localId" : "609", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "603", + "localId" : "605", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "As", - "localId" : "608", + "localId" : "610", "asType" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ ], "operand" : { "type" : "Null", - "localId" : "604", + "localId" : "606", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", "annotation" : [ ] } }, { "type" : "Quantity", - "localId" : "605", + "localId" : "607", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", @@ -3003,7 +3022,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "620", + "localId" : "622", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "unmatched_units_q", "context" : "Patient", @@ -3012,54 +3031,54 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "620", + "r" : "622", "s" : [ { "value" : [ "", "define ", "unmatched_units_q", ": " ] }, { - "r" : "634", + "r" : "636", "s" : [ { "value" : [ "Min", "(" ] }, { - "r" : "621", + "r" : "623", "s" : [ { "value" : [ "{" ] }, { - "r" : "622", + "r" : "624", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "623", + "r" : "625", "s" : [ { "value" : [ "2 ", "'m'" ] } ] }, { "value" : [ "," ] }, { - "r" : "624", + "r" : "626", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "625", + "r" : "627", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "626", + "r" : "628", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "627", + "r" : "629", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -3074,73 +3093,73 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Min", - "localId" : "634", + "localId" : "636", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "635", + "localId" : "637", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "636", + "localId" : "638", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "621", + "localId" : "623", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "628", + "localId" : "630", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "629", + "localId" : "631", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "622", + "localId" : "624", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "623", + "localId" : "625", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "m", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "624", + "localId" : "626", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "625", + "localId" : "627", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "626", + "localId" : "628", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "627", + "localId" : "629", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -3149,7 +3168,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "639", + "localId" : "641", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "name" : "empty", "context" : "Patient", @@ -3158,19 +3177,19 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "639", + "r" : "641", "s" : [ { "value" : [ "", "define ", "empty", ": " ] }, { - "r" : "649", + "r" : "651", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "641", + "r" : "643", "s" : [ { "value" : [ "List<" ] }, { - "r" : "640", + "r" : "642", "s" : [ { "value" : [ "Integer" ] } ] @@ -3185,31 +3204,31 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "649", + "localId" : "651", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "650", + "localId" : "652", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "651", + "localId" : "653", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "641", + "localId" : "643", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "643", + "localId" : "645", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "644", + "localId" : "646", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } @@ -3218,7 +3237,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "654", + "localId" : "656", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "q_diff_units", "context" : "Patient", @@ -3227,47 +3246,47 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "654", + "r" : "656", "s" : [ { "value" : [ "", "define ", "q_diff_units", ": " ] }, { - "r" : "667", + "r" : "669", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "655", + "r" : "657", "s" : [ { "value" : [ "{" ] }, { - "r" : "656", + "r" : "658", "s" : [ { "value" : [ "1 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "657", + "r" : "659", "s" : [ { "value" : [ "0.002 ", "'l'" ] } ] }, { "value" : [ "," ] }, { - "r" : "658", + "r" : "660", "s" : [ { "value" : [ "0.03 ", "'dl'" ] } ] }, { "value" : [ "," ] }, { - "r" : "659", + "r" : "661", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "660", + "r" : "662", "s" : [ { "value" : [ "0.005 ", "'l'" ] } ] @@ -3282,66 +3301,66 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "667", + "localId" : "669", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "668", + "localId" : "670", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "669", + "localId" : "671", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "655", + "localId" : "657", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "661", + "localId" : "663", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "662", + "localId" : "664", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "656", + "localId" : "658", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "657", + "localId" : "659", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "l", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "658", + "localId" : "660", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.03, "unit" : "dl", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "659", + "localId" : "661", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "660", + "localId" : "662", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.005, "unit" : "l", @@ -3350,7 +3369,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "672", + "localId" : "674", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "NumbersAndQuantities", "context" : "Patient", @@ -3359,48 +3378,48 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "672", + "r" : "674", "s" : [ { "value" : [ "", "define ", "NumbersAndQuantities", ": " ] }, { - "r" : "689", + "r" : "691", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "673", + "r" : "675", "s" : [ { - "r" : "674", + "r" : "676", "value" : [ "{", "1", " ," ] }, { - "r" : "675", + "r" : "677", "s" : [ { "value" : [ "2 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "676", + "r" : "678", "s" : [ { "value" : [ "3 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "677", + "r" : "679", "s" : [ { "value" : [ "4 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "678", + "r" : "680", "s" : [ { "value" : [ "5 ", "'ml'" ] } ] }, { "value" : [ "," ] }, { - "r" : "679", + "r" : "681", "s" : [ { "value" : [ "0 ", "'ml'" ] } ] @@ -3415,48 +3434,48 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "689", + "localId" : "691", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "690", + "localId" : "692", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "691", + "localId" : "693", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "673", + "localId" : "675", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "683", + "localId" : "685", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "684", + "localId" : "686", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "ToQuantity", - "localId" : "681", + "localId" : "683", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "682", + "localId" : "684", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "674", + "localId" : "676", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", "value" : "1", @@ -3464,35 +3483,35 @@ module.exports['Sum'] = { } }, { "type" : "Quantity", - "localId" : "675", + "localId" : "677", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 2, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "676", + "localId" : "678", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 3, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "677", + "localId" : "679", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 4, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "678", + "localId" : "680", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 5, "unit" : "ml", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "679", + "localId" : "681", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0, "unit" : "ml", @@ -3501,7 +3520,7 @@ module.exports['Sum'] = { } } }, { - "localId" : "694", + "localId" : "696", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "name" : "IncompatibleUnitsNull", "context" : "Patient", @@ -3510,26 +3529,26 @@ module.exports['Sum'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "694", + "r" : "696", "s" : [ { "value" : [ "", "define ", "IncompatibleUnitsNull", ": " ] }, { - "r" : "704", + "r" : "706", "s" : [ { "value" : [ "Sum", "(" ] }, { - "r" : "695", + "r" : "697", "s" : [ { "value" : [ "{" ] }, { - "r" : "696", + "r" : "698", "s" : [ { "value" : [ "1 ", "'mg/d'" ] } ] }, { "value" : [ ", " ] }, { - "r" : "697", + "r" : "699", "s" : [ { "value" : [ "0.002 ", "'/d'" ] } ] @@ -3544,45 +3563,45 @@ module.exports['Sum'] = { } ], "expression" : { "type" : "Sum", - "localId" : "704", + "localId" : "706", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ], "signature" : [ { "type" : "ListTypeSpecifier", - "localId" : "705", + "localId" : "707", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "706", + "localId" : "708", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } } ], "source" : { "type" : "List", - "localId" : "695", + "localId" : "697", "annotation" : [ ], "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", - "localId" : "698", + "localId" : "700", "annotation" : [ ], "elementType" : { "type" : "NamedTypeSpecifier", - "localId" : "699", + "localId" : "701", "name" : "{urn:hl7-org:elm-types:r1}Quantity", "annotation" : [ ] } }, "element" : [ { "type" : "Quantity", - "localId" : "696", + "localId" : "698", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 1, "unit" : "mg/d", "annotation" : [ ] }, { "type" : "Quantity", - "localId" : "697", + "localId" : "699", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", "value" : 0.002, "unit" : "/d", From 603a5c85a0b1fba50e0a9bed4004754493e9f9b3 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:28:30 -0400 Subject: [PATCH 45/62] create Decimal.truncatedDivideBy to ensure result is not rounded prior to truncation. add new flag to MathUtil.divide to specify truncated division --- src/datatypes/decimal.ts | 7 + src/datatypes/quantity.ts | 4 +- src/elm/arithmetic.ts | 15 +- src/util/math.ts | 9 +- test/datatypes/decimal-test.ts | 11 + test/elm/arithmetic/arithmetic-test.ts | 20 + test/elm/arithmetic/data.cql | 5 + test/elm/arithmetic/data.js | 2461 ++++++++++++++++-------- 8 files changed, 1715 insertions(+), 817 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index b1edcf49f..c86e1ffc0 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -128,6 +128,13 @@ export class Decimal { return unscaledResult.withMinimumScale(preferredScale); } + truncatedDivideBy(other: DecimalInput) { + if (Decimal.from(other).equals(0)) { + throw new RangeError('Cannot divide a decimal by zero'); + } + return this.applyWrapper(this.value.dividedToIntegerBy, other); + } + modulo(other: DecimalInput) { if (Decimal.from(other).equals(0)) { throw new RangeError('Cannot calculate decimal modulo by zero'); diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index 77eab93db..433ddc2d4 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -116,7 +116,7 @@ export class Quantity { return new Quantity(value, toUnit); } - dividedBy(other: any) { + dividedBy(other: any, truncated?: boolean) { if ( other == null || other === 0 || @@ -134,7 +134,7 @@ export class Quantity { other.value, other.unit ); - const resultValue = val1.divideBy(val2); + const resultValue = truncated ? val1.truncatedDivideBy(val2) : val1.divideBy(val2); const resultUnit = getQuotientOfUnits(unit1, unit2); // Check for invalid unit or value diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index bf39d8b4b..f100c5d03 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -164,20 +164,9 @@ export class TruncatedDivide extends Expression { const [x, y] = args; let quotient; if (x.isQuantity) { - quotient = x.dividedBy(y); - if (quotient instanceof Quantity) { - quotient = new Quantity(quotient.value.truncated(), quotient.unit); - } + quotient = x.dividedBy(y, true); } else { - quotient = MathUtil.divide(x, y); - - // MathUtil.divide performs truncated division for Integers and Longs implicitly - if ( - quotient != null && - (x.isDecimal || y.isDecimal || this.resultTypeName === ELM_DECIMAL_TYPE) - ) { - quotient = (quotient as Decimal).truncated(); - } + quotient = MathUtil.divide(x, y, true); } return finalizeArithmeticResult(quotient); diff --git a/src/util/math.ts b/src/util/math.ts index 934fe48eb..9d794381b 100644 --- a/src/util/math.ts +++ b/src/util/math.ts @@ -202,13 +202,14 @@ export function multiply(a: any, b: any) { throw new Error('Unsupported argument types.'); } -export function divide(a: any, b: any) { +export function divide(a: any, b: any, truncated?: boolean) { if (a.isDecimal || b.isDecimal) { - b = Decimal.from(b); - if (b.equals(0)) { + const bDecimal = Decimal.from(b); + if (bDecimal.equals(0)) { return null; } - const quotient = Decimal.from(a).divideBy(b); + const aDecimal = Decimal.from(a); + const quotient = truncated ? aDecimal.truncatedDivideBy(b) : aDecimal.divideBy(b); return overflowsOrUnderflows(quotient) ? null : quotient; } if (typeof a === 'bigint' || typeof b === 'bigint') { diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index f4511ae45..22072574b 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -95,6 +95,17 @@ describe('Decimal', () => { }); }); + describe('truncatedDivideBy', () => { + it('should truncate without rounding', () => { + Decimal.from('1.00000').truncatedDivideBy('2.0').should.equalDecimal('0'); + Decimal.from('1.99999999').truncatedDivideBy('2.0').should.equalDecimal('0'); + }); + + it('should reject a zero divisor', () => { + (() => Decimal.from(1).truncatedDivideBy(0)).should.throw(RangeError); + }); + }); + describe('modulo', () => { it('should calculate a remainder', () => { Decimal.from('5.5').modulo(2).should.equalDecimal('1.5'); diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 80780898f..ab9279190 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -503,6 +503,26 @@ describe('TruncatedDivide', () => { it('should truncate quantity division results', async function () { validateQuantity(await this.quantityTruncatedDivide.exec(this.ctx), 5, '1'); }); + + it('should truncate Decimal division results', async function () { + (await this.truncatedDivideDecimalJustAboveOne.exec(this.ctx)).should.equalDecimal(1); + }); + + it('should provide precise results above JS safe numbers', async function () { + (await this.truncatedDivideLargePositiveDecimal.exec(this.ctx)).should.equalDecimal( + '9007199254740993.0' + ); + validateQuantity( + await this.truncatedDivideLargePositiveQuantity.exec(this.ctx), + Decimal.from('9007199254740993.0'), + '1' + ); + }); + + it('should truncate before rounding the quotient', async function () { + (await this.truncatedDivideDecimalJustBelowOne.exec(this.ctx)).should.equalDecimal(0); + validateQuantity(await this.truncatedDivideQuantityJustBelowOne.exec(this.ctx), 0, '1'); + }); }); describe('Truncate', () => { diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 6812f7c04..0e0512ec2 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -109,6 +109,11 @@ define TenDivThreeLong: 10L div 3L define TenDivThreeMixed: 10 div 3L define TenDivThreeReverseMixed: 10L div 3 define QuantityTruncatedDivide: 10.5 'g' div 2.0 'g' +define TruncatedDivideLargePositiveDecimal: 9007199254740993.0 div 1.0 +define TruncatedDivideDecimalJustBelowOne: 1.99999999 div 2.0 +define TruncatedDivideDecimalJustAboveOne: 2.00000001 div 2.0 +define TruncatedDivideLargePositiveQuantity: Quantity { value: 9007199254740993.0, unit: 'g' } div Quantity { value: 1.0, unit: 'g' } +define TruncatedDivideQuantityJustBelowOne: Quantity { value: 1.99999999, unit: 'g' } div Quantity { value: 2.0, unit: 'g' } // @Test: Modulo define Mod: 3 mod 2 diff --git a/test/elm/arithmetic/data.js b/test/elm/arithmetic/data.js index b94eb9583..192282700 100644 --- a/test/elm/arithmetic/data.js +++ b/test/elm/arithmetic/data.js @@ -6809,6 +6809,11 @@ define TenDivThreeLong: 10L div 3L define TenDivThreeMixed: 10 div 3L define TenDivThreeReverseMixed: 10L div 3 define QuantityTruncatedDivide: 10.5 'g' div 2.0 'g' +define TruncatedDivideLargePositiveDecimal: 9007199254740993.0 div 1.0 +define TruncatedDivideDecimalJustBelowOne: 1.99999999 div 2.0 +define TruncatedDivideDecimalJustAboveOne: 2.00000001 div 2.0 +define TruncatedDivideLargePositiveQuantity: Quantity { value: 9007199254740993.0, unit: 'g' } div Quantity { value: 1.0, unit: 'g' } +define TruncatedDivideQuantityJustBelowOne: Quantity { value: 1.99999999, unit: 'g' } div Quantity { value: 2.0, unit: 'g' } */ module.exports['TruncatedDivide'] = { @@ -6823,7 +6828,7 @@ module.exports['TruncatedDivide'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "260", + "r" : "308", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -7250,524 +7255,1253 @@ module.exports['TruncatedDivide'] = { "annotation" : [ ] } ] } - } ] - } - } -} - -/* Modulo -library TestSnippet version '1' -using Simple version '1.0.0' -context Patient -define Mod: 3 mod 2 -define ThreeModZero: 3 mod 0 -define ThreeModTwoLong: 3L mod 2L -define ThreeModTwoMixed: 3 mod 2L -define ThreeModTwoReverseMixed: 3L mod 2 -define ThreeModZeroLong: 3L mod 0L -define ThreeModZeroDecimal: 3.0 mod 0.0 -*/ - -module.exports['Modulo'] = { - "library" : { - "localId" : "0", - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorVersion" : "4.2.0", - "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", - "signatureLevel" : "All" - }, { - "type" : "Annotation", - "t" : [ ], - "s" : { - "r" : "268", - "s" : [ { - "value" : [ "", "library TestSnippet version '1'" ] - } ] - } - } ], - "identifier" : { - "id" : "TestSnippet", - "version" : "1" - }, - "schemaIdentifier" : { - "id" : "urn:hl7-org:elm", - "version" : "r1" - }, - "usings" : { - "def" : [ { - "localId" : "1", - "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1", - "annotation" : [ ] - }, { - "localId" : "206", - "localIdentifier" : "Simple", - "uri" : "https://github.com/cqframework/cql-execution/simple", - "version" : "1.0.0", - "annotation" : [ { - "type" : "Annotation", - "t" : [ ], - "s" : { - "r" : "206", - "s" : [ { - "value" : [ "", "using " ] - }, { - "s" : [ { - "value" : [ "Simple" ] - } ] - }, { - "value" : [ " version '1.0.0'" ] - } ] - } - } ] - } ] - }, - "contexts" : { - "def" : [ { - "localId" : "211", - "name" : "Patient", - "annotation" : [ ] - } ] - }, - "statements" : { - "def" : [ { - "localId" : "209", - "name" : "Patient", - "context" : "Patient", - "annotation" : [ ], - "expression" : { - "type" : "SingletonFrom", - "localId" : "210", - "annotation" : [ ], - "signature" : [ ], - "operand" : { - "type" : "Retrieve", - "localId" : "208", - "dataType" : "{https://github.com/cqframework/cql-execution/simple}Patient", - "annotation" : [ ], - "include" : [ ], - "codeFilter" : [ ], - "dateFilter" : [ ], - "otherFilter" : [ ] - } - } }, { - "localId" : "214", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Mod", + "localId" : "268", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "TruncatedDivideLargePositiveDecimal", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "214", + "r" : "268", "s" : [ { - "value" : [ "", "define ", "Mod", ": " ] + "value" : [ "", "define ", "TruncatedDivideLargePositiveDecimal", ": " ] }, { - "r" : "215", + "r" : "269", "s" : [ { - "r" : "216", - "value" : [ "3", " mod ", "2" ] + "r" : "270", + "value" : [ "9007199254740993.0", " div ", "1.0" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "215", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "TruncatedDivide", + "localId" : "269", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "218", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "272", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "219", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "273", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : [ { "type" : "Literal", - "localId" : "216", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "3", + "localId" : "270", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "9007199254740993.0", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "217", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2", + "localId" : "271", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", "annotation" : [ ] } ] } }, { - "localId" : "222", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "ThreeModZero", + "localId" : "276", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "TruncatedDivideDecimalJustBelowOne", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "222", + "r" : "276", "s" : [ { - "value" : [ "", "define ", "ThreeModZero", ": " ] + "value" : [ "", "define ", "TruncatedDivideDecimalJustBelowOne", ": " ] }, { - "r" : "223", + "r" : "277", "s" : [ { - "r" : "224", - "value" : [ "3", " mod ", "0" ] + "r" : "278", + "value" : [ "1.99999999", " div ", "2.0" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "223", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "TruncatedDivide", + "localId" : "277", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "226", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "280", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "227", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "281", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : [ { "type" : "Literal", - "localId" : "224", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "3", + "localId" : "278", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.99999999", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "225", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", + "localId" : "279", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", "annotation" : [ ] } ] } }, { - "localId" : "230", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "ThreeModTwoLong", + "localId" : "284", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "TruncatedDivideDecimalJustAboveOne", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "230", + "r" : "284", "s" : [ { - "value" : [ "", "define ", "ThreeModTwoLong", ": " ] + "value" : [ "", "define ", "TruncatedDivideDecimalJustAboveOne", ": " ] }, { - "r" : "231", + "r" : "285", "s" : [ { - "r" : "232", - "value" : [ "3L", " mod ", "2L" ] + "r" : "286", + "value" : [ "2.00000001", " div ", "2.0" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "231", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "type" : "TruncatedDivide", + "localId" : "285", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "234", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "288", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "235", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "289", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : [ { "type" : "Literal", - "localId" : "232", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "3", + "localId" : "286", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.00000001", "annotation" : [ ] }, { "type" : "Literal", - "localId" : "233", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "2", + "localId" : "287", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", "annotation" : [ ] } ] } }, { - "localId" : "238", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "ThreeModTwoMixed", + "localId" : "292", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "TruncatedDivideLargePositiveQuantity", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "238", + "r" : "292", "s" : [ { - "value" : [ "", "define ", "ThreeModTwoMixed", ": " ] + "value" : [ "", "define ", "TruncatedDivideLargePositiveQuantity", ": " ] }, { - "r" : "239", + "r" : "293", "s" : [ { - "r" : "240", - "value" : [ "3", " mod ", "2L" ] - } ] - } ] - } - } ], - "expression" : { - "type" : "Modulo", - "localId" : "239", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "245", - "name" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ] - }, { - "type" : "NamedTypeSpecifier", - "localId" : "246", - "name" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ] - } ], - "operand" : [ { + "r" : "294", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "296", + "value" : [ "value", ": ", "9007199254740993.0" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "297", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ " div " ] + }, { + "r" : "299", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "301", + "value" : [ "value", ": ", "1.0" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "302", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } ] + } + } ], + "expression" : { + "type" : "TruncatedDivide", + "localId" : "293", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "304", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "305", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Instance", + "localId" : "294", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "296", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "9007199254740993.0", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "297", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + }, { + "type" : "Instance", + "localId" : "299", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "301", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "302", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + } ] + } + }, { + "localId" : "308", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "TruncatedDivideQuantityJustBelowOne", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "308", + "s" : [ { + "value" : [ "", "define ", "TruncatedDivideQuantityJustBelowOne", ": " ] + }, { + "r" : "309", + "s" : [ { + "r" : "310", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "312", + "value" : [ "value", ": ", "1.99999999" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "313", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ " div " ] + }, { + "r" : "315", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "317", + "value" : [ "value", ": ", "2.0" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "318", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + } ] + } ] + } + } ], + "expression" : { + "type" : "TruncatedDivide", + "localId" : "309", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "320", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "321", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Instance", + "localId" : "310", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "312", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.99999999", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "313", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + }, { + "type" : "Instance", + "localId" : "315", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "317", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "318", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + } ] + } + } ] + } + } +} + +/* Modulo +library TestSnippet version '1' +using Simple version '1.0.0' +context Patient +define Mod: 3 mod 2 +define ThreeModZero: 3 mod 0 +define ThreeModTwoLong: 3L mod 2L +define ThreeModTwoMixed: 3 mod 2L +define ThreeModTwoReverseMixed: 3L mod 2 +define ThreeModZeroLong: 3L mod 0L +define ThreeModZeroDecimal: 3.0 mod 0.0 +*/ + +module.exports['Modulo'] = { + "library" : { + "localId" : "0", + "annotation" : [ { + "type" : "CqlToElmInfo", + "translatorVersion" : "4.2.0", + "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", + "signatureLevel" : "All" + }, { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "268", + "s" : [ { + "value" : [ "", "library TestSnippet version '1'" ] + } ] + } + } ], + "identifier" : { + "id" : "TestSnippet", + "version" : "1" + }, + "schemaIdentifier" : { + "id" : "urn:hl7-org:elm", + "version" : "r1" + }, + "usings" : { + "def" : [ { + "localId" : "1", + "localIdentifier" : "System", + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] + }, { + "localId" : "206", + "localIdentifier" : "Simple", + "uri" : "https://github.com/cqframework/cql-execution/simple", + "version" : "1.0.0", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "206", + "s" : [ { + "value" : [ "", "using " ] + }, { + "s" : [ { + "value" : [ "Simple" ] + } ] + }, { + "value" : [ " version '1.0.0'" ] + } ] + } + } ] + } ] + }, + "contexts" : { + "def" : [ { + "localId" : "211", + "name" : "Patient", + "annotation" : [ ] + } ] + }, + "statements" : { + "def" : [ { + "localId" : "209", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], + "expression" : { + "type" : "SingletonFrom", + "localId" : "210", + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Retrieve", + "localId" : "208", + "dataType" : "{https://github.com/cqframework/cql-execution/simple}Patient", + "annotation" : [ ], + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } + } + }, { + "localId" : "214", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "Mod", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "214", + "s" : [ { + "value" : [ "", "define ", "Mod", ": " ] + }, { + "r" : "215", + "s" : [ { + "r" : "216", + "value" : [ "3", " mod ", "2" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "215", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "218", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "219", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "216", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "3", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "217", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "2", + "annotation" : [ ] + } ] + } + }, { + "localId" : "222", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "ThreeModZero", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "222", + "s" : [ { + "value" : [ "", "define ", "ThreeModZero", ": " ] + }, { + "r" : "223", + "s" : [ { + "r" : "224", + "value" : [ "3", " mod ", "0" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "223", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "226", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "227", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "224", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "3", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "225", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "annotation" : [ ] + } ] + } + }, { + "localId" : "230", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "ThreeModTwoLong", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "230", + "s" : [ { + "value" : [ "", "define ", "ThreeModTwoLong", ": " ] + }, { + "r" : "231", + "s" : [ { + "r" : "232", + "value" : [ "3L", " mod ", "2L" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "231", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "234", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "235", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "232", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "3", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "233", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "2", + "annotation" : [ ] + } ] + } + }, { + "localId" : "238", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "ThreeModTwoMixed", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "238", + "s" : [ { + "value" : [ "", "define ", "ThreeModTwoMixed", ": " ] + }, { + "r" : "239", + "s" : [ { + "r" : "240", + "value" : [ "3", " mod ", "2L" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "239", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "245", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "246", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "ToLong", + "localId" : "243", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "244", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "240", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "3", + "annotation" : [ ] + } + }, { + "type" : "Literal", + "localId" : "241", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "2", + "annotation" : [ ] + } ] + } + }, { + "localId" : "249", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "ThreeModTwoReverseMixed", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "249", + "s" : [ { + "value" : [ "", "define ", "ThreeModTwoReverseMixed", ": " ] + }, { + "r" : "250", + "s" : [ { + "r" : "251", + "value" : [ "3L", " mod ", "2" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "250", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "256", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "257", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "251", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "3", + "annotation" : [ ] + }, { "type" : "ToLong", - "localId" : "243", + "localId" : "254", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "255", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "252", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "2", + "annotation" : [ ] + } + } ] + } + }, { + "localId" : "260", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "ThreeModZeroLong", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "260", + "s" : [ { + "value" : [ "", "define ", "ThreeModZeroLong", ": " ] + }, { + "r" : "261", + "s" : [ { + "r" : "262", + "value" : [ "3L", " mod ", "0L" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "261", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "264", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "265", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "262", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "3", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "263", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "0", + "annotation" : [ ] + } ] + } + }, { + "localId" : "268", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "ThreeModZeroDecimal", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "268", + "s" : [ { + "value" : [ "", "define ", "ThreeModZeroDecimal", ": " ] + }, { + "r" : "269", + "s" : [ { + "r" : "270", + "value" : [ "3.0", " mod ", "0.0" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Modulo", + "localId" : "269", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "272", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "273", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Literal", + "localId" : "270", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "271", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.0", + "annotation" : [ ] + } ] + } + } ] + } + } +} + +/* Ceiling +library TestSnippet version '1' +using Simple version '1.0.0' +context Patient +define Ceil: Ceiling(10.1) +define Even: Ceiling(10) +define CeilTenLong: Ceiling(10L) +define CeilingOverflow: Ceiling(2147483647.1) +*/ + +module.exports['Ceiling'] = { + "library" : { + "localId" : "0", + "annotation" : [ { + "type" : "CqlToElmInfo", + "translatorVersion" : "4.2.0", + "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", + "signatureLevel" : "All" + }, { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "253", + "s" : [ { + "value" : [ "", "library TestSnippet version '1'" ] + } ] + } + } ], + "identifier" : { + "id" : "TestSnippet", + "version" : "1" + }, + "schemaIdentifier" : { + "id" : "urn:hl7-org:elm", + "version" : "r1" + }, + "usings" : { + "def" : [ { + "localId" : "1", + "localIdentifier" : "System", + "uri" : "urn:hl7-org:elm-types:r1", + "annotation" : [ ] + }, { + "localId" : "206", + "localIdentifier" : "Simple", + "uri" : "https://github.com/cqframework/cql-execution/simple", + "version" : "1.0.0", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "206", + "s" : [ { + "value" : [ "", "using " ] + }, { + "s" : [ { + "value" : [ "Simple" ] + } ] + }, { + "value" : [ " version '1.0.0'" ] + } ] + } + } ] + } ] + }, + "contexts" : { + "def" : [ { + "localId" : "211", + "name" : "Patient", + "annotation" : [ ] + } ] + }, + "statements" : { + "def" : [ { + "localId" : "209", + "name" : "Patient", + "context" : "Patient", + "annotation" : [ ], + "expression" : { + "type" : "SingletonFrom", + "localId" : "210", + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Retrieve", + "localId" : "208", + "dataType" : "{https://github.com/cqframework/cql-execution/simple}Patient", "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "244", - "name" : "{urn:hl7-org:elm-types:r1}Integer", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Literal", - "localId" : "240", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "3", - "annotation" : [ ] - } - }, { - "type" : "Literal", - "localId" : "241", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "2", - "annotation" : [ ] - } ] + "include" : [ ], + "codeFilter" : [ ], + "dateFilter" : [ ], + "otherFilter" : [ ] + } } }, { - "localId" : "249", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "ThreeModTwoReverseMixed", + "localId" : "214", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "Ceil", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "249", + "r" : "214", "s" : [ { - "value" : [ "", "define ", "ThreeModTwoReverseMixed", ": " ] + "value" : [ "", "define ", "Ceil", ": " ] }, { - "r" : "250", + "r" : "219", "s" : [ { - "r" : "251", - "value" : [ "3L", " mod ", "2" ] + "r" : "215", + "value" : [ "Ceiling", "(", "10.1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "250", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "type" : "Ceiling", + "localId" : "219", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "256", - "name" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ] - }, { - "type" : "NamedTypeSpecifier", - "localId" : "257", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "220", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], - "operand" : [ { + "operand" : { "type" : "Literal", - "localId" : "251", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "3", + "localId" : "215", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "10.1", "annotation" : [ ] - }, { - "type" : "ToLong", - "localId" : "254", + } + } + }, { + "localId" : "223", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "Even", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "223", + "s" : [ { + "value" : [ "", "define ", "Even", ": " ] + }, { + "r" : "231", + "s" : [ { + "r" : "224", + "value" : [ "Ceiling", "(", "10", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Ceiling", + "localId" : "231", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "235", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "ToDecimal", + "localId" : "233", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "255", + "localId" : "234", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "252", + "localId" : "224", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "2", + "value" : "10", "annotation" : [ ] } - } ] + } } }, { - "localId" : "260", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "ThreeModZeroLong", + "localId" : "238", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "CeilTenLong", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "260", + "r" : "238", "s" : [ { - "value" : [ "", "define ", "ThreeModZeroLong", ": " ] + "value" : [ "", "define ", "CeilTenLong", ": " ] }, { - "r" : "261", + "r" : "246", "s" : [ { - "r" : "262", - "value" : [ "3L", " mod ", "0L" ] + "r" : "239", + "value" : [ "Ceiling", "(", "10L", ")" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "261", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "type" : "Ceiling", + "localId" : "246", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "264", - "name" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ] - }, { - "type" : "NamedTypeSpecifier", - "localId" : "265", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "250", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], - "operand" : [ { - "type" : "Literal", - "localId" : "262", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "3", - "annotation" : [ ] - }, { - "type" : "Literal", - "localId" : "263", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "0", - "annotation" : [ ] - } ] + "operand" : { + "type" : "ToDecimal", + "localId" : "248", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "249", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "239", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "10", + "annotation" : [ ] + } + } } }, { - "localId" : "268", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "ThreeModZeroDecimal", + "localId" : "253", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "CeilingOverflow", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "268", + "r" : "253", "s" : [ { - "value" : [ "", "define ", "ThreeModZeroDecimal", ": " ] + "value" : [ "", "define ", "CeilingOverflow", ": " ] }, { - "r" : "269", + "r" : "258", "s" : [ { - "r" : "270", - "value" : [ "3.0", " mod ", "0.0" ] + "r" : "254", + "value" : [ "Ceiling", "(", "2147483647.1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Modulo", - "localId" : "269", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "type" : "Ceiling", + "localId" : "258", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "272", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "annotation" : [ ] - }, { - "type" : "NamedTypeSpecifier", - "localId" : "273", + "localId" : "259", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], - "operand" : [ { - "type" : "Literal", - "localId" : "270", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "3.0", - "annotation" : [ ] - }, { + "operand" : { "type" : "Literal", - "localId" : "271", + "localId" : "254", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "0.0", + "value" : "2147483647.1", "annotation" : [ ] - } ] + } } } ] } } } -/* Ceiling +/* Floor library TestSnippet version '1' using Simple version '1.0.0' context Patient -define Ceil: Ceiling(10.1) -define Even: Ceiling(10) -define CeilTenLong: Ceiling(10L) -define CeilingOverflow: Ceiling(2147483647.1) +define flr: Floor(10.1) +define Even: Floor(10) +define FloorTenLong: Floor(10L) +define FloorUnderflow: Floor(-2147483648.1) */ -module.exports['Ceiling'] = { +module.exports['Floor'] = { "library" : { "localId" : "0", "annotation" : [ { @@ -7854,7 +8588,7 @@ module.exports['Ceiling'] = { }, { "localId" : "214", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Ceil", + "name" : "flr", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -7863,18 +8597,18 @@ module.exports['Ceiling'] = { "s" : { "r" : "214", "s" : [ { - "value" : [ "", "define ", "Ceil", ": " ] + "value" : [ "", "define ", "flr", ": " ] }, { "r" : "219", "s" : [ { "r" : "215", - "value" : [ "Ceiling", "(", "10.1", ")" ] + "value" : [ "Floor", "(", "10.1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Ceiling", + "type" : "Floor", "localId" : "219", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -7910,13 +8644,13 @@ module.exports['Ceiling'] = { "r" : "231", "s" : [ { "r" : "224", - "value" : [ "Ceiling", "(", "10", ")" ] + "value" : [ "Floor", "(", "10", ")" ] } ] } ] } } ], "expression" : { - "type" : "Ceiling", + "type" : "Floor", "localId" : "231", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -7949,7 +8683,7 @@ module.exports['Ceiling'] = { }, { "localId" : "238", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "CeilTenLong", + "name" : "FloorTenLong", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -7958,18 +8692,18 @@ module.exports['Ceiling'] = { "s" : { "r" : "238", "s" : [ { - "value" : [ "", "define ", "CeilTenLong", ": " ] + "value" : [ "", "define ", "FloorTenLong", ": " ] }, { "r" : "246", "s" : [ { "r" : "239", - "value" : [ "Ceiling", "(", "10L", ")" ] + "value" : [ "Floor", "(", "10L", ")" ] } ] } ] } } ], "expression" : { - "type" : "Ceiling", + "type" : "Floor", "localId" : "246", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -8002,7 +8736,7 @@ module.exports['Ceiling'] = { }, { "localId" : "253", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "CeilingOverflow", + "name" : "FloorUnderflow", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8011,34 +8745,53 @@ module.exports['Ceiling'] = { "s" : { "r" : "253", "s" : [ { - "value" : [ "", "define ", "CeilingOverflow", ": " ] + "value" : [ "", "define ", "FloorUnderflow", ": " ] }, { - "r" : "258", + "r" : "260", "s" : [ { + "value" : [ "Floor", "(" ] + }, { "r" : "254", - "value" : [ "Ceiling", "(", "2147483647.1", ")" ] + "s" : [ { + "r" : "255", + "value" : [ "-", "2147483648.1" ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { - "type" : "Ceiling", - "localId" : "258", + "type" : "Floor", + "localId" : "260", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "259", + "localId" : "261", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { - "type" : "Literal", + "type" : "Negate", "localId" : "254", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "2147483647.1", - "annotation" : [ ] + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "256", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "255", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2147483648.1", + "annotation" : [ ] + } } } } ] @@ -8046,17 +8799,17 @@ module.exports['Ceiling'] = { } } -/* Floor +/* Truncate library TestSnippet version '1' using Simple version '1.0.0' context Patient -define flr: Floor(10.1) -define Even: Floor(10) -define FloorTenLong: Floor(10L) -define FloorUnderflow: Floor(-2147483648.1) +define Trunc: Truncate(10.1) +define Even: Truncate(10) +define TruncTenLong: Truncate(10L) +define TruncateOverflow: Truncate(2147483648.0) */ -module.exports['Floor'] = { +module.exports['Truncate'] = { "library" : { "localId" : "0", "annotation" : [ { @@ -8143,7 +8896,7 @@ module.exports['Floor'] = { }, { "localId" : "214", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "flr", + "name" : "Trunc", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8152,18 +8905,18 @@ module.exports['Floor'] = { "s" : { "r" : "214", "s" : [ { - "value" : [ "", "define ", "flr", ": " ] + "value" : [ "", "define ", "Trunc", ": " ] }, { "r" : "219", "s" : [ { "r" : "215", - "value" : [ "Floor", "(", "10.1", ")" ] + "value" : [ "Truncate", "(", "10.1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Floor", + "type" : "Truncate", "localId" : "219", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -8199,13 +8952,13 @@ module.exports['Floor'] = { "r" : "231", "s" : [ { "r" : "224", - "value" : [ "Floor", "(", "10", ")" ] + "value" : [ "Truncate", "(", "10", ")" ] } ] } ] } } ], "expression" : { - "type" : "Floor", + "type" : "Truncate", "localId" : "231", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -8238,7 +8991,7 @@ module.exports['Floor'] = { }, { "localId" : "238", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "FloorTenLong", + "name" : "TruncTenLong", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8247,18 +9000,18 @@ module.exports['Floor'] = { "s" : { "r" : "238", "s" : [ { - "value" : [ "", "define ", "FloorTenLong", ": " ] + "value" : [ "", "define ", "TruncTenLong", ": " ] }, { "r" : "246", "s" : [ { "r" : "239", - "value" : [ "Floor", "(", "10L", ")" ] + "value" : [ "Truncate", "(", "10L", ")" ] } ] } ] } } ], "expression" : { - "type" : "Floor", + "type" : "Truncate", "localId" : "246", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], @@ -8291,7 +9044,7 @@ module.exports['Floor'] = { }, { "localId" : "253", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "FloorUnderflow", + "name" : "TruncateOverflow", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8300,53 +9053,34 @@ module.exports['Floor'] = { "s" : { "r" : "253", "s" : [ { - "value" : [ "", "define ", "FloorUnderflow", ": " ] + "value" : [ "", "define ", "TruncateOverflow", ": " ] }, { - "r" : "260", + "r" : "258", "s" : [ { - "value" : [ "Floor", "(" ] - }, { "r" : "254", - "s" : [ { - "r" : "255", - "value" : [ "-", "2147483648.1" ] - } ] - }, { - "value" : [ ")" ] + "value" : [ "Truncate", "(", "2147483648.0", ")" ] } ] } ] } } ], "expression" : { - "type" : "Floor", - "localId" : "260", + "type" : "Truncate", + "localId" : "258", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "261", + "localId" : "259", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { - "type" : "Negate", + "type" : "Literal", "localId" : "254", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "256", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Literal", - "localId" : "255", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "2147483648.1", - "annotation" : [ ] - } + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2147483648.0", + "annotation" : [ ] } } } ] @@ -8354,17 +9088,19 @@ module.exports['Floor'] = { } } -/* Truncate +/* Abs library TestSnippet version '1' using Simple version '1.0.0' context Patient -define Trunc: Truncate(10.1) -define Even: Truncate(10) -define TruncTenLong: Truncate(10L) -define TruncateOverflow: Truncate(2147483648.0) +define Pos: Abs(10) +define Neg: Abs(-10) +define Zero: Abs(0) +define AbsMinInteger: Abs(minimum Integer) +define AbsNegTenLong: Abs(-10L) +define AbsMinLong: Abs(minimum Long) */ -module.exports['Truncate'] = { +module.exports['Abs'] = { "library" : { "localId" : "0", "annotation" : [ { @@ -8376,7 +9112,7 @@ module.exports['Truncate'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "253", + "r" : "264", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8451,7 +9187,7 @@ module.exports['Truncate'] = { }, { "localId" : "214", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Trunc", + "name" : "Pos", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8460,135 +9196,245 @@ module.exports['Truncate'] = { "s" : { "r" : "214", "s" : [ { - "value" : [ "", "define ", "Trunc", ": " ] + "value" : [ "", "define ", "Pos", ": " ] }, { "r" : "219", "s" : [ { "r" : "215", - "value" : [ "Truncate", "(", "10.1", ")" ] + "value" : [ "Abs", "(", "10", ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Abs", + "localId" : "219", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "220", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "215", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "10", + "annotation" : [ ] + } + } + }, { + "localId" : "223", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "Neg", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "223", + "s" : [ { + "value" : [ "", "define ", "Neg", ": " ] + }, { + "r" : "230", + "s" : [ { + "value" : [ "Abs", "(" ] + }, { + "r" : "224", + "s" : [ { + "r" : "225", + "value" : [ "-", "10" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Abs", + "localId" : "230", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "231", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Negate", + "localId" : "224", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "226", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "225", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "10", + "annotation" : [ ] + } + } + } + }, { + "localId" : "234", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "Zero", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "234", + "s" : [ { + "value" : [ "", "define ", "Zero", ": " ] + }, { + "r" : "239", + "s" : [ { + "r" : "235", + "value" : [ "Abs", "(", "0", ")" ] } ] } ] } } ], "expression" : { - "type" : "Truncate", - "localId" : "219", + "type" : "Abs", + "localId" : "239", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "220", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "localId" : "240", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "215", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "10.1", + "localId" : "235", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", "annotation" : [ ] } } }, { - "localId" : "223", + "localId" : "243", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Even", + "name" : "AbsMinInteger", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "223", + "r" : "243", "s" : [ { - "value" : [ "", "define ", "Even", ": " ] + "value" : [ "", "define ", "AbsMinInteger", ": " ] }, { - "r" : "231", + "r" : "249", "s" : [ { - "r" : "224", - "value" : [ "Truncate", "(", "10", ")" ] + "value" : [ "Abs", "(" ] + }, { + "r" : "245", + "s" : [ { + "value" : [ "minimum", " " ] + }, { + "r" : "244", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { - "type" : "Truncate", - "localId" : "231", + "type" : "Abs", + "localId" : "249", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "235", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "localId" : "250", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { - "type" : "ToDecimal", - "localId" : "233", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "234", - "name" : "{urn:hl7-org:elm-types:r1}Integer", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Literal", - "localId" : "224", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "10", - "annotation" : [ ] - } + "type" : "MinValue", + "localId" : "245", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } } }, { - "localId" : "238", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "TruncTenLong", + "localId" : "253", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "AbsNegTenLong", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "238", + "r" : "253", "s" : [ { - "value" : [ "", "define ", "TruncTenLong", ": " ] + "value" : [ "", "define ", "AbsNegTenLong", ": " ] }, { - "r" : "246", + "r" : "260", "s" : [ { - "r" : "239", - "value" : [ "Truncate", "(", "10L", ")" ] + "value" : [ "Abs", "(" ] + }, { + "r" : "254", + "s" : [ { + "r" : "255", + "value" : [ "-", "10L" ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { - "type" : "Truncate", - "localId" : "246", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "Abs", + "localId" : "260", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "250", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "localId" : "261", + "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } ], "operand" : { - "type" : "ToDecimal", - "localId" : "248", + "type" : "Negate", + "localId" : "254", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "249", + "localId" : "256", "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "239", + "localId" : "255", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "valueType" : "{urn:hl7-org:elm-types:r1}Long", "value" : "10", @@ -8597,44 +9443,54 @@ module.exports['Truncate'] = { } } }, { - "localId" : "253", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "TruncateOverflow", + "localId" : "264", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "name" : "AbsMinLong", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "253", + "r" : "264", "s" : [ { - "value" : [ "", "define ", "TruncateOverflow", ": " ] + "value" : [ "", "define ", "AbsMinLong", ": " ] }, { - "r" : "258", + "r" : "270", "s" : [ { - "r" : "254", - "value" : [ "Truncate", "(", "2147483648.0", ")" ] + "value" : [ "Abs", "(" ] + }, { + "r" : "266", + "s" : [ { + "value" : [ "minimum", " " ] + }, { + "r" : "265", + "s" : [ { + "value" : [ "Long" ] + } ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { - "type" : "Truncate", - "localId" : "258", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "Abs", + "localId" : "270", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "259", - "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "localId" : "271", + "name" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } ], "operand" : { - "type" : "Literal", - "localId" : "254", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "2147483648.0", + "type" : "MinValue", + "localId" : "266", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", "annotation" : [ ] } } @@ -8643,19 +9499,25 @@ module.exports['Truncate'] = { } } -/* Abs +/* Round library TestSnippet version '1' using Simple version '1.0.0' context Patient -define Pos: Abs(10) -define Neg: Abs(-10) -define Zero: Abs(0) -define AbsMinInteger: Abs(minimum Integer) -define AbsNegTenLong: Abs(-10L) -define AbsMinLong: Abs(minimum Long) +define Up: Round(4.56) +define Up_percent: Round(4.56,1) +define Down: Round(4.49) +define Down_percent: Round(4.43,1) +define NegativeHalf: Round(-0.5) +define NegativeOnePointFive: Round(-1.5) +define RoundPositiveHalfOmittedPrecision: Round(1.5) +define RoundPositiveHalfNullPrecision: Round(1.5, null as Integer) +define RoundPositiveHalfZeroPrecision: Round(1.5, 0) +define RoundNegativeHalfOmittedPrecision: Round(-1.5) +define RoundNegativeHalfNullPrecision: Round(-1.5, null as Integer) +define RoundNegativeHalfZeroPrecision: Round(-1.5, 0) */ -module.exports['Abs'] = { +module.exports['Round'] = { "library" : { "localId" : "0", "annotation" : [ { @@ -8667,7 +9529,7 @@ module.exports['Abs'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "264", + "r" : "340", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8741,8 +9603,8 @@ module.exports['Abs'] = { } }, { "localId" : "214", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Pos", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "Up", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8751,40 +9613,40 @@ module.exports['Abs'] = { "s" : { "r" : "214", "s" : [ { - "value" : [ "", "define ", "Pos", ": " ] + "value" : [ "", "define ", "Up", ": " ] }, { "r" : "219", "s" : [ { "r" : "215", - "value" : [ "Abs", "(", "10", ")" ] + "value" : [ "Round", "(", "4.56", ")" ] } ] } ] } } ], "expression" : { - "type" : "Abs", + "type" : "Round", "localId" : "219", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", "localId" : "220", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", "localId" : "215", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "10", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.56", "annotation" : [ ] } } }, { "localId" : "223", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Neg", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "Up_percent", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { @@ -8793,171 +9655,168 @@ module.exports['Abs'] = { "s" : { "r" : "223", "s" : [ { - "value" : [ "", "define ", "Neg", ": " ] + "value" : [ "", "define ", "Up_percent", ": " ] }, { "r" : "230", "s" : [ { - "value" : [ "Abs", "(" ] - }, { "r" : "224", - "s" : [ { - "r" : "225", - "value" : [ "-", "10" ] - } ] - }, { - "value" : [ ")" ] + "value" : [ "Round", "(", "4.56", ",", "1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Abs", + "type" : "Round", "localId" : "230", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", "localId" : "231", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "232", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { - "type" : "Negate", + "type" : "Literal", "localId" : "224", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.56", + "annotation" : [ ] + }, + "precision" : { + "type" : "Literal", + "localId" : "225", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "annotation" : [ ], - "signature" : [ { - "type" : "NamedTypeSpecifier", - "localId" : "226", - "name" : "{urn:hl7-org:elm-types:r1}Integer", - "annotation" : [ ] - } ], - "operand" : { - "type" : "Literal", - "localId" : "225", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "10", - "annotation" : [ ] - } + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "1", + "annotation" : [ ] } } }, { - "localId" : "234", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "Zero", + "localId" : "235", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "Down", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "234", + "r" : "235", "s" : [ { - "value" : [ "", "define ", "Zero", ": " ] + "value" : [ "", "define ", "Down", ": " ] }, { - "r" : "239", + "r" : "240", "s" : [ { - "r" : "235", - "value" : [ "Abs", "(", "0", ")" ] + "r" : "236", + "value" : [ "Round", "(", "4.49", ")" ] } ] } ] } } ], "expression" : { - "type" : "Abs", - "localId" : "239", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "Round", + "localId" : "240", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "240", - "name" : "{urn:hl7-org:elm-types:r1}Integer", + "localId" : "241", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "235", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "0", + "localId" : "236", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.49", "annotation" : [ ] } } }, { - "localId" : "243", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "name" : "AbsMinInteger", + "localId" : "244", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "Down_percent", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "243", + "r" : "244", "s" : [ { - "value" : [ "", "define ", "AbsMinInteger", ": " ] + "value" : [ "", "define ", "Down_percent", ": " ] }, { - "r" : "249", + "r" : "251", "s" : [ { - "value" : [ "Abs", "(" ] - }, { "r" : "245", - "s" : [ { - "value" : [ "minimum", " " ] - }, { - "r" : "244", - "s" : [ { - "value" : [ "Integer" ] - } ] - } ] - }, { - "value" : [ ")" ] + "value" : [ "Round", "(", "4.43", ",", "1", ")" ] } ] } ] } } ], "expression" : { - "type" : "Abs", - "localId" : "249", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "type" : "Round", + "localId" : "251", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "250", + "localId" : "252", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "253", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { - "type" : "MinValue", + "type" : "Literal", "localId" : "245", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.43", + "annotation" : [ ] + }, + "precision" : { + "type" : "Literal", + "localId" : "246", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "1", "annotation" : [ ] } } }, { - "localId" : "253", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "AbsNegTenLong", + "localId" : "256", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "NegativeHalf", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "253", + "r" : "256", "s" : [ { - "value" : [ "", "define ", "AbsNegTenLong", ": " ] + "value" : [ "", "define ", "NegativeHalf", ": " ] }, { - "r" : "260", + "r" : "263", "s" : [ { - "value" : [ "Abs", "(" ] + "value" : [ "Round", "(" ] }, { - "r" : "254", + "r" : "257", "s" : [ { - "r" : "255", - "value" : [ "-", "10L" ] + "r" : "258", + "value" : [ "-", "0.5" ] } ] }, { "value" : [ ")" ] @@ -8966,63 +9825,59 @@ module.exports['Abs'] = { } } ], "expression" : { - "type" : "Abs", - "localId" : "260", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "type" : "Round", + "localId" : "263", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "261", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "264", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Negate", - "localId" : "254", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "257", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "256", - "name" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "259", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "255", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", - "value" : "10", + "localId" : "258", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "0.5", "annotation" : [ ] } } } }, { - "localId" : "264", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "name" : "AbsMinLong", + "localId" : "267", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "NegativeOnePointFive", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "264", + "r" : "267", "s" : [ { - "value" : [ "", "define ", "AbsMinLong", ": " ] + "value" : [ "", "define ", "NegativeOnePointFive", ": " ] }, { - "r" : "270", + "r" : "274", "s" : [ { - "value" : [ "Abs", "(" ] + "value" : [ "Round", "(" ] }, { - "r" : "266", + "r" : "268", "s" : [ { - "value" : [ "minimum", " " ] - }, { - "r" : "265", - "s" : [ { - "value" : [ "Long" ] - } ] + "r" : "269", + "value" : [ "-", "1.5" ] } ] }, { "value" : [ ")" ] @@ -9031,341 +9886,311 @@ module.exports['Abs'] = { } } ], "expression" : { - "type" : "Abs", - "localId" : "270", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "type" : "Round", + "localId" : "274", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "271", - "name" : "{urn:hl7-org:elm-types:r1}Long", - "annotation" : [ ] - } ], - "operand" : { - "type" : "MinValue", - "localId" : "266", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", - "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "localId" : "275", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] - } - } - } ] - } - } -} - -/* Round -library TestSnippet version '1' -using Simple version '1.0.0' -context Patient -define Up: Round(4.56) -define Up_percent: Round(4.56,1) -define Down: Round(4.49) -define Down_percent: Round(4.43,1) -define NegativeHalf: Round(-0.5) -define NegativeOnePointFive: Round(-1.5) -*/ - -module.exports['Round'] = { - "library" : { - "localId" : "0", - "annotation" : [ { - "type" : "CqlToElmInfo", - "translatorVersion" : "4.2.0", - "translatorOptions" : "EnableDateRangeOptimization,EnableAnnotations,EnableResultTypes", - "signatureLevel" : "All" - }, { - "type" : "Annotation", - "t" : [ ], - "s" : { - "r" : "267", - "s" : [ { - "value" : [ "", "library TestSnippet version '1'" ] - } ] - } - } ], - "identifier" : { - "id" : "TestSnippet", - "version" : "1" - }, - "schemaIdentifier" : { - "id" : "urn:hl7-org:elm", - "version" : "r1" - }, - "usings" : { - "def" : [ { - "localId" : "1", - "localIdentifier" : "System", - "uri" : "urn:hl7-org:elm-types:r1", - "annotation" : [ ] - }, { - "localId" : "206", - "localIdentifier" : "Simple", - "uri" : "https://github.com/cqframework/cql-execution/simple", - "version" : "1.0.0", - "annotation" : [ { - "type" : "Annotation", - "t" : [ ], - "s" : { - "r" : "206", - "s" : [ { - "value" : [ "", "using " ] - }, { - "s" : [ { - "value" : [ "Simple" ] - } ] - }, { - "value" : [ " version '1.0.0'" ] - } ] - } - } ] - } ] - }, - "contexts" : { - "def" : [ { - "localId" : "211", - "name" : "Patient", - "annotation" : [ ] - } ] - }, - "statements" : { - "def" : [ { - "localId" : "209", - "name" : "Patient", - "context" : "Patient", - "annotation" : [ ], - "expression" : { - "type" : "SingletonFrom", - "localId" : "210", - "annotation" : [ ], - "signature" : [ ], + } ], "operand" : { - "type" : "Retrieve", - "localId" : "208", - "dataType" : "{https://github.com/cqframework/cql-execution/simple}Patient", + "type" : "Negate", + "localId" : "268", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], - "include" : [ ], - "codeFilter" : [ ], - "dateFilter" : [ ], - "otherFilter" : [ ] + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "270", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "269", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.5", + "annotation" : [ ] + } } } }, { - "localId" : "214", + "localId" : "278", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "Up", + "name" : "RoundPositiveHalfOmittedPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "214", + "r" : "278", "s" : [ { - "value" : [ "", "define ", "Up", ": " ] + "value" : [ "", "define ", "RoundPositiveHalfOmittedPrecision", ": " ] }, { - "r" : "219", + "r" : "283", "s" : [ { - "r" : "215", - "value" : [ "Round", "(", "4.56", ")" ] + "r" : "279", + "value" : [ "Round", "(", "1.5", ")" ] } ] } ] } } ], "expression" : { "type" : "Round", - "localId" : "219", + "localId" : "283", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "220", + "localId" : "284", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "215", + "localId" : "279", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "4.56", + "value" : "1.5", "annotation" : [ ] } } }, { - "localId" : "223", + "localId" : "287", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "Up_percent", + "name" : "RoundPositiveHalfNullPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "223", + "r" : "287", "s" : [ { - "value" : [ "", "define ", "Up_percent", ": " ] + "value" : [ "", "define ", "RoundPositiveHalfNullPrecision", ": " ] }, { - "r" : "230", + "r" : "296", "s" : [ { - "r" : "224", - "value" : [ "Round", "(", "4.56", ",", "1", ")" ] + "r" : "288", + "value" : [ "Round", "(", "1.5", ", " ] + }, { + "r" : "289", + "s" : [ { + "r" : "290", + "value" : [ "null", " as " ] + }, { + "r" : "291", + "s" : [ { + "value" : [ "Integer" ] + } ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { "type" : "Round", - "localId" : "230", + "localId" : "296", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "231", + "localId" : "297", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] }, { "type" : "NamedTypeSpecifier", - "localId" : "232", + "localId" : "298", "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "224", + "localId" : "288", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "4.56", + "value" : "1.5", "annotation" : [ ] }, "precision" : { - "type" : "Literal", - "localId" : "225", + "type" : "As", + "localId" : "289", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1", - "annotation" : [ ] + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "290", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "291", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] + } } } }, { - "localId" : "235", + "localId" : "301", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "Down", + "name" : "RoundPositiveHalfZeroPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "235", + "r" : "301", "s" : [ { - "value" : [ "", "define ", "Down", ": " ] + "value" : [ "", "define ", "RoundPositiveHalfZeroPrecision", ": " ] }, { - "r" : "240", + "r" : "308", "s" : [ { - "r" : "236", - "value" : [ "Round", "(", "4.49", ")" ] + "r" : "302", + "value" : [ "Round", "(", "1.5", ", ", "0", ")" ] } ] } ] } } ], "expression" : { "type" : "Round", - "localId" : "240", + "localId" : "308", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "241", + "localId" : "309", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "310", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "236", + "localId" : "302", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "4.49", + "value" : "1.5", + "annotation" : [ ] + }, + "precision" : { + "type" : "Literal", + "localId" : "303", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", "annotation" : [ ] } } }, { - "localId" : "244", + "localId" : "313", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "Down_percent", + "name" : "RoundNegativeHalfOmittedPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "244", + "r" : "313", "s" : [ { - "value" : [ "", "define ", "Down_percent", ": " ] + "value" : [ "", "define ", "RoundNegativeHalfOmittedPrecision", ": " ] }, { - "r" : "251", + "r" : "320", "s" : [ { - "r" : "245", - "value" : [ "Round", "(", "4.43", ",", "1", ")" ] + "value" : [ "Round", "(" ] + }, { + "r" : "314", + "s" : [ { + "r" : "315", + "value" : [ "-", "1.5" ] + } ] + }, { + "value" : [ ")" ] } ] } ] } } ], "expression" : { "type" : "Round", - "localId" : "251", + "localId" : "320", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "252", + "localId" : "321", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] - }, { - "type" : "NamedTypeSpecifier", - "localId" : "253", - "name" : "{urn:hl7-org:elm-types:r1}Integer", - "annotation" : [ ] } ], "operand" : { - "type" : "Literal", - "localId" : "245", + "type" : "Negate", + "localId" : "314", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "4.43", - "annotation" : [ ] - }, - "precision" : { - "type" : "Literal", - "localId" : "246", - "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", - "valueType" : "{urn:hl7-org:elm-types:r1}Integer", - "value" : "1", - "annotation" : [ ] + "annotation" : [ ], + "signature" : [ { + "type" : "NamedTypeSpecifier", + "localId" : "316", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } ], + "operand" : { + "type" : "Literal", + "localId" : "315", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.5", + "annotation" : [ ] + } } } }, { - "localId" : "256", + "localId" : "324", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "NegativeHalf", + "name" : "RoundNegativeHalfNullPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "256", + "r" : "324", "s" : [ { - "value" : [ "", "define ", "NegativeHalf", ": " ] + "value" : [ "", "define ", "RoundNegativeHalfNullPrecision", ": " ] }, { - "r" : "263", + "r" : "335", "s" : [ { "value" : [ "Round", "(" ] }, { - "r" : "257", + "r" : "325", "s" : [ { - "r" : "258", - "value" : [ "-", "0.5" ] + "r" : "326", + "value" : [ "-", "1.5" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "328", + "s" : [ { + "r" : "329", + "value" : [ "null", " as " ] + }, { + "r" : "330", + "s" : [ { + "value" : [ "Integer" ] + } ] } ] }, { "value" : [ ")" ] @@ -9375,95 +10200,135 @@ module.exports['Round'] = { } ], "expression" : { "type" : "Round", - "localId" : "263", + "localId" : "335", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "264", + "localId" : "336", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "337", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } ], "operand" : { "type" : "Negate", - "localId" : "257", + "localId" : "325", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "259", + "localId" : "327", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "258", + "localId" : "326", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", - "value" : "0.5", + "value" : "1.5", + "annotation" : [ ] + } + }, + "precision" : { + "type" : "As", + "localId" : "328", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "strict" : false, + "annotation" : [ ], + "signature" : [ ], + "operand" : { + "type" : "Null", + "localId" : "329", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Any", + "annotation" : [ ] + }, + "asTypeSpecifier" : { + "type" : "NamedTypeSpecifier", + "localId" : "330", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "name" : "{urn:hl7-org:elm-types:r1}Integer", "annotation" : [ ] } } } }, { - "localId" : "267", + "localId" : "340", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", - "name" : "NegativeOnePointFive", + "name" : "RoundNegativeHalfZeroPrecision", "context" : "Patient", "accessLevel" : "Public", "annotation" : [ { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "267", + "r" : "340", "s" : [ { - "value" : [ "", "define ", "NegativeOnePointFive", ": " ] + "value" : [ "", "define ", "RoundNegativeHalfZeroPrecision", ": " ] }, { - "r" : "274", + "r" : "349", "s" : [ { "value" : [ "Round", "(" ] }, { - "r" : "268", + "r" : "341", "s" : [ { - "r" : "269", + "r" : "342", "value" : [ "-", "1.5" ] } ] }, { - "value" : [ ")" ] + "r" : "344", + "value" : [ ", ", "0", ")" ] } ] } ] } } ], "expression" : { "type" : "Round", - "localId" : "274", + "localId" : "349", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "275", + "localId" : "350", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] + }, { + "type" : "NamedTypeSpecifier", + "localId" : "351", + "name" : "{urn:hl7-org:elm-types:r1}Integer", + "annotation" : [ ] } ], "operand" : { "type" : "Negate", - "localId" : "268", + "localId" : "341", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ], "signature" : [ { "type" : "NamedTypeSpecifier", - "localId" : "270", + "localId" : "343", "name" : "{urn:hl7-org:elm-types:r1}Decimal", "annotation" : [ ] } ], "operand" : { "type" : "Literal", - "localId" : "269", + "localId" : "342", "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", "value" : "1.5", "annotation" : [ ] } + }, + "precision" : { + "type" : "Literal", + "localId" : "344", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer", + "valueType" : "{urn:hl7-org:elm-types:r1}Integer", + "value" : "0", + "annotation" : [ ] } } } ] From 0cf5efd1e4e13c3b1f234a73d5050456c77f4a71 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:32:27 -0400 Subject: [PATCH 46/62] Add Decimal.truncateToBigInt as Long counterpart to Integer Decimal.truncate --- src/datatypes/decimal.ts | 6 +++++- src/elm/arithmetic.ts | 3 +++ src/elm/interval.ts | 4 ++-- test/datatypes/decimal-test.ts | 9 +++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index c86e1ffc0..061f69e3c 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -212,13 +212,17 @@ export class Decimal { return this.value.truncated().toNumber(); } + truncateToBigInt(): bigint { + return BigInt(this.value.truncated().toString()); + } + truncated(scale?: number): Decimal { // specifying a scale here allows for "truncating to a precision" // this is currently used in Interval.expand if (!scale) { // undefined or 0 both mean truncated to an integer - return new Decimal(this.truncate(), 0); + return new Decimal(this.value.truncated(), 0); } return this.withScale(scale, TRUNCATE_TO_PRECISION); diff --git a/src/elm/arithmetic.ts b/src/elm/arithmetic.ts index f100c5d03..e0db3a8e5 100644 --- a/src/elm/arithmetic.ts +++ b/src/elm/arithmetic.ts @@ -242,6 +242,9 @@ export class Truncate extends Expression { let truncated; if (arg.isDecimal) { + // Note that the CQL spec defines Truncate as returning an Integer, + // but the Decimal bounds are greater than allowed for Integer. + // If the spec changes, add another case here for truncating to Long. truncated = arg.truncate(); } else if (arg >= 0) { truncated = Math.floor(arg); diff --git a/src/elm/interval.ts b/src/elm/interval.ts index a967726c2..b5090d5c1 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -655,7 +655,7 @@ export class Expand extends Expression { convertBound = d => d; } else if (typeof lowValue === 'bigint' || typeof highValue === 'bigint') { // the bounds were integral and the per was integral, so there should be no risk of non-integral values - convertBound = d => BigInt(d.truncate()); + convertBound = d => d.truncateToBigInt(); } else if (typeof lowValue === 'number' || typeof highValue === 'number') { convertBound = d => d.truncate(); } else { @@ -670,7 +670,7 @@ export class Expand extends Expression { high.lessThan(MIN_INT_VALUE) || high.greaterThan(MAX_INT_VALUE) ) { - convertBound = d => BigInt(d.truncate()); + convertBound = d => d.truncateToBigInt(); } else { convertBound = d => d.truncate(); } diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 22072574b..caa258636 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -201,10 +201,19 @@ describe('Decimal', () => { describe('truncate', () => { it('should return the integer component', () => { + Decimal.from('1.9').truncate().should.equal(1); Decimal.from('-1.9').truncate().should.equal(-1); }); }); + describe('truncateToBigInt', () => { + it('should return the integer component as a BigInt', () => { + Decimal.from('1.9').truncateToBigInt().should.equal(1n); + Decimal.from('-1.9').truncateToBigInt().should.equal(-1n); + Decimal.from('9007199254740992').truncateToBigInt().should.equal(9007199254740992n); + }); + }); + describe('truncated', () => { it('should truncate to an optional decimal scale', () => { Decimal.from('-1.239').truncated(2).should.equalDecimal('-1.23'); From 802d918f359c0eef15702d76b8a8bdf772a01658 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:43:08 -0400 Subject: [PATCH 47/62] Add Decimal.nthRoot to try to preserve exact values where possible --- src/datatypes/decimal.ts | 18 ++++++++++++++++++ src/elm/aggregate.ts | 3 +-- test/datatypes/decimal-test.ts | 19 +++++++++++++++++++ test/elm/aggregate/data.cql | 2 ++ 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 061f69e3c..e67350702 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -244,6 +244,24 @@ export class Decimal { return this.applyWrapper(this.value.toPower, exponent); } + nthRoot(root: DecimalInput) { + // The goal of this method is to preserve exact values in common cases, + // by leveraging the decimal.js sqrt() and cubeRoot() methods for roots 2 and 3. + // For other roots, fall back to the power method with the inverse of the provided value. + // See docs on decimal.js pow, in particular the note about non-integer exponents: + // https://mikemcl.github.io/decimal.js/#pow + const rootAsDecimal = Decimal.from(root); + if (rootAsDecimal.equals(0)) { + throw new RangeError('Cannot take the zero-th root of a decimal'); + } else if (rootAsDecimal.equals(2)) { + return this.sqrt(); + } else if (rootAsDecimal.equals(3)) { + return new Decimal(this.value.cubeRoot()).withMinimumScale(this.scale); + } else { + return this.power(Decimal.from(1).divideBy(root)); + } + } + sqrt() { return new Decimal(this.value.sqrt()).withMinimumScale(this.scale); } diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index caae0f591..3cd194279 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -417,8 +417,7 @@ export class GeometricMean extends AggregateExpression { try { const product = productOfDecimals(decimals); - const oneOverLength = Decimal.from(1).divideBy(items.length); - const geoMean = product.power(oneOverLength); + const geoMean = product.nthRoot(items.length); return finalizeAggregateResult(geoMean, items[0]); } catch { return null; diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index caa258636..0777bf71a 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -255,6 +255,25 @@ describe('Decimal', () => { }); }); + describe('nthRoot', () => { + it('should take the provided root', () => { + Decimal.from(8).nthRoot(3).should.equalDecimal('2.0'); + Decimal.from(32).nthRoot(5).should.equalDecimal('2.0'); + Decimal.from(65536).nthRoot(16).should.equalDecimal('2.0'); + Decimal.from(4294967296).nthRoot(32).should.equalDecimal('2.0'); + + Decimal.from(9).nthRoot(2).should.equalDecimal('3.0'); + Decimal.from(81).nthRoot(4).should.equalDecimal('3.0'); + Decimal.from(243).nthRoot(5).should.equalDecimal('3.0'); + + Decimal.from(1).nthRoot(12345).should.equalDecimal('1.0'); + }); + + it('should reject a zero divisor', () => { + (() => Decimal.from(1).nthRoot(0)).should.throw(RangeError); + }); + }); + describe('sqrt', () => { it('should calculate square roots', () => { const result = Decimal.from('9.00').sqrt(); diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index 1ab8bb24b..feb508431 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -195,6 +195,8 @@ define null_geometric_mean: GeometricMean({1, 2, null}) define all_nulls: GeometricMean({null, null, null}) define also_null_geometric_mean: GeometricMean(null as List) define negative_geometric_mean: GeometricMean({-1.0, 4.0}) +define GeometricMeanThreeIdenticalDecimals: GeometricMean({2.0, 2.0, 2.0}) +define GeometricMeanExactCubeRoot: GeometricMean({2.0, 4.0, 8.0}) // @Test: AllTrue define at: AllTrue({true,true,true,true}) From e81f5c0a8abf92d2ba191898b83c2c3792faab5e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:44:27 -0400 Subject: [PATCH 48/62] Make Decimal.round parameter optional; unspecified or null = 0 --- src/datatypes/decimal.ts | 7 ++++++- test/elm/arithmetic/arithmetic-test.ts | 10 ++++++++++ test/elm/arithmetic/data.cql | 6 ++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index e67350702..05ad6e873 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -278,7 +278,12 @@ export class Decimal { return this.applyWrapper(this.value.log, base).withMinimumScale(this.scale); } - round(scale: number) { + round(scale?: number | null) { + // "If precision is not specified or null, 0 is assumed." + if (scale == null) { + scale = 0; + } + // notes on rounding modes // ROUND_HALF_UP "Rounds towards nearest neighbour. If equidistant, rounds away from zero" // rounds 0.5 -> 1.0, -0.5 -> -1.0 diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index ab9279190..7b437e295 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -684,6 +684,16 @@ describe('Round', () => { (await this.negativeHalf.exec(this.ctx)).should.equalDecimal(-1); (await this.negativeOnePointFive.exec(this.ctx)).should.equalDecimal(-2); }); + + it('should treat omitted or null precision as 0 precision', async function () { + (await this.roundPositiveHalfOmittedPrecision.exec(this.ctx)).should.equalDecimal(2.0); + (await this.roundPositiveHalfNullPrecision.exec(this.ctx)).should.equalDecimal(2.0); + (await this.roundPositiveHalfZeroPrecision.exec(this.ctx)).should.equalDecimal(2.0); + + (await this.roundNegativeHalfOmittedPrecision.exec(this.ctx)).should.equalDecimal(-2.0); + (await this.roundNegativeHalfNullPrecision.exec(this.ctx)).should.equalDecimal(-2.0); + (await this.roundNegativeHalfZeroPrecision.exec(this.ctx)).should.equalDecimal(-2.0); + }); }); describe('Successor', () => { diff --git a/test/elm/arithmetic/data.cql b/test/elm/arithmetic/data.cql index 0e0512ec2..6ad986a88 100644 --- a/test/elm/arithmetic/data.cql +++ b/test/elm/arithmetic/data.cql @@ -158,6 +158,12 @@ define Down: Round(4.49) define Down_percent: Round(4.43,1) define NegativeHalf: Round(-0.5) define NegativeOnePointFive: Round(-1.5) +define RoundPositiveHalfOmittedPrecision: Round(1.5) +define RoundPositiveHalfNullPrecision: Round(1.5, null as Integer) +define RoundPositiveHalfZeroPrecision: Round(1.5, 0) +define RoundNegativeHalfOmittedPrecision: Round(-1.5) +define RoundNegativeHalfNullPrecision: Round(-1.5, null as Integer) +define RoundNegativeHalfZeroPrecision: Round(-1.5, 0) // @Test: Ln define ln: Ln(4) From 2b1e02597d8b26353c57b620d57ad8b9fb4136da Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:46:02 -0400 Subject: [PATCH 49/62] Make sure aggregate operations like Mode, Except, etc, use value equality semantics (ignore trailing zeros) --- src/elm/aggregate.ts | 9 +- src/util/immutableUtil.ts | 3 +- test/elm/aggregate/aggregate-test.ts | 8 + test/elm/aggregate/data.cql | 2 + test/elm/aggregate/data.js | 478 +++++++++++++++++++++++- test/elm/list/data.cql | 4 + test/elm/list/data.js | 537 ++++++++++++++++++++++++++- test/elm/list/list-test.ts | 21 ++ 8 files changed, 1053 insertions(+), 9 deletions(-) diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 3cd194279..97a1c9465 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -6,6 +6,8 @@ import { Context } from '../runtime/context'; import { Exception } from '../datatypes/exception'; import { greaterThan, lessThan } from '../util/comparison'; import { build } from './builder'; +import { Map as ImmutableMap } from 'immutable'; +import { toNormalizedKey, NormalizedKey } from '../util/immutableUtil'; import * as MathUtil from '../util/math'; function finalizeAggregateResult(result: any, firstItem: any) { @@ -263,10 +265,13 @@ export class Mode extends AggregateExpression { mode(arr: any[]) { let max = 0; - const counts: any = {}; + // use ImmutableMap and NormalizedKeys, to compare objects using value equality + let counts = ImmutableMap(); let results: any[] = []; for (const elem of arr) { - const cnt = (counts[elem] = (counts[elem] != null ? counts[elem] : 0) + 1); + const key = toNormalizedKey(elem); + const cnt = (counts.get(key) ?? 0) + 1; + counts = counts.set(key, cnt); // note: set returns a new instance if (cnt === max && !results.includes(elem)) { results.push(elem); } else if (cnt > max) { diff --git a/src/util/immutableUtil.ts b/src/util/immutableUtil.ts index adeada848..6d174ecc1 100644 --- a/src/util/immutableUtil.ts +++ b/src/util/immutableUtil.ts @@ -77,7 +77,8 @@ export const toNormalizedKey = (js: any): NormalizedKey => { case Decimal: return ImmutableMap({ - value: js.toString(), + // Decimal value equality ignores trailing zeros, so scale is essentially ignored + value: js.withoutTrailingZeros().toString(), __instance: js.constructor }); diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 1f41fff0a..0498812f9 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -436,6 +436,14 @@ describe('Mode', () => { it('should be null if quantity units are not compatible', async function () { should(await this.incompatibleUnitsNull.exec(this.ctx)).be.null(); }); + + it('should use value equality for Decimals (ignores trailing zeros)', async function () { + (await this.modeDecimalsAcrossScales.exec(this.ctx)).should.equalDecimal('1.0'); + }); + + it('should use value equality for Quantities (ignores trailing zeros)', async function () { + validateQuantity(await this.modeDecimalQuantitiesAcrossScales.exec(this.ctx), '1.0', 'g'); + }); }); describe('PopulationVariance', () => { diff --git a/test/elm/aggregate/data.cql b/test/elm/aggregate/data.cql index feb508431..799eaad39 100644 --- a/test/elm/aggregate/data.cql +++ b/test/elm/aggregate/data.cql @@ -116,6 +116,8 @@ define QuantitySingleMode: Mode({1.0 'g', 1.0 'g', 2.0 'g'}) define QuantityBiModal: Mode({1.0 'g', 1.0 'g', 2.0 'g', 2.0 'g'}) define NumbersAndQuantities: Mode({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Mode({1 'mg/d', 0.002 '/d'}) +define ModeDecimalsAcrossScales: Mode({1.0, 1.00, 2.0}) +define ModeDecimalQuantitiesAcrossScales: Mode({ Quantity { value: 1.0, unit: 'g' }, Quantity { value: 1.00, unit: 'g' }, Quantity { value: 2.0, unit: 'g' } }) // @Test: Variance define v: Variance({1,2,3,4,5}) diff --git a/test/elm/aggregate/data.js b/test/elm/aggregate/data.js index e1ef717a5..98ea55848 100644 --- a/test/elm/aggregate/data.js +++ b/test/elm/aggregate/data.js @@ -11444,6 +11444,8 @@ define QuantitySingleMode: Mode({1.0 'g', 1.0 'g', 2.0 'g'}) define QuantityBiModal: Mode({1.0 'g', 1.0 'g', 2.0 'g', 2.0 'g'}) define NumbersAndQuantities: Mode({1 ,2 'ml',3 'ml',4 'ml',5 'ml',0 'ml'}) define IncompatibleUnitsNull: Mode({1 'mg/d', 0.002 '/d'}) +define ModeDecimalsAcrossScales: Mode({1.0, 1.00, 2.0}) +define ModeDecimalQuantitiesAcrossScales: Mode({ Quantity { value: 1.0, unit: 'g' }, Quantity { value: 1.00, unit: 'g' }, Quantity { value: 2.0, unit: 'g' } }) */ module.exports['Mode'] = { @@ -11458,7 +11460,7 @@ module.exports['Mode'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "364", + "r" : "395", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -12507,6 +12509,308 @@ module.exports['Mode'] = { } ] } } + }, { + "localId" : "379", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "ModeDecimalsAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "379", + "s" : [ { + "value" : [ "", "define ", "ModeDecimalsAcrossScales", ": " ] + }, { + "r" : "390", + "s" : [ { + "value" : [ "Mode", "(" ] + }, { + "r" : "380", + "s" : [ { + "r" : "381", + "value" : [ "{", "1.0", ", ", "1.00", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Mode", + "localId" : "390", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "391", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "392", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "380", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "384", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "385", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "381", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "382", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "383", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "395", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "name" : "ModeDecimalQuantitiesAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "395", + "s" : [ { + "value" : [ "", "define ", "ModeDecimalQuantitiesAcrossScales", ": " ] + }, { + "r" : "418", + "s" : [ { + "value" : [ "Mode", "(" ] + }, { + "r" : "396", + "s" : [ { + "value" : [ "{ " ] + }, { + "r" : "397", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "399", + "value" : [ "value", ": ", "1.0" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "400", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "402", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "404", + "value" : [ "value", ": ", "1.00" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "405", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ ", " ] + }, { + "r" : "407", + "s" : [ { + "value" : [ "Quantity", " { " ] + }, { + "s" : [ { + "r" : "409", + "value" : [ "value", ": ", "2.0" ] + } ] + }, { + "value" : [ ", " ] + }, { + "s" : [ { + "value" : [ "unit", ": " ] + }, { + "r" : "410", + "s" : [ { + "value" : [ "'g'" ] + } ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ " }" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "Mode", + "localId" : "418", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "419", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "420", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "396", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "412", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "413", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Instance", + "localId" : "397", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "399", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "400", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + }, { + "type" : "Instance", + "localId" : "402", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "404", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "405", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + }, { + "type" : "Instance", + "localId" : "407", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "classType" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ], + "element" : [ { + "name" : "value", + "value" : { + "type" : "Literal", + "localId" : "409", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } + }, { + "name" : "unit", + "value" : { + "type" : "Literal", + "localId" : "410", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}String", + "valueType" : "{urn:hl7-org:elm-types:r1}String", + "value" : "g", + "annotation" : [ ] + } + } ] + } ] + } + } } ] } } @@ -18974,6 +19278,8 @@ define null_geometric_mean: GeometricMean({1, 2, null}) define all_nulls: GeometricMean({null, null, null}) define also_null_geometric_mean: GeometricMean(null as List) define negative_geometric_mean: GeometricMean({-1.0, 4.0}) +define GeometricMeanThreeIdenticalDecimals: GeometricMean({2.0, 2.0, 2.0}) +define GeometricMeanExactCubeRoot: GeometricMean({2.0, 4.0, 8.0}) */ module.exports['GeometricMean'] = { @@ -18988,7 +19294,7 @@ module.exports['GeometricMean'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "325", + "r" : "358", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -19677,6 +19983,174 @@ module.exports['GeometricMean'] = { } ] } } + }, { + "localId" : "342", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "GeometricMeanThreeIdenticalDecimals", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "342", + "s" : [ { + "value" : [ "", "define ", "GeometricMeanThreeIdenticalDecimals", ": " ] + }, { + "r" : "353", + "s" : [ { + "value" : [ "GeometricMean", "(" ] + }, { + "r" : "343", + "s" : [ { + "r" : "344", + "value" : [ "{", "2.0", ", ", "2.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "GeometricMean", + "localId" : "353", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "354", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "355", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "343", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "347", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "348", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "344", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "345", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "346", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } + }, { + "localId" : "358", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "name" : "GeometricMeanExactCubeRoot", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "358", + "s" : [ { + "value" : [ "", "define ", "GeometricMeanExactCubeRoot", ": " ] + }, { + "r" : "369", + "s" : [ { + "value" : [ "GeometricMean", "(" ] + }, { + "r" : "359", + "s" : [ { + "r" : "360", + "value" : [ "{", "2.0", ", ", "4.0", ", ", "8.0", "}" ] + } ] + }, { + "value" : [ ")" ] + } ] + } ] + } + } ], + "expression" : { + "type" : "GeometricMean", + "localId" : "369", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ], + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "370", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "371", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "source" : { + "type" : "List", + "localId" : "359", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "363", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "364", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "360", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "361", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "4.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "362", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "8.0", + "annotation" : [ ] + } ] + } + } } ] } } diff --git a/test/elm/list/data.cql b/test/elm/list/data.cql index cce588569..4d31b3fe5 100644 --- a/test/elm/list/data.cql +++ b/test/elm/list/data.cql @@ -53,6 +53,7 @@ define NestedToFifteen: {1, 2, 3} union {4, 5, 6} union {7 ,8 , 9} union {10, 11 define NullUnion: null union {1, 2, 3} define UnionNull: {1, 2, 3} union null define nullUnionNull: (null as List) union (null as List) +define UnionDecimalsAcrossScales: {1.0, 2.0} union {1.00, 3.0} // @Test: Except @@ -69,6 +70,7 @@ define NothingExceptSomething: List{} except {1, 2, 3, 4, 5} define ExceptTuples: {Tuple{a: 1}, Tuple{a: 2}, Tuple{a: 3}} except {Tuple{a: 2}} define ExceptNull: {1, 2, 3, 4, 5} except null define NullExcept: null except {1, 2, 3, 4, 5} +define ExceptDecimalsAcrossScales: {1.0, 2.0} except {1.00, 3.0} // @Test: Intersect define NoIntersection: {1, 2, 2, 3} intersect {4, 5, 6} @@ -82,6 +84,7 @@ define IntersectTuples: {Tuple{a:1, b:'d'}, Tuple{a:1, b:'c'}, Tuple{a:2, b:'c'} define NullIntersect: null intersect {1, 2, 3} define IntersectNull: {1, 2, 3} intersect null define MultipleNullInListIntersect: {1, 2, 3, null} intersect {null, 3} +define IntersectDecimalsAcrossScales: {1.0, 2.0} intersect {1.00, 3.0} // @Test: IndexOf define IndexOfSecond: IndexOf({'a', 'b', 'c', 'd'}, 'b') @@ -229,6 +232,7 @@ define NoDups: distinct {2, 4, 6, 8, 10} define DupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' }, Tuple{ hello: 'world' }, Tuple{ hello: 'dolly' } } define NoDupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' } } define DuplicateNulls: distinct {null, 1, 2, null, 3, 4, 5, null} +define DistinctDecimalsAcrossScales: distinct {1.0, 1.00, 2.0} // @Test: First define Numbers: First({1, 2, 3, 4}) diff --git a/test/elm/list/data.js b/test/elm/list/data.js index ba67b01e7..c2cbdf3bb 100644 --- a/test/elm/list/data.js +++ b/test/elm/list/data.js @@ -6292,6 +6292,7 @@ define NestedToFifteen: {1, 2, 3} union {4, 5, 6} union {7 ,8 , 9} union {10, 11 define NullUnion: null union {1, 2, 3} define UnionNull: {1, 2, 3} union null define nullUnionNull: (null as List) union (null as List) +define UnionDecimalsAcrossScales: {1.0, 2.0} union {1.00, 3.0} */ module.exports['Union'] = { @@ -6306,7 +6307,7 @@ module.exports['Union'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "455", + "r" : "487", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8092,6 +8093,147 @@ module.exports['Union'] = { } } ] } + }, { + "localId" : "487", + "name" : "UnionDecimalsAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "487", + "s" : [ { + "value" : [ "", "define ", "UnionDecimalsAcrossScales", ": " ] + }, { + "r" : "498", + "s" : [ { + "r" : "488", + "s" : [ { + "r" : "489", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " union " ] + }, { + "r" : "493", + "s" : [ { + "r" : "494", + "value" : [ "{", "1.00", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "505", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "506", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Union", + "localId" : "498", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "503", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "504", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "499", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "500", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "501", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "502", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "488", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "491", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "492", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "489", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "490", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "493", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "496", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "497", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "494", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "495", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -8114,6 +8256,7 @@ define NothingExceptSomething: List{} except {1, 2, 3, 4, 5} define ExceptTuples: {Tuple{a: 1}, Tuple{a: 2}, Tuple{a: 3}} except {Tuple{a: 2}} define ExceptNull: {1, 2, 3, 4, 5} except null define NullExcept: null except {1, 2, 3, 4, 5} +define ExceptDecimalsAcrossScales: {1.0, 2.0} except {1.00, 3.0} */ module.exports['Except'] = { @@ -8128,7 +8271,7 @@ module.exports['Except'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "525", + "r" : "549", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -10369,6 +10512,147 @@ module.exports['Except'] = { } ] } ] } + }, { + "localId" : "549", + "name" : "ExceptDecimalsAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "549", + "s" : [ { + "value" : [ "", "define ", "ExceptDecimalsAcrossScales", ": " ] + }, { + "r" : "560", + "s" : [ { + "r" : "550", + "s" : [ { + "r" : "551", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " except " ] + }, { + "r" : "555", + "s" : [ { + "r" : "556", + "value" : [ "{", "1.00", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "567", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "568", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Except", + "localId" : "560", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "565", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "566", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "561", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "562", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "563", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "564", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "550", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "553", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "554", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "551", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "552", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "555", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "558", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "559", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "556", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "557", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -10389,6 +10673,7 @@ define IntersectTuples: {Tuple{a:1, b:'d'}, Tuple{a:1, b:'c'}, Tuple{a:2, b:'c'} define NullIntersect: null intersect {1, 2, 3} define IntersectNull: {1, 2, 3} intersect null define MultipleNullInListIntersect: {1, 2, 3, null} intersect {null, 3} +define IntersectDecimalsAcrossScales: {1.0, 2.0} intersect {1.00, 3.0} */ module.exports['Intersect'] = { @@ -10403,7 +10688,7 @@ module.exports['Intersect'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "593", + "r" : "619", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -13134,6 +13419,147 @@ module.exports['Intersect'] = { } ] } ] } + }, { + "localId" : "619", + "name" : "IntersectDecimalsAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "619", + "s" : [ { + "value" : [ "", "define ", "IntersectDecimalsAcrossScales", ": " ] + }, { + "r" : "630", + "s" : [ { + "r" : "620", + "s" : [ { + "r" : "621", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " intersect " ] + }, { + "r" : "625", + "s" : [ { + "r" : "626", + "value" : [ "{", "1.00", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "637", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "638", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Intersect", + "localId" : "630", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "635", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "636", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "631", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "632", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "633", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "634", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "620", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "623", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "624", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "621", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "622", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "625", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "628", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "629", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "626", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "627", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -37225,6 +37651,7 @@ define NoDups: distinct {2, 4, 6, 8, 10} define DupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' }, Tuple{ hello: 'world' }, Tuple{ hello: 'dolly' } } define NoDupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' } } define DuplicateNulls: distinct {null, 1, 2, null, 3, 4, 5, null} +define DistinctDecimalsAcrossScales: distinct {1.0, 1.00, 2.0} */ module.exports['Distinct'] = { @@ -37239,7 +37666,7 @@ module.exports['Distinct'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "374", + "r" : "398", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -38541,6 +38968,108 @@ module.exports['Distinct'] = { } ] } } + }, { + "localId" : "398", + "name" : "DistinctDecimalsAcrossScales", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "398", + "s" : [ { + "value" : [ "", "define ", "DistinctDecimalsAcrossScales", ": " ] + }, { + "r" : "399", + "s" : [ { + "value" : [ "distinct " ] + }, { + "r" : "400", + "s" : [ { + "r" : "401", + "value" : [ "{", "1.0", ", ", "1.00", ", ", "2.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "410", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "411", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Distinct", + "localId" : "399", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "408", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "409", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "406", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "407", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : { + "type" : "List", + "localId" : "400", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "404", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "405", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "401", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "402", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.00", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "403", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } } ] } } diff --git a/test/elm/list/list-test.ts b/test/elm/list/list-test.ts index fba739f4b..eb9b7a36b 100644 --- a/test/elm/list/list-test.ts +++ b/test/elm/list/list-test.ts @@ -1,6 +1,7 @@ import should from 'should'; import setup from '../../setup'; import { getLocalIdByPath } from '../../testHelpers'; +import { Decimal } from '../../../src/datatypes/decimal'; const data = require('./data'); describe('List', () => { @@ -203,6 +204,11 @@ describe('Union', () => { it('should return an empty list if both args are null but expected to be lists', async function () { (await this.nullUnionNull.exec(this.ctx)).should.be.eql([]); }); + + it('should use equality semantics for Decimal (ignores scale)', async function () { + const expected = ['1.0', '2.0', '3.0'].map(Decimal.from); + should(await this.unionDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); + }); }); describe('Except', () => { @@ -257,6 +263,11 @@ describe('Except', () => { it('should return first arg if second arg is null', async function () { (await this.exceptNull.exec(this.ctx)).should.eql([1, 2, 3, 4, 5]); }); + + it('should use equality semantics for Decimal (ignores scale)', async function () { + const expected = [Decimal.from('2.0')]; + should(await this.exceptDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); + }); }); describe('Intersect', () => { @@ -307,6 +318,11 @@ describe('Intersect', () => { it('should intersect two lists that contain null', async function () { (await this.multipleNullInListIntersect.exec(this.ctx)).should.eql([3, null]); }); + + it('should use equality semantics for Decimal (ignores scale)', async function () { + const expected = [Decimal.from('1.0')]; + should(await this.intersectDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); + }); }); describe('IndexOf', () => { @@ -847,6 +863,11 @@ describe('Distinct', () => { // define DuplicateNulls: distinct {null, 1, 2, null, 3, 4, 5, null} (await this.duplicateNulls.exec(this.ctx)).should.eql([null, 1, 2, 3, 4, 5]); }); + + it('should use equality semantics for Decimal (ignores scale)', async function () { + const expected = [Decimal.from('1.0'), Decimal.from('2.0')]; + should(await this.distinctDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); + }); }); describe('First', () => { From 7615e7fd23d364a1f7cbdb530db2748359be5844 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Sep 2026 12:46:29 -0400 Subject: [PATCH 50/62] More interval expand examples --- test/elm/interval/data.cql | 2 + test/elm/interval/data.js | 226 ++++++++++++++++++++++++++++++++++++- 2 files changed, 226 insertions(+), 2 deletions(-) diff --git a/test/elm/interval/data.cql b/test/elm/interval/data.cql index a0f21523c..d340dfcfc 100644 --- a/test/elm/interval/data.cql +++ b/test/elm/interval/data.cql @@ -1633,6 +1633,7 @@ define LongNullBoth: expand { Interval[null, null] } per 1 '1' define LongBadPerMinute: expand { Interval(2L, 4L] } per 1 minute define LongPerDecimalMorePrecise: expand { Interval[10L, 10L] } per 0.1 +define ExpandLargePositiveLongInterval: expand Interval[9007199254740993L, 9007199254740995L] // @Test: DecimalIntervalExpand define ClosedSingle: expand { Interval[2, 5] } per 1.5 '1' @@ -1656,6 +1657,7 @@ define NullOpen: expand { Interval[null, 4] } per 1.5 '1' define NullClose: expand { Interval[2, null] } per 1.5 '1' define NullBoth: expand { Interval[null, null] } per 1.5 '1' define BadPerMinute: expand { Interval(2.1, 4.1] } per 0.5 minute +define ExpandLargeDecimalIntervalFractionalStep: expand Interval[9007199254740993.0, 9007199254740993.3] per 0.1 // @Test: SameAs define NullBoth: Interval[null as DateTime, null as DateTime] same as Interval[null as DateTime, null as DateTime] diff --git a/test/elm/interval/data.js b/test/elm/interval/data.js index 4ad13753e..fe5b3d0bc 100644 --- a/test/elm/interval/data.js +++ b/test/elm/interval/data.js @@ -289729,6 +289729,7 @@ define LongNullBoth: expand { Interval[null, null] } per 1 '1' define LongBadPerMinute: expand { Interval(2L, 4L] } per 1 minute define LongPerDecimalMorePrecise: expand { Interval[10L, 10L] } per 0.1 +define ExpandLargePositiveLongInterval: expand Interval[9007199254740993L, 9007199254740995L] */ module.exports['LongIntervalExpand'] = { @@ -289743,7 +289744,7 @@ module.exports['LongIntervalExpand'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "652", + "r" : "678", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -292750,6 +292751,114 @@ module.exports['LongIntervalExpand'] = { "annotation" : [ ] } ] } + }, { + "localId" : "678", + "name" : "ExpandLargePositiveLongInterval", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "678", + "s" : [ { + "value" : [ "", "define ", "ExpandLargePositiveLongInterval", ": " ] + }, { + "r" : "685", + "s" : [ { + "value" : [ "expand " ] + }, { + "r" : "681", + "s" : [ { + "r" : "679", + "value" : [ "Interval[", "9007199254740993L", ", ", "9007199254740995L", "]" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "691", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "692", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Expand", + "localId" : "685", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "689", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "690", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "IntervalTypeSpecifier", + "localId" : "686", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "687", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } + }, { + "type" : "NamedTypeSpecifier", + "localId" : "688", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Interval", + "localId" : "681", + "lowClosed" : true, + "highClosed" : true, + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "682", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "683", + "name" : "{urn:hl7-org:elm-types:r1}Long", + "annotation" : [ ] + } + }, + "low" : { + "type" : "Literal", + "localId" : "679", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "9007199254740993", + "annotation" : [ ] + }, + "high" : { + "type" : "Literal", + "localId" : "680", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Long", + "valueType" : "{urn:hl7-org:elm-types:r1}Long", + "value" : "9007199254740995", + "annotation" : [ ] + } + }, { + "type" : "Null", + "localId" : "684", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ] + } } ] } } @@ -292780,6 +292889,7 @@ define NullOpen: expand { Interval[null, 4] } per 1.5 '1' define NullClose: expand { Interval[2, null] } per 1.5 '1' define NullBoth: expand { Interval[null, null] } per 1.5 '1' define BadPerMinute: expand { Interval(2.1, 4.1] } per 0.5 minute +define ExpandLargeDecimalIntervalFractionalStep: expand Interval[9007199254740993.0, 9007199254740993.3] per 0.1 */ module.exports['DecimalIntervalExpand'] = { @@ -292794,7 +292904,7 @@ module.exports['DecimalIntervalExpand'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "633", + "r" : "658", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -295668,6 +295778,118 @@ module.exports['DecimalIntervalExpand'] = { "annotation" : [ ] } ] } + }, { + "localId" : "658", + "name" : "ExpandLargeDecimalIntervalFractionalStep", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "658", + "s" : [ { + "value" : [ "", "define ", "ExpandLargeDecimalIntervalFractionalStep", ": " ] + }, { + "r" : "667", + "s" : [ { + "value" : [ "expand " ] + }, { + "r" : "661", + "s" : [ { + "r" : "659", + "value" : [ "Interval[", "9007199254740993.0", ", ", "9007199254740993.3", "]" ] + } ] + }, { + "r" : "665", + "value" : [ " per ", "0.1" ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "673", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "674", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Expand", + "localId" : "667", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "671", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "672", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "IntervalTypeSpecifier", + "localId" : "668", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "669", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "NamedTypeSpecifier", + "localId" : "670", + "name" : "{urn:hl7-org:elm-types:r1}Quantity", + "annotation" : [ ] + } ], + "operand" : [ { + "type" : "Interval", + "localId" : "661", + "lowClosed" : true, + "highClosed" : true, + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "IntervalTypeSpecifier", + "localId" : "662", + "annotation" : [ ], + "pointType" : { + "type" : "NamedTypeSpecifier", + "localId" : "663", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "low" : { + "type" : "Literal", + "localId" : "659", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "9007199254740993.0", + "annotation" : [ ] + }, + "high" : { + "type" : "Literal", + "localId" : "660", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "9007199254740993.3", + "annotation" : [ ] + } + }, { + "type" : "Quantity", + "localId" : "666", + "value" : 0.1, + "unit" : "1", + "annotation" : [ ] + } ] + } } ] } } From 991acc52e8b00e109492443ea426832ef340e2d9 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 11 Sep 2026 09:37:43 -0400 Subject: [PATCH 51/62] remove Quantity do(+,-,/) helper functions. Point existing tests at MathUtil for now --- src/datatypes/quantity.ts | 16 +-------- test/elm/arithmetic/arithmetic-test.ts | 16 +++------ test/elm/quantity/quantity-test.ts | 48 ++++++++++++++------------ 3 files changed, 32 insertions(+), 48 deletions(-) diff --git a/src/datatypes/quantity.ts b/src/datatypes/quantity.ts index 433ddc2d4..ee7926436 100644 --- a/src/datatypes/quantity.ts +++ b/src/datatypes/quantity.ts @@ -1,4 +1,4 @@ -import { add, subtract, isValidDecimal, overflowsOrUnderflows } from '../util/math'; +import { isValidDecimal, overflowsOrUnderflows } from '../util/math'; import { Decimal } from './decimal'; import { checkUnit, @@ -188,20 +188,6 @@ export function parseQuantity(str: string) { } } -export function doAddition(a: any, b: any) { - return add(a, b); -} - -export function doSubtraction(a: any, b: any) { - return subtract(a, b); -} - -export function doDivision(a: any, b: any) { - if (a != null && a.isQuantity) { - return a.dividedBy(b); - } -} - export function doMultiplication(a: any, b: any) { if (a != null && a.isQuantity) { return a.multiplyBy(b); diff --git a/test/elm/arithmetic/arithmetic-test.ts b/test/elm/arithmetic/arithmetic-test.ts index 7b437e295..f0e50f9ef 100644 --- a/test/elm/arithmetic/arithmetic-test.ts +++ b/test/elm/arithmetic/arithmetic-test.ts @@ -1,12 +1,6 @@ import should from 'should'; -import { - doAddition, - doDivision, - doMultiplication, - doSubtraction, - parseQuantity, - Quantity -} from '../../../src/datatypes/quantity'; +import { doMultiplication, parseQuantity, Quantity } from '../../../src/datatypes/quantity'; +import * as MathUtil from '../../../src/util/math'; import setup from '../../setup'; import { MAX_INT_VALUE, @@ -41,11 +35,11 @@ const doQuantityMathTests = function (tests: string[][], operator: string) { if (operator === '*') { func = doMultiplication; } else if (operator === '/') { - func = doDivision; + func = (a: Quantity, b: Quantity) => a.dividedBy(b); } else if (operator === '+') { - func = doAddition; + func = MathUtil.add; } else if (operator === '-') { - func = doSubtraction; + func = MathUtil.subtract; } for (const t of tests) { diff --git a/test/elm/quantity/quantity-test.ts b/test/elm/quantity/quantity-test.ts index 74817d03c..1b887a38e 100644 --- a/test/elm/quantity/quantity-test.ts +++ b/test/elm/quantity/quantity-test.ts @@ -1,11 +1,6 @@ import should from 'should'; -import { - doAddition, - doDivision, - doMultiplication, - doSubtraction, - Quantity -} from '../../../src/datatypes/quantity'; +import { doMultiplication, Quantity } from '../../../src/datatypes/quantity'; +import * as MathUtil from '../../../src/util/math'; describe('Quantity', () => { it('should allow creation of Quantity with valid ucum units', () => @@ -86,14 +81,14 @@ describe('Quantity', () => { const quantity1 = new Quantity(2, 'm'); const quantity2 = new Quantity(2, 'm'); quantity2.unit = 'fakeUnit'; - should(doAddition(quantity1, quantity2)).be.null(); + should(MathUtil.add(quantity1, quantity2)).be.null(); }); it('subtracted from Quantity with invalid ucum units results in null', () => { const quantity1 = new Quantity(2, 'm'); const quantity2 = new Quantity(2, 'm'); quantity2.unit = 'fakeUnit'; - should(doSubtraction(quantity1, quantity2)).be.null(); + should(MathUtil.subtract(quantity1, quantity2)).be.null(); }); it('multiplied by Quantity with invalid ucum units results in null', () => { @@ -107,7 +102,7 @@ describe('Quantity', () => { const quantity1 = new Quantity(2, 'm'); const quantity2 = new Quantity(2, 'm'); quantity2.unit = 'fakeUnit'; - should(doDivision(quantity1, quantity2)).be.null(); + should(quantity1.dividedBy(quantity2)).be.null(); }); it('should convert units when possible to perform arithmetic', () => { @@ -115,16 +110,16 @@ describe('Quantity', () => { divide.equals(new Quantity(16, '1')).should.be.true(); const multiply = new Quantity(8, 'cm').multiplyBy(new Quantity(2, 'm')); multiply.equals(new Quantity(0.16, 'm2')).should.be.true(); - const add = doAddition(new Quantity(8, 'cm'), new Quantity(2, 'm')); + const add = MathUtil.add(new Quantity(8, 'cm'), new Quantity(2, 'm')); add.equals(new Quantity(2.08, 'm')).should.be.true(); - const subtract = doSubtraction(new Quantity(150, 'cm'), new Quantity(1, 'm')); + const subtract = MathUtil.subtract(new Quantity(150, 'cm'), new Quantity(1, 'm')); subtract.equals(new Quantity(0.5, 'm')).should.be.true(); }); it('should return null when units are mismatched and cannot be converted', () => { - const add = doAddition(new Quantity(8, 'cm'), new Quantity(2, 'g')); + const add = MathUtil.add(new Quantity(8, 'cm'), new Quantity(2, 'g')); should.not.exist(add); - const subtract = doSubtraction(new Quantity(150, 'cm'), new Quantity(1, 'mg')); + const subtract = MathUtil.subtract(new Quantity(150, 'cm'), new Quantity(1, 'mg')); should.not.exist(subtract); }); @@ -138,11 +133,17 @@ describe('Quantity', () => { const multiplyWithOneOnRight = new Quantity(8, 'm').multiplyBy(new Quantity(2, '1')); const multiplyWithNullOnRight = new Quantity(8, 'm').multiplyBy(new Quantity(2, unit)); multiplyWithOneOnRight.should.deepEqual(multiplyWithNullOnRight); - const addWithOneOnRight = doAddition(new Quantity(8, '1'), new Quantity(2, '1')); - const addWithNullOnRight = doAddition(new Quantity(8, '1'), new Quantity(2, unit)); + const addWithOneOnRight = MathUtil.add(new Quantity(8, '1'), new Quantity(2, '1')); + const addWithNullOnRight = MathUtil.add(new Quantity(8, '1'), new Quantity(2, unit)); addWithOneOnRight.should.deepEqual(addWithNullOnRight); - const subtractWithOneOnRight = doSubtraction(new Quantity(8, '1'), new Quantity(2, '1')); - const subtractWithNullOnRight = doSubtraction(new Quantity(8, '1'), new Quantity(2, unit)); + const subtractWithOneOnRight = MathUtil.subtract( + new Quantity(8, '1'), + new Quantity(2, '1') + ); + const subtractWithNullOnRight = MathUtil.subtract( + new Quantity(8, '1'), + new Quantity(2, unit) + ); subtractWithOneOnRight.should.deepEqual(subtractWithNullOnRight); const divideWithOneOnLeft = new Quantity(8, '1').dividedBy(new Quantity(2, 'm')); @@ -151,11 +152,14 @@ describe('Quantity', () => { const multiplyWithOneOnLeft = new Quantity(8, '1').multiplyBy(new Quantity(2, 'm')); const multiplyWithNullOnLeft = new Quantity(8, unit).multiplyBy(new Quantity(2, 'm')); multiplyWithOneOnLeft.should.deepEqual(multiplyWithNullOnLeft); - const addWithOneOnLeft = doAddition(new Quantity(8, '1'), new Quantity(2, '1')); - const addWithNullOnLeft = doAddition(new Quantity(8, unit), new Quantity(2, '1')); + const addWithOneOnLeft = MathUtil.add(new Quantity(8, '1'), new Quantity(2, '1')); + const addWithNullOnLeft = MathUtil.add(new Quantity(8, unit), new Quantity(2, '1')); addWithOneOnLeft.should.deepEqual(addWithNullOnLeft); - const subtractWithOneOnLeft = doSubtraction(new Quantity(8, '1'), new Quantity(2, '1')); - const subtractWithNullOnLeft = doSubtraction(new Quantity(8, unit), new Quantity(2, '1')); + const subtractWithOneOnLeft = MathUtil.subtract(new Quantity(8, '1'), new Quantity(2, '1')); + const subtractWithNullOnLeft = MathUtil.subtract( + new Quantity(8, unit), + new Quantity(2, '1') + ); subtractWithOneOnLeft.should.deepEqual(subtractWithNullOnLeft); }); })(unit); From 7574ce1daa0f05cdaf1e1106bc667fa5da9c9d1b Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 11 Sep 2026 10:51:42 -0400 Subject: [PATCH 52/62] simplify units logic, remove division factor --- src/util/units.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/util/units.ts b/src/util/units.ts index 0a539c194..782b52351 100644 --- a/src/util/units.ts +++ b/src/util/units.ts @@ -79,7 +79,6 @@ export function convertUnit(fromVal: Decimal, fromUnit: any, toUnit: any) { // First though, make sure the units can be safely converted by simple scalar factor. // Units that cannot because they require a special function, such as C <--> F, // fall back to calling the UCUM library directly. - const testFrom = utils.convertToBaseUnits(fromUnit, 1); const testTo = utils.convertToBaseUnits(toUnit, 1); @@ -89,23 +88,12 @@ export function convertUnit(fromVal: Decimal, fromUnit: any, toUnit: any) { let rawResult: Decimal; if (testFrom.fromUnitIsSpecial === false && testTo.fromUnitIsSpecial === false) { - // try both directions to see if one is more exact, - // eg, days to weeks is * 0.142857... but weeks to days is * 7, so days to weeks could be / 7 instead - const fromToTo = utils.convertUnitTo(fromUnit, 1, toUnit); - const toToFrom = utils.convertUnitTo(toUnit, 1, fromUnit); - if (fromToTo.status !== 'succeeded' || toToFrom.status !== 'succeeded') { + const conversion = utils.convertUnitTo(fromUnit, 1, toUnit); + if (conversion.status !== 'succeeded') { return; } - - const multFactor = fromToTo.toVal; - const divFactor = toToFrom.toVal; // NOTE: conversion factor is a JS number and can itself be imprecise, eg, inches to m is 0.025400000000000002 - if (Number.isInteger(divFactor)) { - rawResult = fromVal.divideBy(divFactor); - } else { - // We could consider more heuristics here, but for now just fall back to the multiplication factor - rawResult = fromVal.multiplyBy(multFactor); - } + rawResult = fromVal.multiplyBy(conversion.toVal); } else { // units are special, so call the library with the exact value const result = utils.convertUnitTo(fromUnit, fromVal.toNumber(), toUnit); From 8d7354aa80a7ce396e27d22e1fdce5d7dc2447d8 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 07:24:56 -0400 Subject: [PATCH 53/62] remove Decimal.truncated, export TRUNCATE_TO_PRECISION rounding mode --- src/datatypes/decimal.ts | 16 ++-------------- src/elm/interval.ts | 6 +++--- test/datatypes/decimal-test.ts | 24 +++++++++--------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index 05ad6e873..ca927e657 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -12,8 +12,8 @@ export type DecimalInput = Decimal | string | number | bigint; export type DecimalRoundingMode = DecimalJS.Rounding; const CQL_IMPLICIT_SCALE = 8; -const CQL_IMPLICIT_ROUNDING = CQLDecimalJS.ROUND_HALF_UP; -const TRUNCATE_TO_PRECISION = CQLDecimalJS.ROUND_DOWN; +export const CQL_IMPLICIT_ROUNDING = CQLDecimalJS.ROUND_HALF_UP; +export const TRUNCATE_TO_PRECISION = CQLDecimalJS.ROUND_DOWN; export class Decimal { private readonly value: DecimalJS; @@ -216,18 +216,6 @@ export class Decimal { return BigInt(this.value.truncated().toString()); } - truncated(scale?: number): Decimal { - // specifying a scale here allows for "truncating to a precision" - // this is currently used in Interval.expand - - if (!scale) { - // undefined or 0 both mean truncated to an integer - return new Decimal(this.value.truncated(), 0); - } - - return this.withScale(scale, TRUNCATE_TO_PRECISION); - } - ceil(): number { return this.value.ceil().toNumber(); } diff --git a/src/elm/interval.ts b/src/elm/interval.ts index b5090d5c1..5074262d9 100644 --- a/src/elm/interval.ts +++ b/src/elm/interval.ts @@ -9,7 +9,7 @@ import { Context } from '../runtime/context'; import { build } from './builder'; import { IntervalTypeSpecifier, NamedTypeSpecifier } from '../types/type-specifiers.interfaces'; import { ELM_ANY_TYPE, ELM_NAMED_TYPE_SPECIFIER } from '../util/elmTypes'; -import { Decimal } from '../datatypes/decimal'; +import { Decimal, TRUNCATE_TO_PRECISION } from '../datatypes/decimal'; import { MAX_INT_VALUE, MIN_INT_VALUE } from '../util/limits'; export class Interval extends Expression { @@ -682,8 +682,8 @@ export class Expand extends Expression { // If the interval boundaries are more precise than the per quantity, the // more precise values will be truncated to the precision specified by the // per quantity. - low = low.truncated(perValue.scale); - high = high.truncated(perValue.scale); + low = low.withScale(perValue.scale, TRUNCATE_TO_PRECISION); + high = high.withScale(perValue.scale, TRUNCATE_TO_PRECISION); const perUnitSize = perIsIntegral ? 1 : 0.00000001; // NOTE: This is based on the size of an interval being based on the point-size of the type. diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 0777bf71a..9fce2b2ee 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -1,4 +1,4 @@ -import { Decimal } from '../../src/datatypes/decimal'; +import { Decimal, TRUNCATE_TO_PRECISION } from '../../src/datatypes/decimal'; describe('Decimal', () => { describe('from', () => { @@ -214,19 +214,6 @@ describe('Decimal', () => { }); }); - describe('truncated', () => { - it('should truncate to an optional decimal scale', () => { - Decimal.from('-1.239').truncated(2).should.equalDecimal('-1.23'); - Decimal.from('1.9').truncated().should.equalDecimal('1.0'); - }); - - it('should treat scale zero as integer truncation', () => { - const result = Decimal.from('1.99').truncated(0); - result.should.equalDecimal('1.0'); - result.scale.should.equal(0); - }); - }); - describe('ceil', () => { it('should return the smallest integer not less than the value', () => { Decimal.from('1.1').ceil().should.equal(2); @@ -310,11 +297,18 @@ describe('Decimal', () => { }); describe('withScale', () => { - it('should use CQL half-up rounding', () => { + it('should use CQL half-up rounding if no rounding mode specified', () => { Decimal.from('-0.5').withScale(0).should.equalDecimal('-1.0'); Decimal.from('0.444444444').withScale(8).should.equalDecimal('0.44444444'); }); + it('should truncate to precision when specified', () => { + Decimal.from('-0.5').withScale(0, TRUNCATE_TO_PRECISION).should.equalDecimal('0'); + Decimal.from('1.777').withScale(0, TRUNCATE_TO_PRECISION).should.equalDecimal('1'); + Decimal.from('1.777').withScale(1, TRUNCATE_TO_PRECISION).should.equalDecimal('1.7'); + Decimal.from('1.777').withScale(2, TRUNCATE_TO_PRECISION).should.equalDecimal('1.77'); + }); + it('should reject invalid scales', () => { (() => Decimal.from(1).withScale(-1)).should.throw(RangeError); (() => Decimal.from(1).withScale(1.5)).should.throw(RangeError); From 06e8c845d635223e8c1b90d62b9e2791ac3cbd05 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 07:49:29 -0400 Subject: [PATCH 54/62] update cql-tests to the latest --- .../cql/CqlArithmeticFunctionsTest.cql | 50 +- .../cql/CqlArithmeticFunctionsTest.json | 790 +++++++++++++++++- .../cql/CqlDateTimeOperatorsTest.cql | 8 + .../cql/CqlDateTimeOperatorsTest.json | 354 ++++++++ test/spec-tests/skip-list.txt | 21 +- .../xml/CqlArithmeticFunctionsTest.xml | 37 +- .../xml/CqlDateTimeOperatorsTest.xml | 10 + 7 files changed, 1189 insertions(+), 81 deletions(-) diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql index 624ae2173..b57c1a44b 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql @@ -694,23 +694,37 @@ define "Predecessor": Tuple{ output: 0L }, "PredecessorOf1D": Tuple{ - skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147' + skipped: 'Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware.' /* expression: predecessor of 1.0, output: 0.99999999 */ }, "PredecessorOf101D": Tuple{ - skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + skipped: 'Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware' /* expression: predecessor of 1.01, output: 1.00999999 */ }, + "PredecessorOf1DPrecision": Tuple{ + expression: predecessor of 1.0, + output: 0.9 + }, + "PredecessorOf101DPrecision": Tuple{ + expression: predecessor of 1.01, + output: 1.00 + }, "PredecessorOf1QCM": Tuple{ - skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + skipped: 'Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware' /* expression: predecessor of 1.0 'cm', output: 0.99999999'cm' */ }, + "PredecessorOf1QCMPrecision": Tuple{ + skipped: 'Wrong answer: Translator loses Decimal in ELM representation of Quantity literal.' + /* + expression: predecessor of 1.0 'cm', + output: 0.9'cm' + */ }, "PredecessorOfJan12000": Tuple{ expression: predecessor of DateTime(2000,1,1), output: @1999-12-31T @@ -896,17 +910,25 @@ define "Successor": Tuple{ output: 2L }, "SuccessorOf1D": Tuple{ - skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + skipped: 'Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware' /* expression: successor of 1.0, output: 1.00000001 */ }, "SuccessorOf101D": Tuple{ - skipped: 'Wrong output: As of 2.0 Successor of Decimal should be precision-aware' + skipped: 'Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware' /* expression: successor of 1.01, output: 1.01000001 */ }, + "SuccessorOf1DPrecision": Tuple{ + expression: successor of 1.0, + output: 1.1 + }, + "SuccessorOf101DPrecision": Tuple{ + expression: successor of 1.01, + output: 1.02 + }, "SuccessorOfJan12000": Tuple{ expression: successor of DateTime(2000,1,1), output: @2000-01-02T @@ -1050,23 +1072,17 @@ define "Truncated Divide": Tuple{ output: 2.0 }, "TruncatedDivide10d1ByNeg3D1Quantity": Tuple{ - skipped: 'Wrong output: The resulting Quantity should have an appropriate unit; \'g\' / \'g\' should be \'1\', not \'g\'. See https://github.com/cqframework/cql-tests/pull/148' - /* expression: 10.1 'cm' div -3.1 'cm', - output: -3.0 'cm' - */ }, + output: -3.0 '1' + }, "TruncatedDivide10By5DQuantity": Tuple{ - skipped: 'Wrong output: The resulting Quantity should have an appropriate unit' - /* expression: 10.0 'g' div 5.0 'g', - output: 2.0 'g' - */ }, + output: 2.0 '1' + }, "TruncatedDivide414By206DQuantity": Tuple{ - skipped: 'Wrong output: The resulting Quantity should have an appropriate unit' - /* expression: 4.14 'm' div 2.06 'm', - output: 2.0 'm' - */ }, + output: 2.0 '1' + }, "TruncatedDivide10By0DQuantity": Tuple{ expression: 10.0 'g' div 0.0 'g', output: null diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json index 82e90b7ee..2bb93b119 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json @@ -18342,6 +18342,62 @@ ] } }, + { + "name": "PredecessorOf1DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "PredecessorOf101DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, { "name": "PredecessorOf1QCM", "annotation": [], @@ -18361,6 +18417,25 @@ ] } }, + { + "name": "PredecessorOf1QCMPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "PredecessorOfJan12000", "annotation": [], @@ -18632,6 +18707,62 @@ ] } }, + { + "name": "PredecessorOf1DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "PredecessorOf101DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, { "name": "PredecessorOf1QCM", "annotation": [], @@ -18651,6 +18782,25 @@ ] } }, + { + "name": "PredecessorOf1QCMPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + } + }, { "name": "PredecessorOfJan12000", "annotation": [], @@ -19044,7 +19194,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147", + "value": "Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware.", "annotation": [] } } @@ -19078,7 +19228,125 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", + "value": "Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware", + "annotation": [] + } + } + ] + } + }, + { + "name": "PredecessorOf1DPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Predecessor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "0.9", + "annotation": [] + } + } + ] + } + }, + { + "name": "PredecessorOf101DPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Predecessor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.01", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.00", "annotation": [] } } @@ -19112,7 +19380,41 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", + "value": "Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware", + "annotation": [] + } + } + ] + } + }, + { + "name": "PredecessorOf1QCMPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Wrong answer: Translator loses Decimal in ELM representation of Quantity literal.", "annotation": [] } } @@ -23480,6 +23782,62 @@ ] } }, + { + "name": "SuccessorOf1DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "SuccessorOf101DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, { "name": "SuccessorOfJan12000", "annotation": [], @@ -23751,6 +24109,62 @@ ] } }, + { + "name": "SuccessorOf1DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, + { + "name": "SuccessorOf101DPrecision", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + } + }, { "name": "SuccessorOfJan12000", "annotation": [], @@ -24138,7 +24552,100 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", + "value": "Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware", + "annotation": [] + } + } + ] + } + }, + { + "name": "SuccessorOf101D", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "skipped", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}String", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "skipped", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}String", + "valueType": "{urn:hl7-org:elm-types:r1}String", + "value": "Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware", + "annotation": [] + } + } + ] + } + }, + { + "name": "SuccessorOf1DPrecision", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "Successor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.0", + "annotation": [] + } + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.1", "annotation": [] } } @@ -24146,7 +24653,7 @@ } }, { - "name": "SuccessorOf101D", + "name": "SuccessorOf101DPrecision", "value": { "type": "Tuple", "annotation": [], @@ -24155,11 +24662,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Decimal", "annotation": [] } } @@ -24167,12 +24683,28 @@ }, "element": [ { - "name": "skipped", + "name": "expression", + "value": { + "type": "Successor", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "annotation": [], + "signature": [], + "operand": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.01", + "annotation": [] + } + } + }, + { + "name": "output", "value": { "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: As of 2.0 Successor of Decimal should be precision-aware", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Decimal", + "valueType": "{urn:hl7-org:elm-types:r1}Decimal", + "value": "1.02", "annotation": [] } } @@ -26569,11 +27101,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -26588,11 +27129,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -26607,11 +27157,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -27167,11 +27726,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -27186,11 +27754,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -27205,11 +27782,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -28608,11 +29194,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -28620,13 +29215,50 @@ }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See https://github.com/cqframework/cql-tests/pull/148", - "annotation": [] + "type": "TruncatedDivide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 10.1, + "unit": "cm", + "annotation": [] + }, + { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 3.1, + "unit": "cm", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Negate", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 3, + "unit": "1", + "annotation": [] + } } } ] @@ -28642,11 +29274,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -28654,12 +29295,37 @@ }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: The resulting Quantity should have an appropriate unit", + "type": "TruncatedDivide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 10, + "unit": "g", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 5, + "unit": "g", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "1", "annotation": [] } } @@ -28676,11 +29342,20 @@ "annotation": [], "element": [ { - "name": "skipped", + "name": "expression", "annotation": [], "elementType": { "type": "NamedTypeSpecifier", - "name": "{urn:hl7-org:elm-types:r1}String", + "name": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Quantity", "annotation": [] } } @@ -28688,12 +29363,37 @@ }, "element": [ { - "name": "skipped", + "name": "expression", "value": { - "type": "Literal", - "resultTypeName": "{urn:hl7-org:elm-types:r1}String", - "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: The resulting Quantity should have an appropriate unit", + "type": "TruncatedDivide", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 4.14, + "unit": "m", + "annotation": [] + }, + { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2.06, + "unit": "m", + "annotation": [] + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Quantity", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "value": 2, + "unit": "1", "annotation": [] } } diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql index ce21523b5..42f483d6b 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql @@ -606,6 +606,14 @@ define "Duration": Tuple{ expression: years between DateTime(2005, 5) and DateTime(2010, 4), output: 4 }, + "YearsBetweenLeapYearDatesEquals2": Tuple{ + expression: years between @2012-02-29 and @2014-02-28, + output: 2 + }, + "YearsBetweenLeapYearDateTimesEquals2": Tuple{ + expression: years between @2012-02-29T12:34:56 and @2014-02-28T12:34:56, + output: 2 + }, "DateTimeDurationBetweenMonth": Tuple{ expression: months between @2014-01-31 and @2014-02-01, output: 0 diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json index 6ab5a5c2d..4b9b7ed6e 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json @@ -25696,6 +25696,62 @@ ] } }, + { + "name": "YearsBetweenLeapYearDatesEquals2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "YearsBetweenLeapYearDateTimesEquals2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeDurationBetweenMonth", "annotation": [], @@ -25821,6 +25877,62 @@ ] } }, + { + "name": "YearsBetweenLeapYearDatesEquals2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, + { + "name": "YearsBetweenLeapYearDateTimesEquals2", + "annotation": [], + "elementType": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeDurationBetweenMonth", "annotation": [], @@ -26082,6 +26194,248 @@ ] } }, + { + "name": "YearsBetweenLeapYearDatesEquals2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + } + }, + { + "type": "Date", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Date", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "28", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, + { + "name": "YearsBetweenLeapYearDateTimesEquals2", + "value": { + "type": "Tuple", + "annotation": [], + "resultTypeSpecifier": { + "type": "TupleTypeSpecifier", + "annotation": [], + "element": [ + { + "name": "expression", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + }, + { + "name": "output", + "annotation": [], + "elementType": { + "type": "NamedTypeSpecifier", + "name": "{urn:hl7-org:elm-types:r1}Integer", + "annotation": [] + } + } + ] + }, + "element": [ + { + "name": "expression", + "value": { + "type": "DurationBetween", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "precision": "Year", + "annotation": [], + "signature": [], + "operand": [ + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2012", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "29", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "34", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "56", + "annotation": [] + } + }, + { + "type": "DateTime", + "resultTypeName": "{urn:hl7-org:elm-types:r1}DateTime", + "annotation": [], + "signature": [], + "year": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2014", + "annotation": [] + }, + "month": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + }, + "day": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "28", + "annotation": [] + }, + "hour": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "12", + "annotation": [] + }, + "minute": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "34", + "annotation": [] + }, + "second": { + "type": "Literal", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "56", + "annotation": [] + } + } + ] + } + }, + { + "name": "output", + "value": { + "type": "Literal", + "resultTypeName": "{urn:hl7-org:elm-types:r1}Integer", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "annotation": [] + } + } + ] + } + }, { "name": "DateTimeDurationBetweenMonth", "value": { diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index 1c8fbd74d..db6ab0f55 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -3,7 +3,6 @@ CqlTypesTest.Time.TimeUpperBoundHours Intentional Translator error: Invali CqlTypesTest.Time.TimeUpperBoundMinutes Translator error: Invalid time input[...] CqlTypesTest.Time.TimeUpperBoundSeconds Translator error: Invalid time input[...] "CqlDateTimeOperatorsTest.Uncertainty tests.TimeDurationBetweenHourDiffPrecision" Translator error: Syntax error at Z -CqlDateTimeOperatorsTest.DateTimeComponentFrom.DateTimeComponentFromTimezoneOffset Translator error: Timezone keyword is only valid in 1.3 or lower # Invalid Translation (translates, but translates wrong) CqlAggregateTest.AggregateTests.RolledOutIntervals CQL adds an integer to a date ("S + duration in days of X"). Should be "S + Quantity{ value: duration in days of X, unit: 'days' }". Translator translates it, but probably shouldn't. @@ -23,15 +22,7 @@ CqlListOperatorsTest.Equal.EqualNullNull Wrong output: Ac 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 CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: Interval[null, null] is not a unit interval, nor is it null -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10d1ByNeg3D1Quantity" Wrong output: The resulting Quantity should have an appropriate unit; 'g' / 'g' should be '1', not 'g'. See https://github.com/cqframework/cql-tests/pull/148 -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide10By5DQuantity" Wrong output: The resulting Quantity should have an appropriate unit -"CqlArithmeticFunctionsTest.Truncated Divide.TruncatedDivide414By206DQuantity" Wrong output: The resulting Quantity should have an appropriate unit "CqlStringOperatorsTest.toString tests.QuantityToString" Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side -CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1D Wrong output: As of 2.0 Successor of Decimal should be precision-aware. See https://github.com/cqframework/cql-tests/pull/147 -CqlArithmeticFunctionsTest.Predecessor.PredecessorOf101D Wrong output: As of 2.0 Successor of Decimal should be precision-aware -CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCM Wrong output: As of 2.0 Successor of Decimal should be precision-aware -CqlArithmeticFunctionsTest.Successor.SuccessorOf1D Wrong output: As of 2.0 Successor of Decimal should be precision-aware -CqlArithmeticFunctionsTest.Successor.SuccessorOf101D Wrong output: As of 2.0 Successor of Decimal should be precision-aware CqlArithmeticFunctionsTest.Power.Power0To0 Wrong output: As of CQL 2.0, Power always returns Decimal CqlArithmeticFunctionsTest.Power.Power2To2 Wrong output: As of CQL 2.0, Power always returns Decimal CqlArithmeticFunctionsTest.Power.PowerNeg2To2 Wrong output: As of CQL 2.0, Power always returns Decimal @@ -84,7 +75,7 @@ ValueLiteralsAndSelectors.Decimal.DecimalPos10Pow28ToZeroOneStepDecimalMaxValue CqlDateTimeOperatorsTest.Subtract.DateTimeSubtract1YearInSeconds Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05 CqlTypesTest.DateTime.DateTimeNull Wrong answer: null vs DateTime with null components CqlTypesTest.Time.TimeMillisParsing Wrong answer: @T23:59:59.100 vs @T23:59:59.10000 - +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCMPrecision Wrong answer: Translator loses Decimal precision (trailing zeros) in ELM representation of Quantity literal # Unimplemented CqlArithmeticFunctionsTest.HighBoundary HighBoundary not implemented @@ -97,4 +88,12 @@ CqlArithmeticFunctionsTest.Modulo.ModuloQuantity Modulo not CqlArithmeticFunctionsTest.Modulo.Modulo10By3Quantity Modulo not implemented for Quantity # Unimplemented (New in CQL 2.0) -CqlListOperatorsTest.Slice Slice not implemented \ No newline at end of file +CqlListOperatorsTest.Slice Slice not implemented + +# Legacy Behavior (Test targets an earlier version of CQL) +CqlDateTimeOperatorsTest.DateTimeComponentFrom.DateTimeComponentFromTimezoneOffset Translator error: Timezone keyword is only valid in 1.3 or lower +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1D Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware. +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf101D Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware +CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCM Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware +CqlArithmeticFunctionsTest.Successor.SuccessorOf1D Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware +CqlArithmeticFunctionsTest.Successor.SuccessorOf101D Test targets <= 1.5.3. As of 2.0 Successor of Decimal is precision-aware \ No newline at end of file diff --git a/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml b/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml index 72e3d73c0..f10620f70 100644 --- a/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml +++ b/test/spec-tests/xml/CqlArithmeticFunctionsTest.xml @@ -725,19 +725,32 @@ predecessor of 1L 0L - + predecessor of 1.0 0.99999999 - + predecessor of 1.01 1.00999999 - + + predecessor of 1.0 + 0.9 + + + predecessor of 1.01 + 1.00 + + predecessor of 1.0 'cm' 0.99999999'cm' + + + predecessor of 1.0 'cm' + 0.9'cm' + predecessor of DateTime(2000,1,1) @1999-12-31T @@ -916,14 +929,22 @@ successor of 1L 2L - + successor of 1.0 1.00000001 - + successor of 1.01 1.01000001 + + successor of 1.0 + 1.1 + + + successor of 1.01 + 1.02 + successor of DateTime(2000,1,1) @2000-01-02T @@ -1071,17 +1092,17 @@ 10.1 'cm' div -3.1 'cm' - -3.0 'cm' + -3.0 '1' 10.0 'g' div 5.0 'g' - 2.0 'g' + 2.0 '1' 4.14 'm' div 2.06 'm' - 2.0 'm' + 2.0 '1' diff --git a/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml b/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml index 193a3903e..da3d69478 100644 --- a/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml +++ b/test/spec-tests/xml/CqlDateTimeOperatorsTest.xml @@ -821,6 +821,16 @@ years between DateTime(2005, 5) and DateTime(2010, 4) 4 + + + years between @2012-02-29 and @2014-02-28 + 2 + + + + years between @2012-02-29T12:34:56 and @2014-02-28T12:34:56 + 2 + months between @2014-01-31 and @2014-02-01 From 2a4927bb3d1638f98b60bd9f623de515196f8161 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 09:29:45 -0400 Subject: [PATCH 55/62] Return only one value from Mode, even in case of ties --- src/elm/aggregate.ts | 12 ++++++++++-- test/elm/aggregate/aggregate-test.ts | 14 ++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/elm/aggregate.ts b/src/elm/aggregate.ts index 97a1c9465..648ac83eb 100644 --- a/src/elm/aggregate.ts +++ b/src/elm/aggregate.ts @@ -251,14 +251,22 @@ export class Mode extends AggregateExpression { if (mode.length === 1) { return new Quantity(mode[0], items[0].unit); } else { - return mode.map(m => new Quantity(m, items[0].unit)); + // TODO: The spec does not currently support returning multiple modes in case of a tie, + // the method signature is `Mode(argument List) T`. + // To avoid returning something unexpected that will cause errors in followup expressions, + // just return the first result here. (See also the non-Quantity branch below) + // See: https://jira.hl7.org/browse/FHIR-58745 + // return mode.map(m => new Quantity(m, items[0].unit)); + return new Quantity(mode[0], items[0].unit); } } else { const mode = this.mode(filtered); if (mode.length === 1) { return mode[0]; } else { - return mode; + // For now, return only a single value. See note above. + // return mode; + return mode[0]; } } } diff --git a/test/elm/aggregate/aggregate-test.ts b/test/elm/aggregate/aggregate-test.ts index 0498812f9..11d5bf1dd 100644 --- a/test/elm/aggregate/aggregate-test.ts +++ b/test/elm/aggregate/aggregate-test.ts @@ -417,16 +417,22 @@ describe('Mode', () => { should(await this.empty.exec(this.ctx)).be.null(); }); it('should be able to find bimodal', async function () { - (await this.bi_modal.exec(this.ctx)).should.eql([2, 3]); + // TODO: until https://jira.hl7.org/browse/FHIR-58745 is resolved, + // only expect one value + // (await this.bi_modal.exec(this.ctx)).should.eql([2, 3]); + (await this.bi_modal.exec(this.ctx)).should.eql(2); }); it('should preserve units for single and tied quantity modes', async function () { validateQuantity(await this.quantitySingleMode.exec(this.ctx), 1, 'g'); const modes = await this.quantityBiModal.exec(this.ctx); - modes.should.have.length(2); - validateQuantity(modes[0], 1, 'g'); - validateQuantity(modes[1], 2, 'g'); + // TODO: until https://jira.hl7.org/browse/FHIR-58745 is resolved, + // only expect one value + // modes.should.have.length(2); + // validateQuantity(modes[0], 1, 'g'); + // validateQuantity(modes[1], 2, 'g'); + validateQuantity(modes, 1, 'g'); }); it('should be null if some are numbers and some are quantities', async function () { From 04891c82f64db11cf46dd6317c9e8dace5a3c35c Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 10:40:11 -0400 Subject: [PATCH 56/62] update skip-list per feedback --- test/spec-tests/cql/CqlArithmeticFunctionsTest.cql | 2 +- test/spec-tests/cql/CqlArithmeticFunctionsTest.json | 2 +- test/spec-tests/cql/CqlDateTimeOperatorsTest.cql | 4 ++-- test/spec-tests/cql/CqlDateTimeOperatorsTest.json | 4 ++-- test/spec-tests/cql/CqlIntervalOperatorsTest.cql | 6 +++--- test/spec-tests/cql/CqlIntervalOperatorsTest.json | 6 +++--- test/spec-tests/cql/CqlStringOperatorsTest.cql | 2 +- test/spec-tests/cql/CqlStringOperatorsTest.json | 2 +- test/spec-tests/skip-list.txt | 12 ++++++------ 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql index b57c1a44b..cc9a77001 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.cql @@ -720,7 +720,7 @@ define "Predecessor": Tuple{ output: 0.99999999'cm' */ }, "PredecessorOf1QCMPrecision": Tuple{ - skipped: 'Wrong answer: Translator loses Decimal in ELM representation of Quantity literal.' + skipped: 'Wrong answer: Translator loses Decimal precision (trailing zeros) in ELM representation of Quantity literal' /* expression: predecessor of 1.0 'cm', output: 0.9'cm' diff --git a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json index 2bb93b119..a53711706 100644 --- a/test/spec-tests/cql/CqlArithmeticFunctionsTest.json +++ b/test/spec-tests/cql/CqlArithmeticFunctionsTest.json @@ -19414,7 +19414,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer: Translator loses Decimal in ELM representation of Quantity literal.", + "value": "Wrong answer: Translator loses Decimal precision (trailing zeros) in ELM representation of Quantity literal", "annotation": [] } } diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql index 42f483d6b..39bd60360 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.cql @@ -718,7 +718,7 @@ define "Uncertainty tests": Tuple{ invalid: true */ }, "TimeDurationBetweenHourDiffPrecision2": Tuple{ - skipped: 'Wrong answer: 1 vs uncertainty [0, 1]' + skipped: 'Wrong output: Comparing an imprecise time with a more precise time results in uncertainty' /* expression: hours between @T06 and @T07:00:00, output: 1 @@ -1235,7 +1235,7 @@ define "Subtract": Tuple{ output: @2005-05-10T05:05:05 }, "DateTimeSubtract1YearInSeconds": Tuple{ - skipped: 'Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05' + skipped: 'Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05, due to us using more-precise semantics for calendar-based units' /* expression: DateTime(2016,5) - 31535999 seconds = DateTime(2015, 5), output: true diff --git a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json index 4b9b7ed6e..4f461739c 100644 --- a/test/spec-tests/cql/CqlDateTimeOperatorsTest.json +++ b/test/spec-tests/cql/CqlDateTimeOperatorsTest.json @@ -30991,7 +30991,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer: 1 vs uncertainty [0, 1]", + "value": "Wrong output: Comparing an imprecise time with a more precise time results in uncertainty", "annotation": [] } } @@ -53863,7 +53863,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05", + "value": "Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05, due to us using more-precise semantics for calendar-based units", "annotation": [] } } diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql index d8d7c9407..6d71ef9ad 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.cql +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.cql @@ -544,7 +544,7 @@ define "Except": Tuple{ output: null }, "DecimalIntervalExcept1to3": Tuple{ - skipped: '# Wrong output: Interval Except should be precision-aware (based on interval Start/End).' + skipped: '# Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0, 4.0) . Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229' /* expression: Interval[1.0, 10.0] except Interval[4.0, 10.0], output: Interval [ 1.0, 3.99999999 ] @@ -554,7 +554,7 @@ define "Except": Tuple{ output: null }, "QuantityIntervalExcept1to4": Tuple{ - skipped: '# Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale' + skipped: '# Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0 \'g\', 5.0 \'g\'). Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229' /* expression: Interval[1.0 'g', 10.0 'g'] except Interval[5.0 'g', 10.0 'g'], output: Interval [ 1.0 'g', 4.99999999 'g' ] @@ -760,7 +760,7 @@ define "Included In": Tuple{ define "Intersect": Tuple{ "TestIntersectNull": Tuple{ - skipped: 'Wrong answer (Interval[5, 10] vs Interval[5, null))' + skipped: 'Wrong output: Expected is Interval[5, null) but this example is in the spec, where the result "ends at some value between 5 and 10" meaning an uncertainty.' /* expression: Interval[1, 10] intersect Interval[5, null), output: Interval[5, null) diff --git a/test/spec-tests/cql/CqlIntervalOperatorsTest.json b/test/spec-tests/cql/CqlIntervalOperatorsTest.json index 350371239..4e9a8440d 100644 --- a/test/spec-tests/cql/CqlIntervalOperatorsTest.json +++ b/test/spec-tests/cql/CqlIntervalOperatorsTest.json @@ -30331,7 +30331,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "# Wrong output: Interval Except should be precision-aware (based on interval Start/End).", + "value": "# Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0, 4.0) . Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229", "annotation": [] } } @@ -30487,7 +30487,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "# Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale", + "value": "# Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0 'g', 5.0 'g'). Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229", "annotation": [] } } @@ -41377,7 +41377,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong answer (Interval[5, 10] vs Interval[5, null))", + "value": "Wrong output: Expected is Interval[5, null) but this example is in the spec, where the result \"ends at some value between 5 and 10\" meaning an uncertainty.", "annotation": [] } } diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.cql b/test/spec-tests/cql/CqlStringOperatorsTest.cql index 177e252f2..ff764d375 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.cql +++ b/test/spec-tests/cql/CqlStringOperatorsTest.cql @@ -356,7 +356,7 @@ define "Upper": Tuple{ define "toString tests": Tuple{ "QuantityToString": Tuple{ - skipped: 'Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side' + skipped: 'Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side. Note this requirement itself also causes issues by introducing precision in the string that may not exist in the original Decimal. Future spec changes may make this test\'s expected value correct.' /* expression: ToString(125 'cm'), output: '125 \'cm\'' diff --git a/test/spec-tests/cql/CqlStringOperatorsTest.json b/test/spec-tests/cql/CqlStringOperatorsTest.json index 1f54242c4..a796173b2 100644 --- a/test/spec-tests/cql/CqlStringOperatorsTest.json +++ b/test/spec-tests/cql/CqlStringOperatorsTest.json @@ -10434,7 +10434,7 @@ "type": "Literal", "resultTypeName": "{urn:hl7-org:elm-types:r1}String", "valueType": "{urn:hl7-org:elm-types:r1}String", - "value": "Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side", + "value": "Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side. Note this requirement itself also causes issues by introducing precision in the string that may not exist in the original Decimal. Future spec changes may make this test's expected value correct.", "annotation": [] } } diff --git a/test/spec-tests/skip-list.txt b/test/spec-tests/skip-list.txt index db6ab0f55..3e77faa14 100644 --- a/test/spec-tests/skip-list.txt +++ b/test/spec-tests/skip-list.txt @@ -15,14 +15,15 @@ CqlIntervalOperatorsTest.ProperIn.TimeProperInPrecisionFalse Wrong output: Ac CqlIntervalOperatorsTest.ProperIn.TimeProperInFalse Wrong output: According to spec, a contained point is properly in as long as the interval is not a unit interval CqlIntervalOperatorsTest.Expand.ExpandPer0D1 Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 CqlIntervalOperatorsTest.Expand.ExpandPer0D1IntervalOverload Wrong output: Clarification still needed but provided answer is incorrect. See https://jira.hl7.org/browse/FHIR-58705 -CqlIntervalOperatorsTest.Except.DecimalIntervalExcept1to3 # Wrong output: Interval Except should be precision-aware (based on interval Start/End). -CqlIntervalOperatorsTest.Except.QuantityIntervalExcept1to4 # Wrong output: Interval Except should be precision-aware (based on interval Start/End). Unrelated second issue: the ELM representation of Quantity is a plain number which does not preserve the value scale +CqlIntervalOperatorsTest.Except.DecimalIntervalExcept1to3 # Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0, 4.0) . Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229 +CqlIntervalOperatorsTest.Except.QuantityIntervalExcept1to4 # Wrong output: The expected value is a closed form of the correct open-endpoint Interval[1.0 'g', 5.0 'g'). Converting to closed-form produces different results for CQL 2.0.0+ due to Decimal precision-awareness. See https://jira.hl7.org/browse/FHIR-59229 +CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong output: Expected is Interval[5, null) but this example is in the spec, where the result "ends at some value between 5 and 10" meaning an uncertainty. 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 CqlIntervalOperatorsTest.PointFrom.TestPointFromNull Wrong output: Interval[null, null] is not a unit interval, nor is it null -"CqlStringOperatorsTest.toString tests.QuantityToString" Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side +"CqlStringOperatorsTest.toString tests.QuantityToString" Wrong output: Spec says Quantity and Decimal ToString must always contain a decimal point and at least 1 digit on each side. Note this requirement itself also causes issues by introducing precision in the string that may not exist in the original Decimal. Future spec changes may make this test's expected value correct. CqlArithmeticFunctionsTest.Power.Power0To0 Wrong output: As of CQL 2.0, Power always returns Decimal CqlArithmeticFunctionsTest.Power.Power2To2 Wrong output: As of CQL 2.0, Power always returns Decimal CqlArithmeticFunctionsTest.Power.PowerNeg2To2 Wrong output: As of CQL 2.0, Power always returns Decimal @@ -39,6 +40,7 @@ ValueLiteralsAndSelectors.Integer.IntegerNeg2Pow31IntegerMinValue Wron CqlComparisonOperatorsTest.Equal.TupleEqDifferentNamesWithOneNullId Wrong output: Tuple equality with a known-unequal element should return false "CqlComparisonOperatorsTest.Not Equal.TupleNotEqDifferingNamesWithOneNullId" Wrong output: Tuple inequality with a known-unequal element should return true CqlStringOperatorsTest.Substring.SubstringEmptyAnd0 Wrong output: Substring(x, x.length) should be null'. Note similar test SubstringAB2. See https://github.com/cqframework/cql-tests/issues/149 +"CqlDateTimeOperatorsTest.Uncertainty tests.TimeDurationBetweenHourDiffPrecision2" Wrong output: Comparing an imprecise time with a more precise time results in uncertainty # Potentially Incorrect Expected Output "CqlStringOperatorsTest.toString tests.DateTimeToString2" Answer does not include timezone offset, but default offset depends on test environment @@ -62,7 +64,6 @@ CqlComparisonOperatorsTest.Equal.DateTimeEqNull Wrong answer (tr CqlIntervalOperatorsTest.Collapse.TestCollapseNull Wrong answer (Interval(null, null) vs null) CqlIntervalOperatorsTest.Expand.ExpandListWithNull Wrong answer (should be empty list due to removing nulls) -CqlIntervalOperatorsTest.Intersect.TestIntersectNull Wrong answer (Interval[5, 10] vs Interval[5, null)) CqlTypeOperatorsTest.Convert.StringToDateTime Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime1 Wrong answer (different offsets) CqlTypeOperatorsTest.ToDateTime.ToDateTime2 Wrong answer (different offsets) @@ -71,8 +72,7 @@ ValueLiteralsAndSelectors.Decimal.Decimal10Pow28ToZeroOneStepDecimalMaxValue ValueLiteralsAndSelectors.Decimal.DecimalPos10Pow28ToZeroOneStepDecimalMaxValue Wrong answer (null vs big number); intermediate value exceeds max Decimal "CqlDateTimeOperatorsTest.Uncertainty tests.DateTimeDurationBetweenUncertainInterval" Wrong answer: [17, 44] vs [16, 44] -"CqlDateTimeOperatorsTest.Uncertainty tests.TimeDurationBetweenHourDiffPrecision2" Wrong answer: 1 vs uncertainty [0, 1] -CqlDateTimeOperatorsTest.Subtract.DateTimeSubtract1YearInSeconds Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05 +CqlDateTimeOperatorsTest.Subtract.DateTimeSubtract1YearInSeconds Wrong answer: Date math evaluates to 2015-06 vs expected 2015-05, due to us using more-precise semantics for calendar-based units CqlTypesTest.DateTime.DateTimeNull Wrong answer: null vs DateTime with null components CqlTypesTest.Time.TimeMillisParsing Wrong answer: @T23:59:59.100 vs @T23:59:59.10000 CqlArithmeticFunctionsTest.Predecessor.PredecessorOf1QCMPrecision Wrong answer: Translator loses Decimal precision (trailing zeros) in ELM representation of Quantity literal From fc2f1dd4eb23df8f3abc4592894f839a24b90c40 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 10:59:26 -0400 Subject: [PATCH 57/62] add more invalid-scale tests --- test/datatypes/decimal-test.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index 9fce2b2ee..bc935edd9 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -294,6 +294,20 @@ describe('Decimal', () => { Decimal.from('1.235').round(2).should.equalDecimal('1.24'); Decimal.from('-1.235').round(2).should.equalDecimal('-1.24'); }); + + it('should treat null and unspecified as scale 0', () => { + Decimal.from('1.235').round(0).should.equalDecimal('1'); + Decimal.from('1.235').round(null).should.equalDecimal('1'); + Decimal.from('1.235').round().should.equalDecimal('1'); + Decimal.from('-1.235').round(0).should.equalDecimal('-1'); + Decimal.from('-1.235').round(null).should.equalDecimal('-1'); + Decimal.from('-1.235').round().should.equalDecimal('-1'); + }); + + it('should reject invalid scales', () => { + (() => Decimal.from(1).round(-1)).should.throw(RangeError); + (() => Decimal.from(1).round(1.5)).should.throw(RangeError); + }); }); describe('withScale', () => { @@ -329,6 +343,17 @@ describe('Decimal', () => { value.withMinimumScale(4).should.equalDecimal('1.2000'); value.withMinimumScale(4).scale.should.equal(4); }); + + it('should reject invalid scales when impossible to satisfy', () => { + (() => Decimal.from(1).withMinimumScale(NaN)).should.throw(RangeError); + (() => Decimal.from(1).withMinimumScale(4.5)).should.throw(RangeError); + + // fractional numbers don't need to throw if the minimum is satisfied + Decimal.from("1.0000").withMinimumScale(1.5).should.equalDecimal("1.0000"); + + // negative numbers don't need to throw because technically "scale > -x" is always satisfied + Decimal.from(1).withMinimumScale(-5).should.equalDecimal(1); + }); }); describe('withoutTrailingZeros', () => { From 8abf173413f52bf341a0ca28c3080cd9066373a7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 11:09:47 -0400 Subject: [PATCH 58/62] add tests for testing equals vs equivalence semantics in list operations --- test/elm/list/data.cql | 5 +- test/elm/list/data.js | 537 ++++++++++++++++++++++++++++++++++++- test/elm/list/list-test.ts | 21 ++ 3 files changed, 558 insertions(+), 5 deletions(-) diff --git a/test/elm/list/data.cql b/test/elm/list/data.cql index 4d31b3fe5..e4f471bb0 100644 --- a/test/elm/list/data.cql +++ b/test/elm/list/data.cql @@ -54,7 +54,7 @@ define NullUnion: null union {1, 2, 3} define UnionNull: {1, 2, 3} union null define nullUnionNull: (null as List) union (null as List) define UnionDecimalsAcrossScales: {1.0, 2.0} union {1.00, 3.0} - +define UnionDecimalsEquivalentNotEqual: {1.0, 2.0} union {1.04, 3.0} // @Test: Except define ExceptThreeFour: {1, 2, 3, 4, 5} except {3, 4} @@ -71,6 +71,7 @@ define ExceptTuples: {Tuple{a: 1}, Tuple{a: 2}, Tuple{a: 3}} except {Tuple{a: 2} define ExceptNull: {1, 2, 3, 4, 5} except null define NullExcept: null except {1, 2, 3, 4, 5} define ExceptDecimalsAcrossScales: {1.0, 2.0} except {1.00, 3.0} +define ExceptDecimalsEquivalentNotEqual: {1.0, 2.0} except {1.04, 3.0} // @Test: Intersect define NoIntersection: {1, 2, 2, 3} intersect {4, 5, 6} @@ -85,6 +86,7 @@ define NullIntersect: null intersect {1, 2, 3} define IntersectNull: {1, 2, 3} intersect null define MultipleNullInListIntersect: {1, 2, 3, null} intersect {null, 3} define IntersectDecimalsAcrossScales: {1.0, 2.0} intersect {1.00, 3.0} +define IntersectDecimalsEquivalentNotEqual: {1.0, 2.0} intersect {1.04, 3.0} // @Test: IndexOf define IndexOfSecond: IndexOf({'a', 'b', 'c', 'd'}, 'b') @@ -233,6 +235,7 @@ define DupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' define NoDupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' } } define DuplicateNulls: distinct {null, 1, 2, null, 3, 4, 5, null} define DistinctDecimalsAcrossScales: distinct {1.0, 1.00, 2.0} +define DistinctDecimalsEquivalentNotEqual: distinct {1.0, 1.04, 2.0} // @Test: First define Numbers: First({1, 2, 3, 4}) diff --git a/test/elm/list/data.js b/test/elm/list/data.js index c2cbdf3bb..aa75e7799 100644 --- a/test/elm/list/data.js +++ b/test/elm/list/data.js @@ -6293,6 +6293,7 @@ define NullUnion: null union {1, 2, 3} define UnionNull: {1, 2, 3} union null define nullUnionNull: (null as List) union (null as List) define UnionDecimalsAcrossScales: {1.0, 2.0} union {1.00, 3.0} +define UnionDecimalsEquivalentNotEqual: {1.0, 2.0} union {1.04, 3.0} */ module.exports['Union'] = { @@ -6307,7 +6308,7 @@ module.exports['Union'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "487", + "r" : "509", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -8234,6 +8235,147 @@ module.exports['Union'] = { } ] } ] } + }, { + "localId" : "509", + "name" : "UnionDecimalsEquivalentNotEqual", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "509", + "s" : [ { + "value" : [ "", "define ", "UnionDecimalsEquivalentNotEqual", ": " ] + }, { + "r" : "520", + "s" : [ { + "r" : "510", + "s" : [ { + "r" : "511", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " union " ] + }, { + "r" : "515", + "s" : [ { + "r" : "516", + "value" : [ "{", "1.04", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "527", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "528", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Union", + "localId" : "520", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "525", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "526", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "521", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "522", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "523", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "524", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "510", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "513", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "514", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "511", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "512", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "515", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "518", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "519", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "516", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.04", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "517", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -8257,6 +8399,7 @@ define ExceptTuples: {Tuple{a: 1}, Tuple{a: 2}, Tuple{a: 3}} except {Tuple{a: 2} define ExceptNull: {1, 2, 3, 4, 5} except null define NullExcept: null except {1, 2, 3, 4, 5} define ExceptDecimalsAcrossScales: {1.0, 2.0} except {1.00, 3.0} +define ExceptDecimalsEquivalentNotEqual: {1.0, 2.0} except {1.04, 3.0} */ module.exports['Except'] = { @@ -8271,7 +8414,7 @@ module.exports['Except'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "549", + "r" : "571", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -10653,6 +10796,147 @@ module.exports['Except'] = { } ] } ] } + }, { + "localId" : "571", + "name" : "ExceptDecimalsEquivalentNotEqual", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "571", + "s" : [ { + "value" : [ "", "define ", "ExceptDecimalsEquivalentNotEqual", ": " ] + }, { + "r" : "582", + "s" : [ { + "r" : "572", + "s" : [ { + "r" : "573", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " except " ] + }, { + "r" : "577", + "s" : [ { + "r" : "578", + "value" : [ "{", "1.04", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "589", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "590", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Except", + "localId" : "582", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "587", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "588", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "583", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "584", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "585", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "586", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "572", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "575", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "576", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "573", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "574", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "577", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "580", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "581", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "578", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.04", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "579", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -10674,6 +10958,7 @@ define NullIntersect: null intersect {1, 2, 3} define IntersectNull: {1, 2, 3} intersect null define MultipleNullInListIntersect: {1, 2, 3, null} intersect {null, 3} define IntersectDecimalsAcrossScales: {1.0, 2.0} intersect {1.00, 3.0} +define IntersectDecimalsEquivalentNotEqual: {1.0, 2.0} intersect {1.04, 3.0} */ module.exports['Intersect'] = { @@ -10688,7 +10973,7 @@ module.exports['Intersect'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "619", + "r" : "641", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -13560,6 +13845,147 @@ module.exports['Intersect'] = { } ] } ] } + }, { + "localId" : "641", + "name" : "IntersectDecimalsEquivalentNotEqual", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "641", + "s" : [ { + "value" : [ "", "define ", "IntersectDecimalsEquivalentNotEqual", ": " ] + }, { + "r" : "652", + "s" : [ { + "r" : "642", + "s" : [ { + "r" : "643", + "value" : [ "{", "1.0", ", ", "2.0", "}" ] + } ] + }, { + "value" : [ " intersect " ] + }, { + "r" : "647", + "s" : [ { + "r" : "648", + "value" : [ "{", "1.04", ", ", "3.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "659", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "660", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Intersect", + "localId" : "652", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "657", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "658", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "653", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "654", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, { + "type" : "ListTypeSpecifier", + "localId" : "655", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "656", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : [ { + "type" : "List", + "localId" : "642", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "645", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "646", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "643", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "644", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + }, { + "type" : "List", + "localId" : "647", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "650", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "651", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "648", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.04", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "649", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "3.0", + "annotation" : [ ] + } ] + } ] + } } ] } } @@ -37652,6 +38078,7 @@ define DupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' define NoDupsTuples: distinct { Tuple{ hello: 'world' }, Tuple{ hello: 'cleveland' } } define DuplicateNulls: distinct {null, 1, 2, null, 3, 4, 5, null} define DistinctDecimalsAcrossScales: distinct {1.0, 1.00, 2.0} +define DistinctDecimalsEquivalentNotEqual: distinct {1.0, 1.04, 2.0} */ module.exports['Distinct'] = { @@ -37666,7 +38093,7 @@ module.exports['Distinct'] = { "type" : "Annotation", "t" : [ ], "s" : { - "r" : "398", + "r" : "414", "s" : [ { "value" : [ "", "library TestSnippet version '1'" ] } ] @@ -39070,6 +39497,108 @@ module.exports['Distinct'] = { } ] } } + }, { + "localId" : "414", + "name" : "DistinctDecimalsEquivalentNotEqual", + "context" : "Patient", + "accessLevel" : "Public", + "annotation" : [ { + "type" : "Annotation", + "t" : [ ], + "s" : { + "r" : "414", + "s" : [ { + "value" : [ "", "define ", "DistinctDecimalsEquivalentNotEqual", ": " ] + }, { + "r" : "415", + "s" : [ { + "value" : [ "distinct " ] + }, { + "r" : "416", + "s" : [ { + "r" : "417", + "value" : [ "{", "1.0", ", ", "1.04", ", ", "2.0", "}" ] + } ] + } ] + } ] + } + } ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "426", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "427", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "expression" : { + "type" : "Distinct", + "localId" : "415", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "424", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "425", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "signature" : [ { + "type" : "ListTypeSpecifier", + "localId" : "422", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "423", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + } ], + "operand" : { + "type" : "List", + "localId" : "416", + "annotation" : [ ], + "resultTypeSpecifier" : { + "type" : "ListTypeSpecifier", + "localId" : "420", + "annotation" : [ ], + "elementType" : { + "type" : "NamedTypeSpecifier", + "localId" : "421", + "name" : "{urn:hl7-org:elm-types:r1}Decimal", + "annotation" : [ ] + } + }, + "element" : [ { + "type" : "Literal", + "localId" : "417", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.0", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "418", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "1.04", + "annotation" : [ ] + }, { + "type" : "Literal", + "localId" : "419", + "resultTypeName" : "{urn:hl7-org:elm-types:r1}Decimal", + "valueType" : "{urn:hl7-org:elm-types:r1}Decimal", + "value" : "2.0", + "annotation" : [ ] + } ] + } + } } ] } } diff --git a/test/elm/list/list-test.ts b/test/elm/list/list-test.ts index eb9b7a36b..8f78f2c3b 100644 --- a/test/elm/list/list-test.ts +++ b/test/elm/list/list-test.ts @@ -209,6 +209,12 @@ describe('Union', () => { const expected = ['1.0', '2.0', '3.0'].map(Decimal.from); should(await this.unionDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); }); + + it('should use equality semantics for Decimal (not equivalence)', async function () { + // {1.0, 2.0} union {1.04, 3.0} + const expected = ['1.0', '2.0', '1.04', '3.0'].map(Decimal.from); + should(await this.unionDecimalsEquivalentNotEqual.exec(this.ctx)).be.eql(expected); + }); }); describe('Except', () => { @@ -268,6 +274,11 @@ describe('Except', () => { const expected = [Decimal.from('2.0')]; should(await this.exceptDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); }); + + it('should use equality semantics for Decimal (not equivalence)', async function () { + const expected = [Decimal.from('1.0'), Decimal.from('2.0')]; + should(await this.exceptDecimalsEquivalentNotEqual.exec(this.ctx)).be.eql(expected); + }); }); describe('Intersect', () => { @@ -323,6 +334,11 @@ describe('Intersect', () => { const expected = [Decimal.from('1.0')]; should(await this.intersectDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); }); + + it('should use equality semantics for Decimal (not equivalence)', async function () { + const expected: Array = []; + should(await this.intersectDecimalsEquivalentNotEqual.exec(this.ctx)).be.eql(expected); + }); }); describe('IndexOf', () => { @@ -868,6 +884,11 @@ describe('Distinct', () => { const expected = [Decimal.from('1.0'), Decimal.from('2.0')]; should(await this.distinctDecimalsAcrossScales.exec(this.ctx)).be.eql(expected); }); + + it('should use equality semantics for Decimal (not equivalence)', async function () { + const expected = [Decimal.from('1.0'), Decimal.from('1.04'), Decimal.from('2.0')]; + should(await this.distinctDecimalsEquivalentNotEqual.exec(this.ctx)).be.eql(expected); + }); }); describe('First', () => { From 5d325a86aa81a69ef795153743a6505631f0b9b0 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 11:10:00 -0400 Subject: [PATCH 59/62] prettier --- test/datatypes/decimal-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/datatypes/decimal-test.ts b/test/datatypes/decimal-test.ts index bc935edd9..79b758859 100644 --- a/test/datatypes/decimal-test.ts +++ b/test/datatypes/decimal-test.ts @@ -349,7 +349,7 @@ describe('Decimal', () => { (() => Decimal.from(1).withMinimumScale(4.5)).should.throw(RangeError); // fractional numbers don't need to throw if the minimum is satisfied - Decimal.from("1.0000").withMinimumScale(1.5).should.equalDecimal("1.0000"); + Decimal.from('1.0000').withMinimumScale(1.5).should.equalDecimal('1.0000'); // negative numbers don't need to throw because technically "scale > -x" is always satisfied Decimal.from(1).withMinimumScale(-5).should.equalDecimal(1); From 3dbc096e8eed9481a45379dc099571d9df099474 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 11:14:40 -0400 Subject: [PATCH 60/62] add note explaining decimal scale logic is based on testing, rather than defined in spec --- src/datatypes/decimal.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/datatypes/decimal.ts b/src/datatypes/decimal.ts index ca927e657..7be0cd4b3 100644 --- a/src/datatypes/decimal.ts +++ b/src/datatypes/decimal.ts @@ -68,6 +68,9 @@ export class Decimal { const unscaledResult = new Decimal(operation.call(this.value, decimalOther.value)); + // NOTE: As of 2.0.0, the CQL spec says that scale of a Decimal should be preserved, + // but does not describe how to propagate scale through arithmetic operations. + // Unless otherwise stated, all the scale logic in this class is a best-guess based on testing. if (scaleLogic) { const targetScale = scaleLogic.call(null, this.scale, decimalOther.scale); return unscaledResult.withScale(targetScale); @@ -96,6 +99,8 @@ export class Decimal { throw new RangeError('Cannot divide a decimal by zero'); } // division scaling is more complex, depends on whether the actual result can be represented exactly + // IMPORTANT: The details of how to propagate Decimal scale through math are not defined in the CQL spec. + // The notes below are a best-guess on how to get desirable results based on some examples. const unscaledResult = this.applyWrapper(this.value.dividedBy, decimalOther); const unscaledDecimalPlaces = unscaledResult.value.decimalPlaces(); if (unscaledDecimalPlaces > CQL_IMPLICIT_SCALE) { @@ -111,7 +116,7 @@ export class Decimal { const preferredScale = Math.max(this.scale - decimalOther.scale, 0); // examples: - // | | Preferred | Expected | + // | | Preferred | Desired | // | Expression | scale | result | // | ------------- | --------: | ---------: | // | 4.0 / 2 | 1 | 2.0 | From a061f94827a45ac858e2656d4315467a436f9759 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 15:37:26 -0400 Subject: [PATCH 61/62] update package-lock for example projects --- examples/browser/package-lock.json | 2 +- examples/node/package-lock.json | 2 +- examples/typescript/package-lock.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/browser/package-lock.json b/examples/browser/package-lock.json index 3dd72b36c..847e9e409 100644 --- a/examples/browser/package-lock.json +++ b/examples/browser/package-lock.json @@ -18,11 +18,11 @@ } }, "../..": { - "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": { "@lhncbc/ucum-lhc": "^7.1.9", + "decimal.js": "^10.6.0", "immutable": "^5.1.6", "luxon": "^3.7.2" }, diff --git a/examples/node/package-lock.json b/examples/node/package-lock.json index eed2c2712..e8185623d 100644 --- a/examples/node/package-lock.json +++ b/examples/node/package-lock.json @@ -15,11 +15,11 @@ } }, "../..": { - "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": { "@lhncbc/ucum-lhc": "^7.1.9", + "decimal.js": "^10.6.0", "immutable": "^5.1.6", "luxon": "^3.7.2" }, diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json index 49f0b1e52..3e7b291d7 100644 --- a/examples/typescript/package-lock.json +++ b/examples/typescript/package-lock.json @@ -20,11 +20,11 @@ } }, "../..": { - "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": { "@lhncbc/ucum-lhc": "^7.1.9", + "decimal.js": "^10.6.0", "immutable": "^5.1.6", "luxon": "^3.7.2" }, From 02952aeaf44357d00ec1e4fc0d48705ed61ac4c1 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 15 Sep 2026 16:14:04 -0400 Subject: [PATCH 62/62] Regenerate lockfiles one more time --- examples/browser/package-lock.json | 1 + examples/node/package-lock.json | 1 + examples/typescript/package-lock.json | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/browser/package-lock.json b/examples/browser/package-lock.json index 847e9e409..b9882e1da 100644 --- a/examples/browser/package-lock.json +++ b/examples/browser/package-lock.json @@ -18,6 +18,7 @@ } }, "../..": { + "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": { diff --git a/examples/node/package-lock.json b/examples/node/package-lock.json index e8185623d..f64959168 100644 --- a/examples/node/package-lock.json +++ b/examples/node/package-lock.json @@ -15,6 +15,7 @@ } }, "../..": { + "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": { diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json index 3e7b291d7..4ef57f7b1 100644 --- a/examples/typescript/package-lock.json +++ b/examples/typescript/package-lock.json @@ -20,6 +20,7 @@ } }, "../..": { + "name": "cql-execution", "version": "3.3.2", "license": "Apache-2.0", "dependencies": {