Skip to content

Commit 039f795

Browse files
authored
Implement Implies Operator and update to cql2elm 3.12.0 (cqframework#320)
Implements the `implies` operator and updates CQL translator to 3.12.0. Also updates gradle wrapper to latest 8.x for Java 21 support. Enables the spec-tests for Implies operator. Note: The translator has a bug with choice types in the output that caused issues with some tests. This issue was manually edited out in the ELM after running the `build:test-data` command. cqframework/clinical_quality_language#1380 This is a squash commit containing these original commits: * updated to use cql-to-elm 3.12.0. fixed localid on tests that relied on localids. manual work around for bad choicetype elm * updated spec tests with 3.12.0 translation * re-enable spec tests for implies operator * implemented implies operator * fixed npm audit concerns * removed xml import that is not needed. added comments to explain duplicated type field in tests * maked implies operator as supported in excel sheet * updated NYC, fixing out of heap space issue in coverage run * replaced hardcoded localIds in tests with a helper function to grab a localId in the elm structure * moved getLocalIdByPath to new testHelpers file. Replaced localids in query-test.ts with helperfile usage. * Now throwing an error in localId helper function when its not found to make test checks simpler * removed not.be.null checks from list-test.ts
1 parent d69c85e commit 039f795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+95317
-62136
lines changed

CQL_Execution_Features.xlsx

38 Bytes
Binary file not shown.

examples/browser/cql4browsers.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,6 +2334,17 @@ class ThreeValuedLogic {
23342334
return null;
23352335
}
23362336
}
2337+
static implies(left, right) {
2338+
if (left === true) {
2339+
return right;
2340+
}
2341+
else if (left === false) {
2342+
return true;
2343+
}
2344+
else {
2345+
return right === true ? true : null;
2346+
}
2347+
}
23372348
}
23382349
exports.ThreeValuedLogic = ThreeValuedLogic;
23392350

@@ -5805,7 +5816,7 @@ exports.StringLiteral = StringLiteral;
58055816
},{"./expression":22}],30:[function(require,module,exports){
58065817
"use strict";
58075818
Object.defineProperty(exports, "__esModule", { value: true });
5808-
exports.IsFalse = exports.IsTrue = exports.Xor = exports.Not = exports.Or = exports.And = void 0;
5819+
exports.IsFalse = exports.IsTrue = exports.Xor = exports.Not = exports.Or = exports.Implies = exports.And = void 0;
58095820
const expression_1 = require("./expression");
58105821
const datatypes_1 = require("../datatypes/datatypes");
58115822
class And extends expression_1.Expression {
@@ -5817,6 +5828,16 @@ class And extends expression_1.Expression {
58175828
}
58185829
}
58195830
exports.And = And;
5831+
class Implies extends expression_1.Expression {
5832+
constructor(json) {
5833+
super(json);
5834+
}
5835+
async exec(ctx) {
5836+
const [left, right] = await this.execArgs(ctx);
5837+
return datatypes_1.ThreeValuedLogic.implies(left, right);
5838+
}
5839+
}
5840+
exports.Implies = Implies;
58205841
class Or extends expression_1.Expression {
58215842
constructor(json) {
58225843
super(json);

0 commit comments

Comments
 (0)