hl7v2 1.2.3 → 1.2.4

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.
@@ -96,7 +96,7 @@ class HL7Message {
96
96
  this.repetitionSeparator = raw.repetitionSeparator;
97
97
  this.escapeCharacter = raw.escapeCharacter;
98
98
  this.subComponentSeparator = raw.subComponentSeparator;
99
- const lines = raw.data.split(constants_js_1.CR);
99
+ const lines = raw.data.replaceAll(constants_js_1.CR + constants_js_1.LF, constants_js_1.CR).split(constants_js_1.CR);
100
100
  const headerItems = raw.header.split(this.fieldSeparator);
101
101
  for (const [i, line] of lines.entries()) {
102
102
  if (!line)
@@ -2,7 +2,7 @@ import process from 'node:process';
2
2
  import { dictionaries as defaultDictionaries, ERLType, ERRSegment, findNearestHL7Version, HL7Version, MSASegment, MSHSegment, } from 'hl7v2-dictionary';
3
3
  import iconv from 'iconv-lite';
4
4
  import { uid } from 'uid';
5
- import { COMPONENT_SEPARATOR, CR, ESCAPE_CHARACTER, FIELD_SEPARATOR, FS, REPETITION_SEPARATOR, SUBCOMPONENT_SEPARATOR, VT, } from './constants.js';
5
+ import { COMPONENT_SEPARATOR, CR, ESCAPE_CHARACTER, FIELD_SEPARATOR, FS, LF, REPETITION_SEPARATOR, SUBCOMPONENT_SEPARATOR, VT, } from './constants.js';
6
6
  import { HL7Error } from './hl7-error.js';
7
7
  import { HL7Segment } from './hl7-segment.js';
8
8
  export class HL7Message {
@@ -92,7 +92,7 @@ export class HL7Message {
92
92
  this.repetitionSeparator = raw.repetitionSeparator;
93
93
  this.escapeCharacter = raw.escapeCharacter;
94
94
  this.subComponentSeparator = raw.subComponentSeparator;
95
- const lines = raw.data.split(CR);
95
+ const lines = raw.data.replaceAll(CR + LF, CR).split(CR);
96
96
  const headerItems = raw.header.split(this.fieldSeparator);
97
97
  for (const [i, line] of lines.entries()) {
98
98
  if (!line)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hl7v2",
3
3
  "description": "HL7 v2 parser, serializer, validator for NodeJS",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
@@ -15,7 +15,7 @@
15
15
  "uid": "^2.0.2"
16
16
  },
17
17
  "peerDependencies": {
18
- "hl7v2-dictionary": "^1.2.3"
18
+ "hl7v2-dictionary": "^1.2.4"
19
19
  },
20
20
  "type": "module",
21
21
  "exports": {