@glion/ack 0.15.3 → 0.16.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/constants.d.ts +8 -8
- package/dist/exception.d.ts +12 -0
- package/dist/exception.d.ts.map +1 -1
- package/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/package.json +15 -16
package/dist/constants.d.ts
CHANGED
|
@@ -15,26 +15,26 @@ export type AckSuccessCode = typeof AckCode.ApplicationAccept | typeof AckCode.C
|
|
|
15
15
|
* all versions (v2.1–v2.9).
|
|
16
16
|
*/
|
|
17
17
|
export declare const Hl7ErrorCode: {
|
|
18
|
+
readonly ApplicationInternalError: "207";
|
|
19
|
+
readonly ApplicationRecordLocked: "206";
|
|
20
|
+
readonly DataTypeError: "102";
|
|
21
|
+
readonly DuplicateKeyIdentifier: "205";
|
|
18
22
|
readonly MessageAccepted: "0";
|
|
19
|
-
readonly SegmentSequenceError: "100";
|
|
20
23
|
readonly RequiredFieldMissing: "101";
|
|
21
|
-
readonly
|
|
24
|
+
readonly SegmentSequenceError: "100";
|
|
22
25
|
readonly TableValueNotFound: "103";
|
|
23
|
-
readonly
|
|
26
|
+
readonly UnknownKeyIdentifier: "204";
|
|
24
27
|
readonly UnsupportedEventCode: "201";
|
|
28
|
+
readonly UnsupportedMessageType: "200";
|
|
25
29
|
readonly UnsupportedProcessingId: "202";
|
|
26
30
|
readonly UnsupportedVersionId: "203";
|
|
27
|
-
readonly UnknownKeyIdentifier: "204";
|
|
28
|
-
readonly DuplicateKeyIdentifier: "205";
|
|
29
|
-
readonly ApplicationRecordLocked: "206";
|
|
30
|
-
readonly ApplicationInternalError: "207";
|
|
31
31
|
};
|
|
32
32
|
export type Hl7ErrorCodeValue = (typeof Hl7ErrorCode)[keyof typeof Hl7ErrorCode];
|
|
33
33
|
/** HL7v2 Table 0516 — Error severity codes used in ERR-4. */
|
|
34
34
|
export declare const Severity: {
|
|
35
|
+
readonly Error: "E";
|
|
35
36
|
readonly Info: "I";
|
|
36
37
|
readonly Warning: "W";
|
|
37
|
-
readonly Error: "E";
|
|
38
38
|
};
|
|
39
39
|
export type SeverityValue = (typeof Severity)[keyof typeof Severity];
|
|
40
40
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/exception.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type { AckCodeValue, Hl7ErrorCodeValue, SeverityValue } from "./constants
|
|
|
3
3
|
export interface AckExceptionOptions extends ErrorOptions {
|
|
4
4
|
errorCode: Hl7ErrorCodeValue;
|
|
5
5
|
severity?: SeverityValue;
|
|
6
|
+
/**
|
|
7
|
+
* The raw HL7v2 ACK message associated with this exception, when one
|
|
8
|
+
* exists. Set when the exception is derived from an existing ACK;
|
|
9
|
+
* left undefined when no ACK has been produced yet.
|
|
10
|
+
*/
|
|
11
|
+
raw?: string;
|
|
6
12
|
}
|
|
7
13
|
/**
|
|
8
14
|
* Abstract base class for all HL7v2 acknowledgment exceptions.
|
|
@@ -17,6 +23,12 @@ export declare abstract class AckException extends Error {
|
|
|
17
23
|
abstract readonly code: AckCodeValue;
|
|
18
24
|
readonly errorCode: Hl7ErrorCodeValue;
|
|
19
25
|
readonly severity: SeverityValue | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The raw HL7v2 ACK message associated with this exception, when one
|
|
28
|
+
* exists. Set when the exception is derived from an existing ACK;
|
|
29
|
+
* left undefined when no ACK has been produced yet.
|
|
30
|
+
*/
|
|
31
|
+
readonly raw: string | undefined;
|
|
20
32
|
constructor(message: string, options: AckExceptionOptions);
|
|
21
33
|
/**
|
|
22
34
|
* Build an ERR segment AST node from this exception's error code and
|
package/dist/exception.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,KAAK,EACV,YAAY,EACZ,i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YAAY;IAC9C,QAAQ,CAAC,IAAI,OAAuB;gBAExB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;CAI1D;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,QAAQ,CAAC,IAAI,OAAwB;gBAEzB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;CAI1D"}
|
package/dist/index.js
CHANGED
|
@@ -17,25 +17,25 @@ const AckCode = {
|
|
|
17
17
|
* all versions (v2.1–v2.9).
|
|
18
18
|
*/
|
|
19
19
|
const Hl7ErrorCode = {
|
|
20
|
+
ApplicationInternalError: "207",
|
|
21
|
+
ApplicationRecordLocked: "206",
|
|
22
|
+
DataTypeError: "102",
|
|
23
|
+
DuplicateKeyIdentifier: "205",
|
|
20
24
|
MessageAccepted: "0",
|
|
21
|
-
SegmentSequenceError: "100",
|
|
22
25
|
RequiredFieldMissing: "101",
|
|
23
|
-
|
|
26
|
+
SegmentSequenceError: "100",
|
|
24
27
|
TableValueNotFound: "103",
|
|
25
|
-
|
|
28
|
+
UnknownKeyIdentifier: "204",
|
|
26
29
|
UnsupportedEventCode: "201",
|
|
30
|
+
UnsupportedMessageType: "200",
|
|
27
31
|
UnsupportedProcessingId: "202",
|
|
28
|
-
UnsupportedVersionId: "203"
|
|
29
|
-
UnknownKeyIdentifier: "204",
|
|
30
|
-
DuplicateKeyIdentifier: "205",
|
|
31
|
-
ApplicationRecordLocked: "206",
|
|
32
|
-
ApplicationInternalError: "207"
|
|
32
|
+
UnsupportedVersionId: "203"
|
|
33
33
|
};
|
|
34
34
|
/** HL7v2 Table 0516 — Error severity codes used in ERR-4. */
|
|
35
35
|
const Severity = {
|
|
36
|
+
Error: "E",
|
|
36
37
|
Info: "I",
|
|
37
|
-
Warning: "W"
|
|
38
|
-
Error: "E"
|
|
38
|
+
Warning: "W"
|
|
39
39
|
};
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/uid.ts
|
|
@@ -97,10 +97,17 @@ function acknowledge(origin, { id, processingId, sending, error, includeErrSegme
|
|
|
97
97
|
var AckException = class extends Error {
|
|
98
98
|
errorCode;
|
|
99
99
|
severity;
|
|
100
|
+
/**
|
|
101
|
+
* The raw HL7v2 ACK message associated with this exception, when one
|
|
102
|
+
* exists. Set when the exception is derived from an existing ACK;
|
|
103
|
+
* left undefined when no ACK has been produced yet.
|
|
104
|
+
*/
|
|
105
|
+
raw;
|
|
100
106
|
constructor(message, options) {
|
|
101
107
|
super(message, { cause: options.cause });
|
|
102
108
|
this.errorCode = options.errorCode;
|
|
103
109
|
this.severity = options.severity;
|
|
110
|
+
this.raw = options.raw;
|
|
104
111
|
}
|
|
105
112
|
/**
|
|
106
113
|
* Build an ERR segment AST node from this exception's error code and
|
|
@@ -174,9 +181,9 @@ var AckCommitReject = class extends AckException {
|
|
|
174
181
|
var ApplicationInternalError = class extends AckApplicationError {
|
|
175
182
|
constructor(message, cause) {
|
|
176
183
|
super(message, {
|
|
184
|
+
cause,
|
|
177
185
|
errorCode: Hl7ErrorCode.ApplicationInternalError,
|
|
178
|
-
severity: Severity.Error
|
|
179
|
-
cause
|
|
186
|
+
severity: Severity.Error
|
|
180
187
|
});
|
|
181
188
|
this.name = "ApplicationInternalError";
|
|
182
189
|
}
|
|
@@ -192,9 +199,9 @@ var ApplicationInternalError = class extends AckApplicationError {
|
|
|
192
199
|
var CommitInternalError = class extends AckCommitError {
|
|
193
200
|
constructor(message, cause) {
|
|
194
201
|
super(message, {
|
|
202
|
+
cause,
|
|
195
203
|
errorCode: Hl7ErrorCode.ApplicationInternalError,
|
|
196
|
-
severity: Severity.Error
|
|
197
|
-
cause
|
|
204
|
+
severity: Severity.Error
|
|
198
205
|
});
|
|
199
206
|
this.name = "CommitInternalError";
|
|
200
207
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/constants.ts","../src/uid.ts","../src/acknowledge.ts","../src/exception.ts","../src/errors/application-internal-error.ts","../src/errors/commit-internal-error.ts","../src/errors/unsupported-message-type-reject.ts"],"sourcesContent":["/** HL7v2 Table 0008 — Acknowledgment codes used in MSA-1. */\nexport const AckCode = {\n ApplicationAccept: \"AA\",\n ApplicationError: \"AE\",\n ApplicationReject: \"AR\",\n CommitAccept: \"CA\",\n CommitError: \"CE\",\n CommitReject: \"CR\",\n} as const;\n\nexport type AckCodeValue = (typeof AckCode)[keyof typeof AckCode];\n\n/** Accept codes used as `successCode` in `acknowledge()`. */\nexport type AckSuccessCode =\n | typeof AckCode.ApplicationAccept\n | typeof AckCode.CommitAccept;\n\n/**\n * HL7v2 Table 0357 — Message error condition codes used in ERR-3. Stable across\n * all versions (v2.1–v2.9).\n */\nexport const Hl7ErrorCode = {\n MessageAccepted: \"0\",\n SegmentSequenceError: \"100\",\n RequiredFieldMissing: \"101\",\n DataTypeError: \"102\",\n TableValueNotFound: \"103\",\n UnsupportedMessageType: \"200\",\n UnsupportedEventCode: \"201\",\n UnsupportedProcessingId: \"202\",\n UnsupportedVersionId: \"203\",\n UnknownKeyIdentifier: \"204\",\n DuplicateKeyIdentifier: \"205\",\n ApplicationRecordLocked: \"206\",\n ApplicationInternalError: \"207\",\n} as const;\n\nexport type Hl7ErrorCodeValue =\n (typeof Hl7ErrorCode)[keyof typeof Hl7ErrorCode];\n\n/** HL7v2 Table 0516 — Error severity codes used in ERR-4. */\nexport const Severity = {\n Info: \"I\",\n Warning: \"W\",\n Error: \"E\",\n} as const;\n\nexport type SeverityValue = (typeof Severity)[keyof typeof Severity];\n","import { nanoid } from \"nanoid\";\n\nconst MAX_LENGTH = 20;\n\nexport interface Options {\n prefix?: string;\n size?: number;\n}\n\nexport function uid(options: Options = {}): string {\n const { prefix, size = MAX_LENGTH } = options;\n\n if (!prefix) {\n return nanoid(size);\n }\n\n const remaining = size - prefix.length;\n\n if (remaining <= 0) {\n return prefix.slice(0, size);\n }\n\n return `${prefix}${nanoid(remaining)}`;\n}\n","import type { Root, Segment } from \"@glion/ast\";\nimport { c, f, m, s } from \"@glion/builder\";\nimport { value } from \"@glion/util-query\";\nimport { Timestamp } from \"@glion/util-timestamp\";\n\nimport { AckCode } from \"./constants\";\nimport type { AckSuccessCode } from \"./constants\";\nimport type { AckException } from \"./exception\";\nimport { uid } from \"./uid\";\n\nexport interface SendingInfo {\n application: string;\n facility: string;\n}\n\nexport type AcknowledgeOptions = {\n /** Custom MSH-10 control ID. Auto-generated via `uid()` when omitted. */\n id?: string;\n /** MSH-3/MSH-4 of the ACK. Defaults to the original message's MSH-5/MSH-6. */\n sending?: SendingInfo;\n /** MSH-11 processing ID. Defaults to the original message's MSH-11. */\n processingId?: string;\n} & (\n | {\n /**\n * Sets the ACK code (AE/AR/CE/CR) and populates MSA-3 with the error\n * message.\n */\n error: AckException;\n /** Include ERR segment when an error is provided. Defaults to `true`. */\n includeErrSegment?: boolean;\n successCode?: never;\n }\n | {\n error?: never;\n includeErrSegment?: never;\n /**\n * MSA-1 code when no error is present. Defaults to\n * `AckCode.ApplicationAccept`.\n */\n successCode?: AckSuccessCode;\n }\n);\n\n// -- Field extraction ----\n\ninterface OriginFields {\n controlId: string;\n version: string;\n triggerEvent: string;\n processingId: string;\n sendingApp: string;\n sendingFac: string;\n receivingApp: string;\n receivingFac: string;\n}\n\nfunction extractOriginFields(tree: Root): OriginFields {\n return {\n controlId: value(tree, \"MSH-10\")?.value ?? \"\",\n processingId: value(tree, \"MSH-11\")?.value ?? \"P\",\n receivingApp: value(tree, \"MSH-5\")?.value ?? \"\",\n receivingFac: value(tree, \"MSH-6\")?.value ?? \"\",\n sendingApp: value(tree, \"MSH-3\")?.value ?? \"\",\n sendingFac: value(tree, \"MSH-4\")?.value ?? \"\",\n triggerEvent: value(tree, \"MSH-9.2\")?.value ?? \"\",\n version: value(tree, \"MSH-12.1\")?.value ?? \"\",\n };\n}\n\n// -- Segment builders ----\n\nfunction buildMsh(\n origin: OriginFields,\n options: Pick<AcknowledgeOptions, \"id\" | \"sending\" | \"processingId\">\n): Segment {\n const sendApp = options.sending?.application ?? origin.receivingApp;\n const sendFac = options.sending?.facility ?? origin.receivingFac;\n const pid = options.processingId ?? origin.processingId;\n const controlId = options.id ?? uid();\n const msgType = origin.triggerEvent\n ? f(c(\"ACK\"), c(origin.triggerEvent))\n : f(\"ACK\");\n\n return s(\n \"MSH\",\n f(\"|\"),\n f(\"^~\\\\&\"),\n f(sendApp),\n f(sendFac),\n f(origin.sendingApp),\n f(origin.sendingFac),\n f(Timestamp.now().toString()),\n f(\"\"),\n msgType,\n f(controlId),\n f(pid),\n f(origin.version)\n );\n}\n\nfunction buildMsa(code: string, controlId: string, message?: string): Segment {\n return message\n ? s(\"MSA\", f(code), f(controlId), f(message))\n : s(\"MSA\", f(code), f(controlId));\n}\n\n// -- Public API ----\n\nexport function acknowledge(\n origin: Root,\n {\n id,\n processingId,\n sending,\n error,\n includeErrSegment = true,\n successCode = AckCode.ApplicationAccept,\n }: AcknowledgeOptions = {}\n): Root {\n const fields = extractOriginFields(origin);\n const code = error?.code ?? successCode;\n\n const segments: Segment[] = [\n buildMsh(fields, {\n id,\n processingId,\n sending,\n }),\n buildMsa(code, fields.controlId, error?.message),\n ];\n\n if (error && includeErrSegment) {\n segments.push(error.toErrSegment());\n }\n\n return m(...segments);\n}\n","import type { Segment } from \"@glion/ast\";\nimport { f, s } from \"@glion/builder\";\n\nimport { AckCode, Severity } from \"./constants\";\nimport type {\n AckCodeValue,\n Hl7ErrorCodeValue,\n SeverityValue,\n} from \"./constants\";\n\nexport interface AckExceptionOptions extends ErrorOptions {\n errorCode: Hl7ErrorCodeValue;\n severity?: SeverityValue;\n}\n\n/**\n * Abstract base class for all HL7v2 acknowledgment exceptions.\n *\n * Subclasses map to specific MSA-1 acknowledgment codes (Table 0008).\n * Each exception carries an error code (Table 0357), optional severity\n * (Table 0516), and can build its own ERR segment AST via {@link toErrSegment}.\n *\n * Use `instanceof AckException` to detect any ACK-level error in middleware.\n */\nexport abstract class AckException extends Error {\n abstract readonly code: AckCodeValue;\n readonly errorCode: Hl7ErrorCodeValue;\n readonly severity: SeverityValue | undefined;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, { cause: options.cause });\n this.errorCode = options.errorCode;\n this.severity = options.severity;\n }\n\n /**\n * Build an ERR segment AST node from this exception's error code and\n * severity.\n */\n toErrSegment(): Segment {\n return s(\n \"ERR\",\n f(\"\"),\n f(\"\"),\n f(this.errorCode),\n f(this.severity ?? Severity.Error)\n );\n }\n}\n\n/**\n * Application-level error (MSA-1 = `AE`).\n *\n * Throw when the message was understood but could not be processed\n * due to an application-level problem (e.g. validation failure, unknown key).\n */\nexport class AckApplicationError extends AckException {\n readonly code = AckCode.ApplicationError;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckApplicationError\";\n }\n}\n\n/**\n * Application-level reject (MSA-1 = `AR`).\n *\n * Throw when the message is rejected outright at the application level\n * (e.g. unsupported message type, unsupported version).\n */\nexport class AckApplicationReject extends AckException {\n readonly code = AckCode.ApplicationReject;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckApplicationReject\";\n }\n}\n\n/**\n * Commit-level error (MSA-1 = `CE`).\n *\n * Throw when the message could not be safely persisted/committed\n * (e.g. storage failure). Used in enhanced acknowledgment mode.\n */\nexport class AckCommitError extends AckException {\n readonly code = AckCode.CommitError;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckCommitError\";\n }\n}\n\n/**\n * Commit-level reject (MSA-1 = `CR`).\n *\n * Throw when the message is rejected at the commit level\n * (e.g. message cannot be stored). Used in enhanced acknowledgment mode.\n */\nexport class AckCommitReject extends AckException {\n readonly code = AckCode.CommitReject;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckCommitReject\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckApplicationError } from \"../exception\";\n\n/**\n * Application internal error (MSA-1 = `AE`, ERR-3 = `207`, ERR-4 = `E`).\n *\n * Used to wrap unexpected/unknown errors that don't map to a specific\n * HL7v2 error condition. This is the default error produced by\n * `ackMiddleware` when a handler throws an unrecognized exception.\n */\nexport class ApplicationInternalError extends AckApplicationError {\n constructor(message: string, cause?: Error) {\n super(message, {\n errorCode: Hl7ErrorCode.ApplicationInternalError,\n severity: Severity.Error,\n cause,\n });\n this.name = \"ApplicationInternalError\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckCommitError } from \"../exception\";\n\n/**\n * Commit-level internal error (MSA-1 = `CE`, ERR-3 = `207`, ERR-4 = `E`).\n *\n * Used when the message could not be persisted due to an internal\n * infrastructure failure (e.g. database unavailable).\n */\nexport class CommitInternalError extends AckCommitError {\n constructor(message: string, cause?: Error) {\n super(message, {\n errorCode: Hl7ErrorCode.ApplicationInternalError,\n severity: Severity.Error,\n cause,\n });\n this.name = \"CommitInternalError\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckApplicationReject } from \"../exception\";\n\n/**\n * Unsupported message type reject (MSA-1 = `AR`, ERR-3 = `200`, ERR-4 = `E`).\n *\n * Throw when the receiving application does not handle the inbound\n * message type (e.g. ADT^A01 sent to a system that only accepts ORU).\n */\nexport class UnsupportedMessageTypeReject extends AckApplicationReject {\n constructor(message: string) {\n super(message, {\n errorCode: Hl7ErrorCode.UnsupportedMessageType,\n severity: Severity.Error,\n });\n this.name = \"UnsupportedMessageTypeReject\";\n }\n}\n"],"mappings":";;;;;;AACA,MAAa,UAAU;CACrB,mBAAmB;CACnB,kBAAkB;CAClB,mBAAmB;CACnB,cAAc;CACd,aAAa;CACb,cAAc;CACf;;;;;AAaD,MAAa,eAAe;CAC1B,iBAAiB;CACjB,sBAAsB;CACtB,sBAAsB;CACtB,eAAe;CACf,oBAAoB;CACpB,wBAAwB;CACxB,sBAAsB;CACtB,yBAAyB;CACzB,sBAAsB;CACtB,sBAAsB;CACtB,wBAAwB;CACxB,yBAAyB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,aAAa;CAC/C,OAAgB,QAAQ;CAExB,YAAY,SAAiB,SAA8B;AACzD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;;;;;;;;;AAUhB,IAAa,kBAAb,cAAqC,aAAa;CAChD,OAAgB,QAAQ;CAExB,YAAY,SAAiB,SAA8B;AACzD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;;;;;;;;;;;;AChGhB,IAAa,2BAAb,cAA8C,oBAAoB;CAChE,YAAY,SAAiB,OAAe;AAC1C,QAAM,SAAS;GACb,WAAW,aAAa;GACxB,UAAU,SAAS;GACnB;GACD,CAAC;AACF,OAAK,OAAO;;;;;;;;;;;ACRhB,IAAa,sBAAb,cAAyC,eAAe;CACtD,YAAY,SAAiB,OAAe;AAC1C,QAAM,SAAS;GACb,WAAW,aAAa;GACxB,UAAU,SAAS;GACnB;GACD,CAAC;AACF,OAAK,OAAO;;;;;;;;;;;ACPhB,IAAa,+BAAb,cAAkD,qBAAqB;CACrE,YAAY,SAAiB;AAC3B,QAAM,SAAS;GACb,WAAW,aAAa;GACxB,UAAU,SAAS;GACpB,CAAC;AACF,OAAK,OAAO"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/constants.ts","../src/uid.ts","../src/acknowledge.ts","../src/exception.ts","../src/errors/application-internal-error.ts","../src/errors/commit-internal-error.ts","../src/errors/unsupported-message-type-reject.ts"],"sourcesContent":["/** HL7v2 Table 0008 — Acknowledgment codes used in MSA-1. */\nexport const AckCode = {\n ApplicationAccept: \"AA\",\n ApplicationError: \"AE\",\n ApplicationReject: \"AR\",\n CommitAccept: \"CA\",\n CommitError: \"CE\",\n CommitReject: \"CR\",\n} as const;\n\nexport type AckCodeValue = (typeof AckCode)[keyof typeof AckCode];\n\n/** Accept codes used as `successCode` in `acknowledge()`. */\nexport type AckSuccessCode =\n | typeof AckCode.ApplicationAccept\n | typeof AckCode.CommitAccept;\n\n/**\n * HL7v2 Table 0357 — Message error condition codes used in ERR-3. Stable across\n * all versions (v2.1–v2.9).\n */\nexport const Hl7ErrorCode = {\n ApplicationInternalError: \"207\",\n ApplicationRecordLocked: \"206\",\n DataTypeError: \"102\",\n DuplicateKeyIdentifier: \"205\",\n MessageAccepted: \"0\",\n RequiredFieldMissing: \"101\",\n SegmentSequenceError: \"100\",\n TableValueNotFound: \"103\",\n UnknownKeyIdentifier: \"204\",\n UnsupportedEventCode: \"201\",\n UnsupportedMessageType: \"200\",\n UnsupportedProcessingId: \"202\",\n UnsupportedVersionId: \"203\",\n} as const;\n\nexport type Hl7ErrorCodeValue =\n (typeof Hl7ErrorCode)[keyof typeof Hl7ErrorCode];\n\n/** HL7v2 Table 0516 — Error severity codes used in ERR-4. */\nexport const Severity = {\n Error: \"E\",\n Info: \"I\",\n Warning: \"W\",\n} as const;\n\nexport type SeverityValue = (typeof Severity)[keyof typeof Severity];\n","import { nanoid } from \"nanoid\";\n\nconst MAX_LENGTH = 20;\n\nexport interface Options {\n prefix?: string;\n size?: number;\n}\n\nexport function uid(options: Options = {}): string {\n const { prefix, size = MAX_LENGTH } = options;\n\n if (!prefix) {\n return nanoid(size);\n }\n\n const remaining = size - prefix.length;\n\n if (remaining <= 0) {\n return prefix.slice(0, size);\n }\n\n return `${prefix}${nanoid(remaining)}`;\n}\n","import type { Root, Segment } from \"@glion/ast\";\nimport { c, f, m, s } from \"@glion/builder\";\nimport { value } from \"@glion/util-query\";\nimport { Timestamp } from \"@glion/util-timestamp\";\n\nimport { AckCode } from \"./constants\";\nimport type { AckSuccessCode } from \"./constants\";\nimport type { AckException } from \"./exception\";\nimport { uid } from \"./uid\";\n\nexport interface SendingInfo {\n application: string;\n facility: string;\n}\n\nexport type AcknowledgeOptions = {\n /** Custom MSH-10 control ID. Auto-generated via `uid()` when omitted. */\n id?: string;\n /** MSH-3/MSH-4 of the ACK. Defaults to the original message's MSH-5/MSH-6. */\n sending?: SendingInfo;\n /** MSH-11 processing ID. Defaults to the original message's MSH-11. */\n processingId?: string;\n} & (\n | {\n /**\n * Sets the ACK code (AE/AR/CE/CR) and populates MSA-3 with the error\n * message.\n */\n error: AckException;\n /** Include ERR segment when an error is provided. Defaults to `true`. */\n includeErrSegment?: boolean;\n successCode?: never;\n }\n | {\n error?: never;\n includeErrSegment?: never;\n /**\n * MSA-1 code when no error is present. Defaults to\n * `AckCode.ApplicationAccept`.\n */\n successCode?: AckSuccessCode;\n }\n);\n\n// -- Field extraction ----\n\ninterface OriginFields {\n controlId: string;\n version: string;\n triggerEvent: string;\n processingId: string;\n sendingApp: string;\n sendingFac: string;\n receivingApp: string;\n receivingFac: string;\n}\n\nfunction extractOriginFields(tree: Root): OriginFields {\n return {\n controlId: value(tree, \"MSH-10\")?.value ?? \"\",\n processingId: value(tree, \"MSH-11\")?.value ?? \"P\",\n receivingApp: value(tree, \"MSH-5\")?.value ?? \"\",\n receivingFac: value(tree, \"MSH-6\")?.value ?? \"\",\n sendingApp: value(tree, \"MSH-3\")?.value ?? \"\",\n sendingFac: value(tree, \"MSH-4\")?.value ?? \"\",\n triggerEvent: value(tree, \"MSH-9.2\")?.value ?? \"\",\n version: value(tree, \"MSH-12.1\")?.value ?? \"\",\n };\n}\n\n// -- Segment builders ----\n\nfunction buildMsh(\n origin: OriginFields,\n options: Pick<AcknowledgeOptions, \"id\" | \"sending\" | \"processingId\">\n): Segment {\n const sendApp = options.sending?.application ?? origin.receivingApp;\n const sendFac = options.sending?.facility ?? origin.receivingFac;\n const pid = options.processingId ?? origin.processingId;\n const controlId = options.id ?? uid();\n const msgType = origin.triggerEvent\n ? f(c(\"ACK\"), c(origin.triggerEvent))\n : f(\"ACK\");\n\n return s(\n \"MSH\",\n f(\"|\"),\n f(\"^~\\\\&\"),\n f(sendApp),\n f(sendFac),\n f(origin.sendingApp),\n f(origin.sendingFac),\n f(Timestamp.now().toString()),\n f(\"\"),\n msgType,\n f(controlId),\n f(pid),\n f(origin.version)\n );\n}\n\nfunction buildMsa(code: string, controlId: string, message?: string): Segment {\n return message\n ? s(\"MSA\", f(code), f(controlId), f(message))\n : s(\"MSA\", f(code), f(controlId));\n}\n\n// -- Public API ----\n\nexport function acknowledge(\n origin: Root,\n {\n id,\n processingId,\n sending,\n error,\n includeErrSegment = true,\n successCode = AckCode.ApplicationAccept,\n }: AcknowledgeOptions = {}\n): Root {\n const fields = extractOriginFields(origin);\n const code = error?.code ?? successCode;\n\n const segments: Segment[] = [\n buildMsh(fields, {\n id,\n processingId,\n sending,\n }),\n buildMsa(code, fields.controlId, error?.message),\n ];\n\n if (error && includeErrSegment) {\n segments.push(error.toErrSegment());\n }\n\n return m(...segments);\n}\n","import type { Segment } from \"@glion/ast\";\nimport { f, s } from \"@glion/builder\";\n\nimport { AckCode, Severity } from \"./constants\";\nimport type {\n AckCodeValue,\n Hl7ErrorCodeValue,\n SeverityValue,\n} from \"./constants\";\n\nexport interface AckExceptionOptions extends ErrorOptions {\n errorCode: Hl7ErrorCodeValue;\n severity?: SeverityValue;\n /**\n * The raw HL7v2 ACK message associated with this exception, when one\n * exists. Set when the exception is derived from an existing ACK;\n * left undefined when no ACK has been produced yet.\n */\n raw?: string;\n}\n\n/**\n * Abstract base class for all HL7v2 acknowledgment exceptions.\n *\n * Subclasses map to specific MSA-1 acknowledgment codes (Table 0008).\n * Each exception carries an error code (Table 0357), optional severity\n * (Table 0516), and can build its own ERR segment AST via {@link toErrSegment}.\n *\n * Use `instanceof AckException` to detect any ACK-level error in middleware.\n */\nexport abstract class AckException extends Error {\n abstract readonly code: AckCodeValue;\n readonly errorCode: Hl7ErrorCodeValue;\n readonly severity: SeverityValue | undefined;\n /**\n * The raw HL7v2 ACK message associated with this exception, when one\n * exists. Set when the exception is derived from an existing ACK;\n * left undefined when no ACK has been produced yet.\n */\n readonly raw: string | undefined;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, { cause: options.cause });\n this.errorCode = options.errorCode;\n this.severity = options.severity;\n this.raw = options.raw;\n }\n\n /**\n * Build an ERR segment AST node from this exception's error code and\n * severity.\n */\n toErrSegment(): Segment {\n return s(\n \"ERR\",\n f(\"\"),\n f(\"\"),\n f(this.errorCode),\n f(this.severity ?? Severity.Error)\n );\n }\n}\n\n/**\n * Application-level error (MSA-1 = `AE`).\n *\n * Throw when the message was understood but could not be processed\n * due to an application-level problem (e.g. validation failure, unknown key).\n */\nexport class AckApplicationError extends AckException {\n readonly code = AckCode.ApplicationError;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckApplicationError\";\n }\n}\n\n/**\n * Application-level reject (MSA-1 = `AR`).\n *\n * Throw when the message is rejected outright at the application level\n * (e.g. unsupported message type, unsupported version).\n */\nexport class AckApplicationReject extends AckException {\n readonly code = AckCode.ApplicationReject;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckApplicationReject\";\n }\n}\n\n/**\n * Commit-level error (MSA-1 = `CE`).\n *\n * Throw when the message could not be safely persisted/committed\n * (e.g. storage failure). Used in enhanced acknowledgment mode.\n */\nexport class AckCommitError extends AckException {\n readonly code = AckCode.CommitError;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckCommitError\";\n }\n}\n\n/**\n * Commit-level reject (MSA-1 = `CR`).\n *\n * Throw when the message is rejected at the commit level\n * (e.g. message cannot be stored). Used in enhanced acknowledgment mode.\n */\nexport class AckCommitReject extends AckException {\n readonly code = AckCode.CommitReject;\n\n constructor(message: string, options: AckExceptionOptions) {\n super(message, options);\n this.name = \"AckCommitReject\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckApplicationError } from \"../exception\";\n\n/**\n * Application internal error (MSA-1 = `AE`, ERR-3 = `207`, ERR-4 = `E`).\n *\n * Used to wrap unexpected/unknown errors that don't map to a specific\n * HL7v2 error condition. This is the default error produced by\n * `ackMiddleware` when a handler throws an unrecognized exception.\n */\nexport class ApplicationInternalError extends AckApplicationError {\n constructor(message: string, cause?: Error) {\n super(message, {\n cause,\n errorCode: Hl7ErrorCode.ApplicationInternalError,\n severity: Severity.Error,\n });\n this.name = \"ApplicationInternalError\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckCommitError } from \"../exception\";\n\n/**\n * Commit-level internal error (MSA-1 = `CE`, ERR-3 = `207`, ERR-4 = `E`).\n *\n * Used when the message could not be persisted due to an internal\n * infrastructure failure (e.g. database unavailable).\n */\nexport class CommitInternalError extends AckCommitError {\n constructor(message: string, cause?: Error) {\n super(message, {\n cause,\n errorCode: Hl7ErrorCode.ApplicationInternalError,\n severity: Severity.Error,\n });\n this.name = \"CommitInternalError\";\n }\n}\n","import { Hl7ErrorCode, Severity } from \"../constants\";\nimport { AckApplicationReject } from \"../exception\";\n\n/**\n * Unsupported message type reject (MSA-1 = `AR`, ERR-3 = `200`, ERR-4 = `E`).\n *\n * Throw when the receiving application does not handle the inbound\n * message type (e.g. ADT^A01 sent to a system that only accepts ORU).\n */\nexport class UnsupportedMessageTypeReject extends AckApplicationReject {\n constructor(message: string) {\n super(message, {\n errorCode: Hl7ErrorCode.UnsupportedMessageType,\n severity: Severity.Error,\n });\n this.name = \"UnsupportedMessageTypeReject\";\n }\n}\n"],"mappings":";;;;;;AACA,MAAa,UAAU;CACrB,mBAAmB;CACnB,kBAAkB;CAClB,mBAAmB;CACnB,cAAc;CACd,aAAa;CACb,cAAc;CACf;;;;;AAaD,MAAa,eAAe;CAC1B,0BAA0B;CAC1B,yBAAyB;CACzB,eAAe;CACf,wBAAwB;CACxB,iBAAiB;CACjB,sBAAsB;CACtB,sBAAsB;CACtB,oBAAoB;CACpB,sBAAsB;CACtB,sBAAsB;CACtB,wBAAwB;CACxB,yBAAyB;CACzB,sBAAsB;CACvB;;AAMD,MAAa,WAAW;CACtB,OAAO;CACP,MAAM;CACN,SAAS;CACV;;;AC3CD,MAAM,aAAa;AAOnB,SAAgB,IAAI,UAAmB,EAAE,EAAU;CACjD,MAAM,EAAE,QAAQ,OAAO,eAAe;AAEtC,KAAI,CAAC,OACH,QAAO,OAAO,KAAK;C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A8B;AACzD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;;;;;;;;;;;;AC7GhB,IAAa,2BAAb,cAA8C,oBAAoB;CAChE,YAAY,SAAiB,OAAe;AAC1C,QAAM,SAAS;GACb;GACA,WAAW,aAAa;GACxB,UAAU,SAAS;GACpB,CAAC;AACF,OAAK,OAAO;;;;;;;;;;;ACRhB,IAAa,sBAAb,cAAyC,eAAe;CACtD,YAAY,SAAiB,OAAe;AAC1C,QAAM,SAAS;GACb;GACA,WAAW,aAAa;GACxB,UAAU,SAAS;GACpB,CAAC;AACF,OAAK,OAAO;;;;;;;;;;;ACPhB,IAAa,+BAAb,cAAkD,qBAAqB;CACrE,YAAY,SAAiB;AAC3B,QAAM,SAAS;GACb,WAAW,aAAa;GACxB,UAAU,SAAS;GACpB,CAAC;AACF,OAAK,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glion/ack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "HL7v2 acknowledgment message builder and typed error classes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ack",
|
|
@@ -35,27 +35,26 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"nanoid": "5.1.7",
|
|
38
|
-
"@glion/ast": "0.
|
|
39
|
-
"@glion/
|
|
40
|
-
"@glion/
|
|
41
|
-
"@glion/util-
|
|
38
|
+
"@glion/ast": "0.16.0",
|
|
39
|
+
"@glion/builder": "0.16.0",
|
|
40
|
+
"@glion/util-query": "0.16.0",
|
|
41
|
+
"@glion/util-timestamp": "0.16.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/node": "
|
|
45
|
-
"@vitest/coverage-v8": "4.1.
|
|
44
|
+
"@types/node": "25.6.0",
|
|
45
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
46
46
|
"publint": "0.3.18",
|
|
47
|
-
"tsdown": "0.21.
|
|
48
|
-
"typescript": "
|
|
49
|
-
"vitest": "4.1.
|
|
50
|
-
"@glion/
|
|
51
|
-
"@glion/
|
|
52
|
-
"@glion/
|
|
53
|
-
"@glion/testing": "0.
|
|
47
|
+
"tsdown": "0.21.10",
|
|
48
|
+
"typescript": "6.0.3",
|
|
49
|
+
"vitest": "4.1.5",
|
|
50
|
+
"@glion/to-hl7v2": "0.16.0",
|
|
51
|
+
"@glion/tsconfig": "0.16.0",
|
|
52
|
+
"@glion/check-readme": "0.16.0",
|
|
53
|
+
"@glion/testing": "0.16.0"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
56
|
+
"node": ">=20"
|
|
57
57
|
},
|
|
58
|
-
"packageManager": "pnpm@10.14.0",
|
|
59
58
|
"scripts": {
|
|
60
59
|
"build": "tsdown && tsc --emitDeclarationOnly",
|
|
61
60
|
"check-types": "tsc --noEmit",
|