diff --git a/package-lock.json b/package-lock.json index d8f2d953..d64a977d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,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", @@ -5297,9 +5297,9 @@ } }, "node_modules/node-java-fhir-validator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-java-fhir-validator/-/node-java-fhir-validator-1.0.0.tgz", - "integrity": "sha512-T+bBoFPsKrOL0yEVVoE9prErRsjqFXVNomH+O4m+L9Jly4ZyY1JUmeznMLa5UAscK16hpLkgOQ3+gAn50EmIyg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/node-java-fhir-validator/-/node-java-fhir-validator-1.1.0.tgz", + "integrity": "sha512-OZdJLxRiCgIsiGgtmItt82YKwgyM6hSlhMJpr6/B46u6dqP/l61glD3gXgSvDxQtUNsfLjM2sxMIolQy5V4NwQ==", "dependencies": { "glob": "^8.1.0", "java-bridge": "^2.3.0", diff --git a/package.json b/package.json index 2f9408d0..2d5ae93f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/utils/validator/processor.js b/utils/validator/processor.js index 5487ba9a..e0946128 100644 --- a/utils/validator/processor.js +++ b/utils/validator/processor.js @@ -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 ); }