Skip to content

Commit

Permalink
feat: update usage of node fhir validator to 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Oct 7, 2023
1 parent adf9d1f commit c1aafe8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"mongoose-date-format": "^1.2.0",
"mongoose-schema-jsonschema": "^2.0.2",
"node-fetch": "^2.6.1",
"node-java-fhir-validator": "^1.0.0",
"node-java-fhir-validator": "^1.1.0",
"node-schedule": "^2.1.0",
"normalize-text": "^2.3.2",
"object-hash": "^3.0.0",
Expand Down
8 changes: 4 additions & 4 deletions utils/validator/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ async function validateResource(resource) {
let profile = Object.prototype.hasOwnProperty.call(meta, "profile")
? meta.profile.join(",")
: undefined;
operationOutcome = await validator.validate(
JSON.stringify(resource),
operationOutcome = await validator.validateFromBuffer(
Buffer.from(JSON.stringify(resource)),
profile
);
} else {
operationOutcome = await validator.validateResource(
JSON.stringify(resource),
operationOutcome = await validator.validateFromBuffer(
Buffer.from(JSON.stringify(resource)),
undefined
);
}
Expand Down

0 comments on commit c1aafe8

Please sign in to comment.