@vereign/core 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -0
- package/dist/index.mjs +9 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -161,6 +161,14 @@ var CHMED16AController = class {
|
|
|
161
161
|
return json;
|
|
162
162
|
} catch (error) {
|
|
163
163
|
this.logger.error("Parsing failed:", error);
|
|
164
|
+
if (error instanceof import_chmed_parser.ConformanceError) {
|
|
165
|
+
throw new AppError(
|
|
166
|
+
400,
|
|
167
|
+
"CHMED data does not conform to required standards.",
|
|
168
|
+
"CONFORMANCE_ERROR",
|
|
169
|
+
error.validationErrors
|
|
170
|
+
);
|
|
171
|
+
}
|
|
164
172
|
throw new AppError(
|
|
165
173
|
400,
|
|
166
174
|
"Failed to parse CHMED data. Please check the input format.",
|
package/dist/index.mjs
CHANGED
|
@@ -67,7 +67,7 @@ var HealthRouter = class {
|
|
|
67
67
|
import express2 from "express";
|
|
68
68
|
|
|
69
69
|
// src/chmed16/controller.ts
|
|
70
|
-
import { CHMEDParser, SDS } from "@vereign/chmed-parser";
|
|
70
|
+
import { CHMEDParser, SDS, ConformanceError } from "@vereign/chmed-parser";
|
|
71
71
|
import { PDFLib } from "@vereign/pdf-generator";
|
|
72
72
|
|
|
73
73
|
// src/app-error.ts
|
|
@@ -130,6 +130,14 @@ var CHMED16AController = class {
|
|
|
130
130
|
return json;
|
|
131
131
|
} catch (error) {
|
|
132
132
|
this.logger.error("Parsing failed:", error);
|
|
133
|
+
if (error instanceof ConformanceError) {
|
|
134
|
+
throw new AppError(
|
|
135
|
+
400,
|
|
136
|
+
"CHMED data does not conform to required standards.",
|
|
137
|
+
"CONFORMANCE_ERROR",
|
|
138
|
+
error.validationErrors
|
|
139
|
+
);
|
|
140
|
+
}
|
|
133
141
|
throw new AppError(
|
|
134
142
|
400,
|
|
135
143
|
"Failed to parse CHMED data. Please check the input format.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vereign/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "core api library for e prescription project",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"zod-openapi": "^5.3.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@vereign/chmed-parser": "^1.
|
|
64
|
-
"@vereign/pdf-generator": "^1.5.
|
|
63
|
+
"@vereign/chmed-parser": "^1.8.0",
|
|
64
|
+
"@vereign/pdf-generator": "^1.5.3",
|
|
65
65
|
"express": "^5.1.0",
|
|
66
66
|
"pdfkit": "^0.17.1",
|
|
67
67
|
"winston": "^3.17.0",
|