From 286aa45a62e29074445c4649d7d82bafe249fff1 Mon Sep 17 00:00:00 2001 From: sedinkinya Date: Wed, 13 Apr 2022 15:47:07 -0400 Subject: [PATCH 1/4] Corrected scope of function parameter of collection type LF-2208 --- CHANGELOG.md | 7 +++++++ package-lock.json | 22 +++++++++++----------- package.json | 2 +- src/fhirpath.js | 25 ++++++++++++------------- test/cases/simple.yaml | 15 +++++++++++++++ 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd470d6..aded836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/package-lock.json b/package-lock.json index 2e96356..7bc636f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fhirpath", - "version": "2.14.1", + "version": "2.14.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4096,9 +4096,9 @@ }, "dependencies": { "async": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", - "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "readable-stream": { @@ -4744,9 +4744,9 @@ } }, "async": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", - "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "cliui": { @@ -7177,9 +7177,9 @@ }, "dependencies": { "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "which": { @@ -10872,7 +10872,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^3.0.1" + "ansi-regex": "^3.0.0" } } } diff --git a/package.json b/package.json index 800bda4..05ceea1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhirpath", - "version": "2.14.1", + "version": "2.14.2", "description": "A FHIRPath engine", "main": "src/fhirpath.js", "dependencies": { diff --git a/src/fhirpath.js b/src/fhirpath.js index ae56a77..aabb9e2 100644 --- a/src/fhirpath.js +++ b/src/fhirpath.js @@ -192,7 +192,7 @@ engine.TermExpression = function(ctx, parentData, node) { engine.PolarityExpression = function(ctx, parentData, node) { var sign = node.terminalNodeText[0]; // either - or + per grammar var rtn = engine.doEval(ctx,parentData, node.children[0]); - if (rtn.length != 1) { // not yet in spec, but per Bryn Rhodes + if (rtn.length !== 1) { // not yet in spec, but per Bryn Rhodes throw new Error('Unary ' + sign + ' can only be applied to an individual number.'); } @@ -413,16 +413,16 @@ engine.realizeParams = function(ctx, parentData, args) { function makeParam(ctx, parentData, type, param) { if(type === "Expr"){ return function(data) { - ctx.$this = data; - return engine.doEval(ctx, util.arraify(data), param); + ctx.$this = util.arraify(data); + return engine.doEval(ctx, ctx.$this, param); }; } if(type === "AnyAtRoot"){ - ctx.$this = ctx.dataRoot; - return engine.doEval(ctx, ctx.dataRoot, param); + ctx.$this = ctx.$this || ctx.dataRoot; + return engine.doEval(ctx, ctx.$this, param); } if(type === "Identifier"){ - if(param.type == "TermExpression"){ + if(param.type === "TermExpression") { return param.text; } else { throw new Error("Expected identifier node, got " + JSON.stringify(param)); @@ -434,12 +434,12 @@ function makeParam(ctx, parentData, type, param) { } ctx.$this = parentData; - var res = engine.doEval(ctx, parentData, param); + const res = engine.doEval(ctx, parentData, param); if(type === "Any") { return res; } - if(Array.isArray(type)){ - if(res.length == 0){ + if(Array.isArray(type)) { + if(res.length === 0) { return []; } else { type = type[0]; @@ -487,15 +487,14 @@ function doInvoke(ctx, fnName, data, rawParams){ } } function isNullable(x) { - var res = x=== null || x=== undefined || util.isEmpty(x); - return res; + return x === null || x === undefined || util.isEmpty(x); } function infixInvoke(ctx, fnName, data, rawParams){ var invoc = engine.invocationTable[fnName]; if(invoc && invoc.fn) { var paramsNumber = rawParams ? rawParams.length : 0; - if(paramsNumber != 2) { throw new Error("Infix invoke should have arity 2"); } + if(paramsNumber !== 2) { throw new Error("Infix invoke should have arity 2"); } var argTypes = invoc.arity[paramsNumber]; if(argTypes){ var params = []; @@ -540,7 +539,7 @@ engine.UnionExpression = function(ctx, parentData, node) { }; engine.ThisInvocation = function(ctx) { - return util.arraify(ctx.$this); + return ctx.$this; }; engine.TotalInvocation = function(ctx) { diff --git a/test/cases/simple.yaml b/test/cases/simple.yaml index 350781c..d3e4d59 100644 --- a/test/cases/simple.yaml +++ b/test/cases/simple.yaml @@ -89,6 +89,21 @@ tests: - expression: Patient.name.select(given | family) result: ["Peter", "James", "Chalmers", "Jim", "Peter", "James", "Windsor"] + - expression: Patient.name.select(given.union(family)) + result: ["Peter", "James", "Chalmers", "Jim", "Peter", "James", "Windsor"] + + - expression: Patient.name.select(given.combine(family)) + result: ["Peter", "James", "Chalmers", "Jim", "Peter", "James", "Windsor"] + + - expression: Patient.name.select(('James').subsetOf(given)) + result: [true, false, true] + + - expression: Patient.name.select(('Peter' | 'James').supersetOf(given)) + result: [true, false, true] + + - expression: Patient.name.select(('Peter' | 'James' | 'something').intersect(given | family)) + result: ["Peter", "James", "Peter", "James"] + - expression: Patient.name.trace('tracing').given[0] result: ["Peter"] disableConsoleLog: true From bc972a132a48572d947b73c19fee4d24f593ebbf Mon Sep 17 00:00:00 2001 From: sedinkinya Date: Wed, 13 Apr 2022 16:04:45 -0400 Subject: [PATCH 2/4] npm audit fix --- package-lock.json | 164 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 100 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7bc636f..927c9eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3954,13 +3954,30 @@ "dev": true }, "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "dependencies": { + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + } } }, "acorn": { @@ -4198,13 +4215,10 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", + "dev": true }, "async-limiter": { "version": "1.0.1", @@ -5736,9 +5750,9 @@ "dev": true }, "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true }, "detect-file": { @@ -7057,20 +7071,20 @@ } }, "grunt-contrib-connect": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-connect/-/grunt-contrib-connect-2.1.0.tgz", - "integrity": "sha512-yeCHdz5zqoibhQDyw/X+E/wTzYPpim+C2p+xYyXUsXVEkfxnKVIWYOWrAKkFHlz9//nIC0S3JbUDd3mVvJcxVA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-connect/-/grunt-contrib-connect-3.0.0.tgz", + "integrity": "sha512-L1GXk6PqDP/meX0IOX1MByBvOph6h8Pvx4/iBIYD7dpokVCAAQPR/IIV1jkTONEM09xig/Y8/y3R9Fqc8U3HSA==", "dev": true, "requires": { - "async": "^2.6.1", - "connect": "^3.6.6", - "connect-livereload": "^0.6.0", - "morgan": "^1.9.1", + "async": "^3.2.0", + "connect": "^3.7.0", + "connect-livereload": "^0.6.1", + "morgan": "^1.10.0", "node-http2": "^4.0.1", - "opn": "^5.3.0", + "opn": "^6.0.0", "portscanner": "^2.2.0", "serve-index": "^1.9.1", - "serve-static": "^1.13.2" + "serve-static": "^1.14.1" } }, "grunt-extract-sourcemap": { @@ -10216,9 +10230,9 @@ "dev": true }, "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, "neo-async": { @@ -10395,9 +10409,9 @@ "dev": true }, "opn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", + "integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==", "dev": true, "requires": { "is-wsl": "^1.1.0" @@ -10649,6 +10663,17 @@ "requires": { "async": "^2.6.0", "is-number-like": "^1.0.3" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + } } }, "prelude-ls": { @@ -11361,24 +11386,24 @@ "dev": true }, "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dev": true, "requires": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", + "depd": "2.0.0", + "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", + "http-errors": "2.0.0", "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", + "ms": "2.1.3", + "on-finished": "2.4.1", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "statuses": "2.0.1" }, "dependencies": { "debug": { @@ -11398,35 +11423,44 @@ } } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "http-errors": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "requires": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true } } @@ -11473,15 +11507,15 @@ } }, "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.1" + "send": "0.18.0" } }, "set-blocking": { @@ -12087,9 +12121,9 @@ } }, "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, "totalist": { diff --git a/package.json b/package.json index 05ceea1..feb6a97 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "fhir": "^4.10.3", "grunt": "^1.4.0", "grunt-cli": "^1.4.3", - "grunt-contrib-connect": "^2.0.0", + "grunt-contrib-connect": "^3.0.0", "grunt-protractor-runner": "^5.0.0", "grunt-text-replace": "^0.4.0", "jasmine-spec-reporter": "^4.2.1", From b23077dd489e99810027d14f79d81c9907958c95 Mon Sep 17 00:00:00 2001 From: sedinkinya Date: Wed, 27 Apr 2022 18:04:02 -0400 Subject: [PATCH 3/4] Updated README.md --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0f3eb49..d58197d 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,9 @@ 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"}, @@ -67,7 +68,17 @@ fhirpath.evaluate({ "answer": { "valueQuantity": ...}}, // 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, ...}); ``` From f41f8fcd0e560e96ee4a532c50f9cce94fdba005 Mon Sep 17 00:00:00 2001 From: sedinkinya Date: Wed, 27 Apr 2022 18:42:22 -0400 Subject: [PATCH 4/4] npm audit fix --- demo/package-lock.json | 6 +-- package-lock.json | 102 ++++++++++++++--------------------------- package.json | 2 +- 3 files changed, 39 insertions(+), 71 deletions(-) diff --git a/demo/package-lock.json b/demo/package-lock.json index 6c49a39..8285b67 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -534,9 +534,9 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" diff --git a/package-lock.json b/package-lock.json index 927c9eb..117fbef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6864,9 +6864,9 @@ } }, "getobject": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.1.tgz", - "integrity": "sha512-tj18lLe+917AACr6BdVoUuHnBPTVd9BEJp1vxnMZ58ztNvuxz9Ufa+wf3g37tlGITH35jggwZ2d9lcgHJJgXfQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", + "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", "dev": true }, "getpass": { @@ -6965,9 +6965,9 @@ "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, "grunt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.4.0.tgz", - "integrity": "sha512-yRFc0GVCDu9yxqOFzpuXQ2pEdgtLDnFv5Qz54jfIcNnpJ8Z7B7P7kPkT4VMuRvm+N+QOsI8C4v/Q0DSaoj3LgQ==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.2.tgz", + "integrity": "sha512-XCtfaIu72OyDqK24MjWiGC9SwlkuhkS1mrULr1xzuJ2XqAFhP3ZAchZGHJeSCY6mkaOXU4F7SbmmCF7xIVoC9w==", "dev": true, "requires": { "dateformat": "~3.0.3", @@ -6975,8 +6975,8 @@ "exit": "~0.1.2", "findup-sync": "~0.3.0", "glob": "~7.1.6", - "grunt-cli": "~1.4.2", - "grunt-known-options": "~1.1.1", + "grunt-cli": "~1.4.3", + "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", "iconv-lite": "~0.4.13", @@ -6987,31 +6987,6 @@ "rimraf": "~3.0.2" }, "dependencies": { - "grunt-cli": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.2.tgz", - "integrity": "sha512-wsu6BZh7KCnfeaSkDrKIAvOlqGKxNRTZjc8xfZlvxCByQIqUfZ31kh5uHpPnhQ4NdVgvaWaVxa1LUbVU80nACw==", - "dev": true, - "requires": { - "grunt-known-options": "~1.1.1", - "interpret": "~1.1.0", - "liftup": "~3.0.1", - "nopt": "~4.0.1", - "v8flags": "~3.2.0" - }, - "dependencies": { - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - } - } - }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -7021,21 +6996,6 @@ "argparse": "^1.0.7", "esprima": "^4.0.0" } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, - "v8flags": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", - "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } } } }, @@ -7097,9 +7057,9 @@ } }, "grunt-known-options": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", - "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", "dev": true }, "grunt-legacy-log": { @@ -7134,9 +7094,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -7190,12 +7150,6 @@ "which": "~2.0.2" }, "dependencies": { - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", - "dev": true - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -10187,6 +10141,12 @@ "yallist": "^4.0.0" } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", @@ -10666,9 +10626,9 @@ }, "dependencies": { "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" @@ -12215,13 +12175,21 @@ "dev": true }, "underscore.string": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", - "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", "dev": true, "requires": { - "sprintf-js": "^1.0.3", + "sprintf-js": "^1.1.1", "util-deprecate": "^1.0.2" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + } } }, "unicode-canonical-property-names-ecmascript": { diff --git a/package.json b/package.json index feb6a97..c8c2d83 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "copy-webpack-plugin": "^6.0.3", "eslint": "^8.10.0", "fhir": "^4.10.3", - "grunt": "^1.4.0", + "grunt": "^1.5.2", "grunt-cli": "^1.4.3", "grunt-contrib-connect": "^3.0.0", "grunt-protractor-runner": "^5.0.0",