Skip to content

Commit

Permalink
Merge pull request #38 in LFOR/fhirpath.js from bugfix/LF-2208/correc…
Browse files Browse the repository at this point in the history
…t-scope-of-collection to master

* commit 'f41f8fcd0e560e96ee4a532c50f9cce94fdba005':
  npm audit fix
  Updated README.md
  npm audit fix
  Corrected scope of function parameter of collection type
  • Loading branch information
yuriy-sedinkin committed Apr 27, 2022
2 parents 1fae12b + f41f8fc commit a869956
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 159 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
This log documents significant changes for each release. This project follows
[Semantic Versioning](http://semver.org/).

## [2.14.2] - 2022-04-12
### Fixed
- Corrected scope of function parameter of `collection` type for `union`,
`subsetOf`, `supersetOf`, `combine`, and `intersect`.
For example,`Patient.name.select(use.union(given))` should be the same as
`Patient.name.select(use|given)`.

## [2.14.1] - 2022-03-31
### Added
- Added a "version" field with the release version to the object exported by fhirpath.js.
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,27 @@ fhirpath.evaluate({"resourceType": "Observation", "valueString": "green"},
// If the first parameter is a part of a resource, the second parameter should
// be an object with properties "base" and "expression":
// base - base path in resource from which this part was extracted
// expression - fhirpath expression relative to base
// base - the path in the resource that represents the partial resource being
// used as the context,
// expression - fhirpath expression relative to base.
fhirpath.evaluate({ "answer": { "valueQuantity": ...}},
{ "base": "QuestionnaireResponse.item",
"expression": "answer.value = 2 year"},
null, fhirpath_r4_model);
// Precompiling fhirpath - result can be reused against multiple resources
const path = fhirpath.compile('Patient.name.given', fhirpath_r4_model);
var res2 = path({"resourceType": "Patient", ...}, {a: 5, ...});
var res = path({"resourceType": "Patient", ...}, {a: 5, ...});
// If you are going to use the above "precompile" option with a part of a resource,
// the first parameter should be an object with properties "base" and "expression":
// base - the path in the resource that represents the partial resource being
// used as the context,
// expression - fhirpath expression relative to base.
const path = fhirpath.compile({ "base": "QuestionnaireResponse.item",
"expression": "answer.value = 2 year"},
fhirpath_r4_model);
var res = path({ "answer": { "valueQuantity": ...}, {a: 5, ...});
```


Expand Down
6 changes: 3 additions & 3 deletions demo/package-lock.json

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

Loading

0 comments on commit a869956

Please sign in to comment.