diff --git a/CHANGELOG.md b/CHANGELOG.md index ed83cfb..047ab68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This log documents significant changes for each release. This project follows [Semantic Versioning](http://semver.org/). +## [2.5.0] - 2020-08-26 +### Added +- Function union(other: collection) + ## [2.4.0] - 2020-08-05 ### Added - Support for DSTU2 model diff --git a/package-lock.json b/package-lock.json index c4a15fb..d49a3b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fhirpath", - "version": "2.4.0", + "version": "2.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4424,12 +4424,12 @@ } }, "fhir": { - "version": "4.7.9", - "resolved": "https://registry.npmjs.org/fhir/-/fhir-4.7.9.tgz", - "integrity": "sha512-f8cpFML+/8RxnDLmbsyxB40D0qqPmjrDt7Qa5gBAnyEnhRietAnxRSp7hZ1BeBosnJ24FjfqCh+e1hcp1oEA3A==", + "version": "4.7.10", + "resolved": "https://registry.npmjs.org/fhir/-/fhir-4.7.10.tgz", + "integrity": "sha512-sLYnMSFNlZ8xhgnVJogasH3Tt0rs5D5hn4lXaq12HZFRsaCVTEty/Yngphj+0/wuowRS0xj/PPQj7P3Nr/Kz7g==", "dev": true, "requires": { - "lodash": "^4.17.14", + "lodash": "^4.17.19", "path": "^0.12.7", "q": "^1.4.1", "randomatic": "^3.1.0", @@ -4442,7 +4442,7 @@ "dev": true }, "lodash": { - "version": "4.17.15", + "version": "4.17.19", "bundled": true, "dev": true }, diff --git a/package.json b/package.json index 7f19633..dec151b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhirpath", - "version": "2.4.0", + "version": "2.5.0", "description": "A FHIRPath engine", "main": "src/fhirpath.js", "dependencies": { @@ -18,7 +18,7 @@ "bestzip": "^2.1.4", "copy-webpack-plugin": "^6.0.3", "eslint": "^5.2.0", - "fhir": "^4.7.9", + "fhir": "^4.7.10", "grunt": "^1.1.0", "grunt-cli": "^1.3.1", "grunt-contrib-connect": "^2.0.0", diff --git a/src/combining.js b/src/combining.js index eb43ade..b3958d2 100644 --- a/src/combining.js +++ b/src/combining.js @@ -3,7 +3,7 @@ var combineFns = {}; var existence = require('./existence'); -combineFns.unionOp = function(coll1, coll2){ +combineFns.union = function(coll1, coll2){ return existence.distinctFn(coll1.concat(coll2)); }; diff --git a/src/fhirpath.js b/src/fhirpath.js index 8ade332..aa25552 100644 --- a/src/fhirpath.js +++ b/src/fhirpath.js @@ -82,6 +82,7 @@ engine.invocationTable = { take: {fn: filtering.takeFn, arity: {1: ["Integer"]}}, skip: {fn: filtering.skipFn, arity: {1: ["Integer"]}}, combine: {fn: combining.combineFn, arity: {1: ["AnyAtRoot"]}}, + union: {fn: combining.union, arity: {1: ["AnyAtRoot"]}}, iif: {fn: misc.iifMacro, arity: {2: ["Expr", "Expr"], 3: ["Expr", "Expr", "Expr"]}}, trace: {fn: misc.traceFn, arity: {0: [], 1: ["String"]}}, toInteger: {fn: misc.toInteger}, @@ -127,7 +128,7 @@ engine.invocationTable = { children: {fn: navigation.children }, descendants: {fn: navigation.descendants }, - "|": {fn: combining.unionOp, arity: {2: ["Any", "Any"]}}, + "|": {fn: combining.union, arity: {2: ["Any", "Any"]}}, "=": {fn: equality.equal, arity: {2: ["Any", "Any"]}, nullable: true}, "!=": {fn: equality.unequal, arity: {2: ["Any", "Any"]}, nullable: true}, "~": {fn: equality.equival, arity: {2: ["Any", "Any"]}}, diff --git a/test/cases/fhir-r4.yaml b/test/cases/fhir-r4.yaml index 65265a0..8ae750d 100644 --- a/test/cases/fhir-r4.yaml +++ b/test/cases/fhir-r4.yaml @@ -2834,13 +2834,11 @@ tests: expression: 1.union(2).union(3).count() = 3 result: - true - disable: true - desc: '** testUnion5' inputfile: patient-example.json expression: 1.union(2.union(3)).count() = 3 result: - true - disable: true - desc: '** testUnion6' inputfile: patient-example.json expression: (1 | 2).combine(2).count() = 3 @@ -2856,7 +2854,6 @@ tests: expression: 1.combine(1).union(2).count() = 2 result: - true - disable: true - 'group: testIntersect': - desc: '** testIntersect1' inputfile: patient-example.json