Skip to content

Commit

Permalink
Merge pull request #16 in LFOR/fhirpath.js from feature/LF-1503/imple…
Browse files Browse the repository at this point in the history
…ment-union to master

* commit 'f0da521f8805c84b0af07bc2ada0982000dd2448':
  Implement union
  • Loading branch information
plynchnlm committed Aug 31, 2020
2 parents dcfb113 + f0da521 commit 23f388e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhirpath",
"version": "2.4.0",
"version": "2.5.0",
"description": "A FHIRPath engine",
"main": "src/fhirpath.js",
"dependencies": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/combining.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};

Expand Down
3 changes: 2 additions & 1 deletion src/fhirpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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"]}},
Expand Down
3 changes: 0 additions & 3 deletions test/cases/fhir-r4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 23f388e

Please sign in to comment.