hl7v2 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/cjs/hl7-component.js +2 -0
- package/cjs/hl7-error.js +10 -1
- package/cjs/hl7-field.js +2 -0
- package/cjs/hl7-message-node.js +2 -2
- package/cjs/hl7-message.js +32 -30
- package/cjs/hl7-repetition.js +1 -0
- package/cjs/hl7-segment.js +2 -1
- package/cjs/hl7-sub-component.js +3 -0
- package/esm/hl7-component.js +2 -0
- package/esm/hl7-error.js +10 -1
- package/esm/hl7-field.js +2 -0
- package/esm/hl7-message-node.js +2 -2
- package/esm/hl7-message.js +32 -30
- package/esm/hl7-repetition.js +1 -0
- package/esm/hl7-segment.js +2 -1
- package/esm/hl7-sub-component.js +3 -0
- package/package.json +4 -4
package/cjs/hl7-component.js
CHANGED
|
@@ -6,6 +6,8 @@ const hl7_error_js_1 = require("./hl7-error.js");
|
|
|
6
6
|
const hl7_sub_component_js_1 = require("./hl7-sub-component.js");
|
|
7
7
|
const hl7_escape_js_1 = require("./utils/hl7-escape.js");
|
|
8
8
|
class Hl7Component {
|
|
9
|
+
repetition;
|
|
10
|
+
position;
|
|
9
11
|
constructor(repetition, position, def) {
|
|
10
12
|
this.repetition = repetition;
|
|
11
13
|
this.position = position;
|
package/cjs/hl7-error.js
CHANGED
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HL7Error = void 0;
|
|
4
4
|
class HL7Error extends Error {
|
|
5
|
+
hl7ErrorCode;
|
|
6
|
+
severity = 'E';
|
|
7
|
+
appErrorCode;
|
|
8
|
+
line;
|
|
9
|
+
segmentType;
|
|
10
|
+
segmentSequence;
|
|
11
|
+
fieldPosition;
|
|
12
|
+
componentPosition;
|
|
13
|
+
subComponentPosition;
|
|
14
|
+
repetitionIndex;
|
|
5
15
|
constructor(message, args) {
|
|
6
16
|
super(message);
|
|
7
|
-
this.severity = 'E';
|
|
8
17
|
if (args?.hl7ErrorCode)
|
|
9
18
|
this.hl7ErrorCode = args?.hl7ErrorCode;
|
|
10
19
|
if (args?.severity)
|
package/cjs/hl7-field.js
CHANGED
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HL7Field = void 0;
|
|
4
4
|
const hl7_repetition_js_1 = require("./hl7-repetition.js");
|
|
5
5
|
class HL7Field {
|
|
6
|
+
segment;
|
|
7
|
+
position;
|
|
6
8
|
constructor(segment, position, def) {
|
|
7
9
|
this.segment = segment;
|
|
8
10
|
this.position = position;
|
package/cjs/hl7-message-node.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HL7MessageNode = void 0;
|
|
4
4
|
const hl7_segment_js_1 = require("./hl7-segment.js");
|
|
5
5
|
class HL7MessageNode {
|
|
6
|
+
name = '';
|
|
7
|
+
items = [];
|
|
6
8
|
constructor(name) {
|
|
7
|
-
this.name = '';
|
|
8
|
-
this.items = [];
|
|
9
9
|
this.name = name;
|
|
10
10
|
}
|
|
11
11
|
/**
|
package/cjs/hl7-message.js
CHANGED
|
@@ -11,12 +11,14 @@ const hl7_error_js_1 = require("./hl7-error.js");
|
|
|
11
11
|
const hl7_message_node_js_1 = require("./hl7-message-node.js");
|
|
12
12
|
const hl7_segment_js_1 = require("./hl7-segment.js");
|
|
13
13
|
class HL7Message {
|
|
14
|
+
_dictionaries;
|
|
15
|
+
_version;
|
|
16
|
+
fieldSeparator = constants_js_1.FIELD_SEPARATOR;
|
|
17
|
+
componentSeparator = constants_js_1.COMPONENT_SEPARATOR;
|
|
18
|
+
subComponentSeparator = constants_js_1.SUBCOMPONENT_SEPARATOR;
|
|
19
|
+
repetitionSeparator = constants_js_1.REPETITION_SEPARATOR;
|
|
20
|
+
escapeCharacter = constants_js_1.ESCAPE_CHARACTER;
|
|
14
21
|
constructor(version = hl7v2_dictionary_1.HL7Version.v2_7_1, dictionaries) {
|
|
15
|
-
this.fieldSeparator = constants_js_1.FIELD_SEPARATOR;
|
|
16
|
-
this.componentSeparator = constants_js_1.COMPONENT_SEPARATOR;
|
|
17
|
-
this.subComponentSeparator = constants_js_1.SUBCOMPONENT_SEPARATOR;
|
|
18
|
-
this.repetitionSeparator = constants_js_1.REPETITION_SEPARATOR;
|
|
19
|
-
this.escapeCharacter = constants_js_1.ESCAPE_CHARACTER;
|
|
20
22
|
this._dictionaries = dictionaries || hl7v2_dictionary_1.dictionaries;
|
|
21
23
|
this._version = version;
|
|
22
24
|
this.clear(version);
|
|
@@ -411,30 +413,30 @@ class HL7Message {
|
|
|
411
413
|
version: version,
|
|
412
414
|
};
|
|
413
415
|
}
|
|
416
|
+
static encodingMapping = {
|
|
417
|
+
ASCII: 'ascii',
|
|
418
|
+
'8859/1': 'latin1',
|
|
419
|
+
'8859/2': 'latin2',
|
|
420
|
+
'8859/3': 'ISO-8859-3',
|
|
421
|
+
'8859/4': 'ISO-8859-4',
|
|
422
|
+
'8859/5': 'ISO-8859-5',
|
|
423
|
+
'8859/6': 'ISO-8859-6',
|
|
424
|
+
'8859/7': 'ISO-8859-7',
|
|
425
|
+
'8859/8': 'ISO-8859-8',
|
|
426
|
+
'8859/9': 'latin5',
|
|
427
|
+
'8859/15': 'latin9',
|
|
428
|
+
'ISO IR6': 'ascii',
|
|
429
|
+
'ISO IR14': 'ISO-2022-JP',
|
|
430
|
+
'ISO IR87': 'ISO-2022-JP',
|
|
431
|
+
'ISO IR159': 'ISO-2022-JP-2',
|
|
432
|
+
'GB 18030-2000': 'gb18030',
|
|
433
|
+
'KS X 1001': 'EUC-KR',
|
|
434
|
+
'CNS 11643-1992': 'EUC-TW',
|
|
435
|
+
'BIG-5': 'Big5',
|
|
436
|
+
UNICODE: 'utf16-le',
|
|
437
|
+
'UNICODE UTF-8': 'utf8',
|
|
438
|
+
'UNICODE UTF-16': 'utf16-le',
|
|
439
|
+
// ⚠️ UTF-32 iconv-lite tarafından desteklenmez
|
|
440
|
+
};
|
|
414
441
|
}
|
|
415
442
|
exports.HL7Message = HL7Message;
|
|
416
|
-
HL7Message.encodingMapping = {
|
|
417
|
-
ASCII: 'ascii',
|
|
418
|
-
'8859/1': 'latin1',
|
|
419
|
-
'8859/2': 'latin2',
|
|
420
|
-
'8859/3': 'ISO-8859-3',
|
|
421
|
-
'8859/4': 'ISO-8859-4',
|
|
422
|
-
'8859/5': 'ISO-8859-5',
|
|
423
|
-
'8859/6': 'ISO-8859-6',
|
|
424
|
-
'8859/7': 'ISO-8859-7',
|
|
425
|
-
'8859/8': 'ISO-8859-8',
|
|
426
|
-
'8859/9': 'latin5',
|
|
427
|
-
'8859/15': 'latin9',
|
|
428
|
-
'ISO IR6': 'ascii',
|
|
429
|
-
'ISO IR14': 'ISO-2022-JP',
|
|
430
|
-
'ISO IR87': 'ISO-2022-JP',
|
|
431
|
-
'ISO IR159': 'ISO-2022-JP-2',
|
|
432
|
-
'GB 18030-2000': 'gb18030',
|
|
433
|
-
'KS X 1001': 'EUC-KR',
|
|
434
|
-
'CNS 11643-1992': 'EUC-TW',
|
|
435
|
-
'BIG-5': 'Big5',
|
|
436
|
-
UNICODE: 'utf16-le',
|
|
437
|
-
'UNICODE UTF-8': 'utf8',
|
|
438
|
-
'UNICODE UTF-16': 'utf16-le',
|
|
439
|
-
// ⚠️ UTF-32 iconv-lite tarafından desteklenmez
|
|
440
|
-
};
|
package/cjs/hl7-repetition.js
CHANGED
package/cjs/hl7-segment.js
CHANGED
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HL7Segment = void 0;
|
|
4
4
|
const hl7_field_js_1 = require("./hl7-field.js");
|
|
5
5
|
class HL7Segment {
|
|
6
|
+
message;
|
|
7
|
+
segmentType = '';
|
|
6
8
|
constructor(message, segmentType) {
|
|
7
|
-
this.segmentType = '';
|
|
8
9
|
this.message = message;
|
|
9
10
|
this.segmentType = segmentType;
|
|
10
11
|
this._definition = this.message.dictionary.segments[this.segmentType] || {
|
package/cjs/hl7-sub-component.js
CHANGED
|
@@ -5,6 +5,9 @@ const hl7v2_dictionary_1 = require("hl7v2-dictionary");
|
|
|
5
5
|
const hl7_error_js_1 = require("./hl7-error.js");
|
|
6
6
|
const hl7_escape_js_1 = require("./utils/hl7-escape.js");
|
|
7
7
|
class Hl7SubComponent {
|
|
8
|
+
component;
|
|
9
|
+
position;
|
|
10
|
+
_value;
|
|
8
11
|
constructor(component, position, def) {
|
|
9
12
|
this.component = component;
|
|
10
13
|
this.position = position;
|
package/esm/hl7-component.js
CHANGED
|
@@ -3,6 +3,8 @@ import { HL7Error } from './hl7-error.js';
|
|
|
3
3
|
import { Hl7SubComponent, } from './hl7-sub-component.js';
|
|
4
4
|
import { hl7Escape, hl7UnEscape } from './utils/hl7-escape.js';
|
|
5
5
|
export class Hl7Component {
|
|
6
|
+
repetition;
|
|
7
|
+
position;
|
|
6
8
|
constructor(repetition, position, def) {
|
|
7
9
|
this.repetition = repetition;
|
|
8
10
|
this.position = position;
|
package/esm/hl7-error.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export class HL7Error extends Error {
|
|
2
|
+
hl7ErrorCode;
|
|
3
|
+
severity = 'E';
|
|
4
|
+
appErrorCode;
|
|
5
|
+
line;
|
|
6
|
+
segmentType;
|
|
7
|
+
segmentSequence;
|
|
8
|
+
fieldPosition;
|
|
9
|
+
componentPosition;
|
|
10
|
+
subComponentPosition;
|
|
11
|
+
repetitionIndex;
|
|
2
12
|
constructor(message, args) {
|
|
3
13
|
super(message);
|
|
4
|
-
this.severity = 'E';
|
|
5
14
|
if (args?.hl7ErrorCode)
|
|
6
15
|
this.hl7ErrorCode = args?.hl7ErrorCode;
|
|
7
16
|
if (args?.severity)
|
package/esm/hl7-field.js
CHANGED
package/esm/hl7-message-node.js
CHANGED
package/esm/hl7-message.js
CHANGED
|
@@ -7,12 +7,14 @@ import { HL7Error } from './hl7-error.js';
|
|
|
7
7
|
import { HL7MessageNode } from './hl7-message-node.js';
|
|
8
8
|
import { HL7Segment, } from './hl7-segment.js';
|
|
9
9
|
export class HL7Message {
|
|
10
|
+
_dictionaries;
|
|
11
|
+
_version;
|
|
12
|
+
fieldSeparator = FIELD_SEPARATOR;
|
|
13
|
+
componentSeparator = COMPONENT_SEPARATOR;
|
|
14
|
+
subComponentSeparator = SUBCOMPONENT_SEPARATOR;
|
|
15
|
+
repetitionSeparator = REPETITION_SEPARATOR;
|
|
16
|
+
escapeCharacter = ESCAPE_CHARACTER;
|
|
10
17
|
constructor(version = HL7Version.v2_7_1, dictionaries) {
|
|
11
|
-
this.fieldSeparator = FIELD_SEPARATOR;
|
|
12
|
-
this.componentSeparator = COMPONENT_SEPARATOR;
|
|
13
|
-
this.subComponentSeparator = SUBCOMPONENT_SEPARATOR;
|
|
14
|
-
this.repetitionSeparator = REPETITION_SEPARATOR;
|
|
15
|
-
this.escapeCharacter = ESCAPE_CHARACTER;
|
|
16
18
|
this._dictionaries = dictionaries || defaultDictionaries;
|
|
17
19
|
this._version = version;
|
|
18
20
|
this.clear(version);
|
|
@@ -407,29 +409,29 @@ export class HL7Message {
|
|
|
407
409
|
version: version,
|
|
408
410
|
};
|
|
409
411
|
}
|
|
412
|
+
static encodingMapping = {
|
|
413
|
+
ASCII: 'ascii',
|
|
414
|
+
'8859/1': 'latin1',
|
|
415
|
+
'8859/2': 'latin2',
|
|
416
|
+
'8859/3': 'ISO-8859-3',
|
|
417
|
+
'8859/4': 'ISO-8859-4',
|
|
418
|
+
'8859/5': 'ISO-8859-5',
|
|
419
|
+
'8859/6': 'ISO-8859-6',
|
|
420
|
+
'8859/7': 'ISO-8859-7',
|
|
421
|
+
'8859/8': 'ISO-8859-8',
|
|
422
|
+
'8859/9': 'latin5',
|
|
423
|
+
'8859/15': 'latin9',
|
|
424
|
+
'ISO IR6': 'ascii',
|
|
425
|
+
'ISO IR14': 'ISO-2022-JP',
|
|
426
|
+
'ISO IR87': 'ISO-2022-JP',
|
|
427
|
+
'ISO IR159': 'ISO-2022-JP-2',
|
|
428
|
+
'GB 18030-2000': 'gb18030',
|
|
429
|
+
'KS X 1001': 'EUC-KR',
|
|
430
|
+
'CNS 11643-1992': 'EUC-TW',
|
|
431
|
+
'BIG-5': 'Big5',
|
|
432
|
+
UNICODE: 'utf16-le',
|
|
433
|
+
'UNICODE UTF-8': 'utf8',
|
|
434
|
+
'UNICODE UTF-16': 'utf16-le',
|
|
435
|
+
// ⚠️ UTF-32 iconv-lite tarafından desteklenmez
|
|
436
|
+
};
|
|
410
437
|
}
|
|
411
|
-
HL7Message.encodingMapping = {
|
|
412
|
-
ASCII: 'ascii',
|
|
413
|
-
'8859/1': 'latin1',
|
|
414
|
-
'8859/2': 'latin2',
|
|
415
|
-
'8859/3': 'ISO-8859-3',
|
|
416
|
-
'8859/4': 'ISO-8859-4',
|
|
417
|
-
'8859/5': 'ISO-8859-5',
|
|
418
|
-
'8859/6': 'ISO-8859-6',
|
|
419
|
-
'8859/7': 'ISO-8859-7',
|
|
420
|
-
'8859/8': 'ISO-8859-8',
|
|
421
|
-
'8859/9': 'latin5',
|
|
422
|
-
'8859/15': 'latin9',
|
|
423
|
-
'ISO IR6': 'ascii',
|
|
424
|
-
'ISO IR14': 'ISO-2022-JP',
|
|
425
|
-
'ISO IR87': 'ISO-2022-JP',
|
|
426
|
-
'ISO IR159': 'ISO-2022-JP-2',
|
|
427
|
-
'GB 18030-2000': 'gb18030',
|
|
428
|
-
'KS X 1001': 'EUC-KR',
|
|
429
|
-
'CNS 11643-1992': 'EUC-TW',
|
|
430
|
-
'BIG-5': 'Big5',
|
|
431
|
-
UNICODE: 'utf16-le',
|
|
432
|
-
'UNICODE UTF-8': 'utf8',
|
|
433
|
-
'UNICODE UTF-16': 'utf16-le',
|
|
434
|
-
// ⚠️ UTF-32 iconv-lite tarafından desteklenmez
|
|
435
|
-
};
|
package/esm/hl7-repetition.js
CHANGED
package/esm/hl7-segment.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HL7Field, } from './hl7-field.js';
|
|
2
2
|
export class HL7Segment {
|
|
3
|
+
message;
|
|
4
|
+
segmentType = '';
|
|
3
5
|
constructor(message, segmentType) {
|
|
4
|
-
this.segmentType = '';
|
|
5
6
|
this.message = message;
|
|
6
7
|
this.segmentType = segmentType;
|
|
7
8
|
this._definition = this.message.dictionary.segments[this.segmentType] || {
|
package/esm/hl7-sub-component.js
CHANGED
|
@@ -2,6 +2,9 @@ import { toHL7DateTime, } from 'hl7v2-dictionary';
|
|
|
2
2
|
import { HL7Error } from './hl7-error.js';
|
|
3
3
|
import { hl7Escape, hl7UnEscape } from './utils/hl7-escape.js';
|
|
4
4
|
export class Hl7SubComponent {
|
|
5
|
+
component;
|
|
6
|
+
position;
|
|
7
|
+
_value;
|
|
5
8
|
constructor(component, position, def) {
|
|
6
9
|
this.component = component;
|
|
7
10
|
this.position = position;
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hl7v2",
|
|
3
3
|
"description": "HL7 v2 parser, serializer, validator for NodeJS",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@jsopen/objects": "^2.0.2",
|
|
9
|
-
"iconv-lite": "^0.7.
|
|
9
|
+
"iconv-lite": "^0.7.1",
|
|
10
10
|
"is-typedarray": "^1.0.0",
|
|
11
11
|
"node-events-async": "^1.2.0",
|
|
12
12
|
"ts-gems": "^3.11.3",
|
|
13
13
|
"tslib": "^2.8.1",
|
|
14
|
-
"valgen": "^5.
|
|
14
|
+
"valgen": "^5.18.2",
|
|
15
15
|
"uid": "^2.0.2"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"hl7v2-dictionary": "^1.
|
|
18
|
+
"hl7v2-dictionary": "^1.6.0"
|
|
19
19
|
},
|
|
20
20
|
"type": "module",
|
|
21
21
|
"exports": {
|