@cosyte/hl7 0.1.0 → 0.1.2

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.d.cts CHANGED
@@ -496,12 +496,14 @@ declare function unterminatedStreamMessage(position: Hl7Position): Hl7ParseWarni
496
496
  */
497
497
 
498
498
  /**
499
- * Positional context attached to every warning and fatal error. Fields are
500
- * 1-indexed against the HL7 spec convention (see `RawSegment.fields` for the
501
- * index 0 slot convention). All fields past `segmentIndex` are optional,
502
- * for a top-level fatal like `EMPTY_INPUT` only `segmentIndex: 0` is
503
- * populated; for a tokenizer warning deep inside a subcomponent all five
504
- * indices may be set.
499
+ * Positional context attached to every warning and fatal error.
500
+ * `segmentIndex` counts segments from 0, so a parsed message's MSH segment is
501
+ * 0. The other fields are 1-indexed against the HL7 spec convention:
502
+ * `fieldIndex: 3` on MSH is MSH-3 and `repetitionIndex: 1` is the first
503
+ * repetition (see `RawSegment.fields` for the index 0 slot convention). All
504
+ * fields past `segmentIndex` are optional: for a top-level fatal like
505
+ * `EMPTY_INPUT` only `segmentIndex: 0` is populated; for a tokenizer warning
506
+ * deep inside a subcomponent all five indices may be set.
505
507
  *
506
508
  * @remarks
507
509
  * With `exactOptionalPropertyTypes: true`, do not pass `fieldIndex: undefined`
@@ -1445,7 +1447,7 @@ declare function parsePl(rep: RawRepetition, enc: EncodingCharacters): PL;
1445
1447
  * Usage examples (the literal OBX-5 string ⇒ what this parses):
1446
1448
  * `>^100` ⇒ greater-than 100 → { comparator: ">", num1: 100 }
1447
1449
  * `<^10` ⇒ less-than 10 → { comparator: "<", num1: 10 }
1448
- * `^100^-^200` ⇒ range 100–200 → { num1: 100, separatorOrSuffix: "-", num2: 200 }
1450
+ * `^100^-^200` ⇒ range 100 to 200 → { num1: 100, separatorOrSuffix: "-", num2: 200 }
1449
1451
  * `^1^:^128` ⇒ titer/ratio 1:128 → { num1: 1, separatorOrSuffix: ":", num2: 128 }
1450
1452
  *
1451
1453
  * Safety: `num1`/`num2` are parsed with the same strict `Number()` discipline
@@ -1599,7 +1601,7 @@ type DtmPrecision = "year" | "month" | "day" | "hour" | "minute" | "second" | "f
1599
1601
  * shape of the `TS` composite (`field.asTs()`) and every helper datetime.
1600
1602
  *
1601
1603
  * The parts are only populated when `valid` is `true`. `month`/`day`/… are
1602
- * **spec-native** (`month` is 1–12, NOT the JS `Date` 0–11). `offsetMinutes`
1604
+ * **spec-native** (`month` is 1 to 12, NOT the JS `Date` 0 to 11). `offsetMinutes`
1603
1605
  * is present iff `hasTimezone` is `true` and is signed minutes east of UTC
1604
1606
  * (`+0500` → `300`, `-0430` → `-270`). A missing offset is **flagged**
1605
1607
  * (`hasTimezone: false`), never resolved to UTC: the consumer decides how to
@@ -1628,15 +1630,15 @@ interface DtmParts {
1628
1630
  readonly precision?: DtmPrecision;
1629
1631
  /** Four-digit year. */
1630
1632
  readonly year?: number;
1631
- /** Month, 1–12 (spec-native, NOT JS 0–11). */
1633
+ /** Month, 1 to 12 (spec-native, NOT JS 0 to 11). */
1632
1634
  readonly month?: number;
1633
- /** Day of month, 1–31. */
1635
+ /** Day of month, 1 to 31. */
1634
1636
  readonly day?: number;
1635
- /** Hour, 0–23. */
1637
+ /** Hour, 0 to 23. */
1636
1638
  readonly hour?: number;
1637
- /** Minute, 0–59. */
1639
+ /** Minute, 0 to 59. */
1638
1640
  readonly minute?: number;
1639
- /** Second, 0–59. */
1641
+ /** Second, 0 to 59. */
1640
1642
  readonly second?: number;
1641
1643
  /**
1642
1644
  * Fractional-second digits exactly as populated (no leading dot), e.g.
@@ -6156,7 +6158,7 @@ interface ProfiledMessage<P> extends Hl7Message {
6156
6158
 
6157
6159
  /**
6158
6160
  * Public entry point for the `@cosyte/hl7` parser: composes every
6159
- * parser stage built across Plans 01–05 (normalize, strip MLLP, split
6161
+ * parser stage built across Plans 01 to 05 (normalize, strip MLLP, split
6160
6162
  * segments, read delimiters, tokenize) and routes every Tier-2 warning
6161
6163
  * through a single `emitWarning` chokepoint. The four Tier-3 fatal codes
6162
6164
  * (`EMPTY_INPUT`, `NO_MSH_SEGMENT`, `MSH_TOO_SHORT`,
@@ -8723,7 +8725,7 @@ declare function supportsBuilderMessage(messageCode: string, triggerEvent: strin
8723
8725
  * - **Table 0357** Message error condition codes: https://terminology.hl7.org/CodeSystem-v2-0357.html
8724
8726
  * - **Table 0516** Error severity: HL7 v2 Chapter 2 §2.14.5 (ERR-4)
8725
8727
  * - **Table 0155** Accept/application acknowledgment conditions (MSH-15/16),
8726
- * HL7 v2 Chapter 2 §2.14.9.15–16
8728
+ * HL7 v2 Chapter 2 §2.14.9.15 to 16
8727
8729
  *
8728
8730
  * Zero runtime deps.
8729
8731
  */
@@ -8861,7 +8863,7 @@ type AckMode = "original" | "enhanced";
8861
8863
  * inbound message that carries no MSH-10 correlation id.
8862
8864
  *
8863
8865
  * Spec traceability: HL7 v2 Chapter 2 §2.9 (ack model), §2.14.8 (MSA),
8864
- * §2.14.5 (ERR), §2.14.9.15–16 (MSH-15/16). Tables 0008 / 0357 / 0516 / 0155
8866
+ * §2.14.5 (ERR), §2.14.9.15 to 16 (MSH-15/16). Tables 0008 / 0357 / 0516 / 0155
8865
8867
  * live in `ack-tables.ts`.
8866
8868
  *
8867
8869
  * Zero runtime deps.
@@ -9530,7 +9532,7 @@ declare const meditech: DefinedProfile<{
9530
9532
  * - **`ZAV`**: Visit Filler: visit **additional details** (base64 XML).
9531
9533
  *
9532
9534
  * Grounded in the public **Vue PACS 12.2.8 HL7 Interface Specifications**
9533
- * (Philips, document HA1669 Rev A), §§5.11–5.16: a publicly downloadable
9535
+ * (Philips, document HA1669 Rev A), §§5.11 to 5.16: a publicly downloadable
9534
9536
  * vendor interface spec, not an invented quirk. The spec's
9535
9537
  * `TS` timestamps are the HL7-native `YYYYMMDDHHMMSS` form (§2.6), so this
9536
9538
  * profile declares **no** custom `dateFormats`: only the Z-segments.
@@ -9716,7 +9718,7 @@ declare const va: DefinedProfile<{
9716
9718
  * order with the DICOM study: the classic RIS/PACS ↔ HL7 bridge segment
9717
9719
  * defined by the IHE Radiology Technical Framework. BIP-07.
9718
9720
  *
9719
- * Grounded in the public **Visage 7 – HL7 Interface Specification**
9721
+ * Grounded in the public **Visage 7: HL7 Interface Specification**
9720
9722
  * (V23.00, Jun 2026, Visage Imaging GmbH), §4.4 "ORM Messages" + the ZDS
9721
9723
  * segment table ("Study Instance UID … contained in the first component of
9722
9724
  * the first field of the ZDS Segment"): a publicly downloadable vendor
package/dist/index.d.ts CHANGED
@@ -496,12 +496,14 @@ declare function unterminatedStreamMessage(position: Hl7Position): Hl7ParseWarni
496
496
  */
497
497
 
498
498
  /**
499
- * Positional context attached to every warning and fatal error. Fields are
500
- * 1-indexed against the HL7 spec convention (see `RawSegment.fields` for the
501
- * index 0 slot convention). All fields past `segmentIndex` are optional,
502
- * for a top-level fatal like `EMPTY_INPUT` only `segmentIndex: 0` is
503
- * populated; for a tokenizer warning deep inside a subcomponent all five
504
- * indices may be set.
499
+ * Positional context attached to every warning and fatal error.
500
+ * `segmentIndex` counts segments from 0, so a parsed message's MSH segment is
501
+ * 0. The other fields are 1-indexed against the HL7 spec convention:
502
+ * `fieldIndex: 3` on MSH is MSH-3 and `repetitionIndex: 1` is the first
503
+ * repetition (see `RawSegment.fields` for the index 0 slot convention). All
504
+ * fields past `segmentIndex` are optional: for a top-level fatal like
505
+ * `EMPTY_INPUT` only `segmentIndex: 0` is populated; for a tokenizer warning
506
+ * deep inside a subcomponent all five indices may be set.
505
507
  *
506
508
  * @remarks
507
509
  * With `exactOptionalPropertyTypes: true`, do not pass `fieldIndex: undefined`
@@ -1445,7 +1447,7 @@ declare function parsePl(rep: RawRepetition, enc: EncodingCharacters): PL;
1445
1447
  * Usage examples (the literal OBX-5 string ⇒ what this parses):
1446
1448
  * `>^100` ⇒ greater-than 100 → { comparator: ">", num1: 100 }
1447
1449
  * `<^10` ⇒ less-than 10 → { comparator: "<", num1: 10 }
1448
- * `^100^-^200` ⇒ range 100–200 → { num1: 100, separatorOrSuffix: "-", num2: 200 }
1450
+ * `^100^-^200` ⇒ range 100 to 200 → { num1: 100, separatorOrSuffix: "-", num2: 200 }
1449
1451
  * `^1^:^128` ⇒ titer/ratio 1:128 → { num1: 1, separatorOrSuffix: ":", num2: 128 }
1450
1452
  *
1451
1453
  * Safety: `num1`/`num2` are parsed with the same strict `Number()` discipline
@@ -1599,7 +1601,7 @@ type DtmPrecision = "year" | "month" | "day" | "hour" | "minute" | "second" | "f
1599
1601
  * shape of the `TS` composite (`field.asTs()`) and every helper datetime.
1600
1602
  *
1601
1603
  * The parts are only populated when `valid` is `true`. `month`/`day`/… are
1602
- * **spec-native** (`month` is 1–12, NOT the JS `Date` 0–11). `offsetMinutes`
1604
+ * **spec-native** (`month` is 1 to 12, NOT the JS `Date` 0 to 11). `offsetMinutes`
1603
1605
  * is present iff `hasTimezone` is `true` and is signed minutes east of UTC
1604
1606
  * (`+0500` → `300`, `-0430` → `-270`). A missing offset is **flagged**
1605
1607
  * (`hasTimezone: false`), never resolved to UTC: the consumer decides how to
@@ -1628,15 +1630,15 @@ interface DtmParts {
1628
1630
  readonly precision?: DtmPrecision;
1629
1631
  /** Four-digit year. */
1630
1632
  readonly year?: number;
1631
- /** Month, 1–12 (spec-native, NOT JS 0–11). */
1633
+ /** Month, 1 to 12 (spec-native, NOT JS 0 to 11). */
1632
1634
  readonly month?: number;
1633
- /** Day of month, 1–31. */
1635
+ /** Day of month, 1 to 31. */
1634
1636
  readonly day?: number;
1635
- /** Hour, 0–23. */
1637
+ /** Hour, 0 to 23. */
1636
1638
  readonly hour?: number;
1637
- /** Minute, 0–59. */
1639
+ /** Minute, 0 to 59. */
1638
1640
  readonly minute?: number;
1639
- /** Second, 0–59. */
1641
+ /** Second, 0 to 59. */
1640
1642
  readonly second?: number;
1641
1643
  /**
1642
1644
  * Fractional-second digits exactly as populated (no leading dot), e.g.
@@ -6156,7 +6158,7 @@ interface ProfiledMessage<P> extends Hl7Message {
6156
6158
 
6157
6159
  /**
6158
6160
  * Public entry point for the `@cosyte/hl7` parser: composes every
6159
- * parser stage built across Plans 01–05 (normalize, strip MLLP, split
6161
+ * parser stage built across Plans 01 to 05 (normalize, strip MLLP, split
6160
6162
  * segments, read delimiters, tokenize) and routes every Tier-2 warning
6161
6163
  * through a single `emitWarning` chokepoint. The four Tier-3 fatal codes
6162
6164
  * (`EMPTY_INPUT`, `NO_MSH_SEGMENT`, `MSH_TOO_SHORT`,
@@ -8723,7 +8725,7 @@ declare function supportsBuilderMessage(messageCode: string, triggerEvent: strin
8723
8725
  * - **Table 0357** Message error condition codes: https://terminology.hl7.org/CodeSystem-v2-0357.html
8724
8726
  * - **Table 0516** Error severity: HL7 v2 Chapter 2 §2.14.5 (ERR-4)
8725
8727
  * - **Table 0155** Accept/application acknowledgment conditions (MSH-15/16),
8726
- * HL7 v2 Chapter 2 §2.14.9.15–16
8728
+ * HL7 v2 Chapter 2 §2.14.9.15 to 16
8727
8729
  *
8728
8730
  * Zero runtime deps.
8729
8731
  */
@@ -8861,7 +8863,7 @@ type AckMode = "original" | "enhanced";
8861
8863
  * inbound message that carries no MSH-10 correlation id.
8862
8864
  *
8863
8865
  * Spec traceability: HL7 v2 Chapter 2 §2.9 (ack model), §2.14.8 (MSA),
8864
- * §2.14.5 (ERR), §2.14.9.15–16 (MSH-15/16). Tables 0008 / 0357 / 0516 / 0155
8866
+ * §2.14.5 (ERR), §2.14.9.15 to 16 (MSH-15/16). Tables 0008 / 0357 / 0516 / 0155
8865
8867
  * live in `ack-tables.ts`.
8866
8868
  *
8867
8869
  * Zero runtime deps.
@@ -9530,7 +9532,7 @@ declare const meditech: DefinedProfile<{
9530
9532
  * - **`ZAV`**: Visit Filler: visit **additional details** (base64 XML).
9531
9533
  *
9532
9534
  * Grounded in the public **Vue PACS 12.2.8 HL7 Interface Specifications**
9533
- * (Philips, document HA1669 Rev A), §§5.11–5.16: a publicly downloadable
9535
+ * (Philips, document HA1669 Rev A), §§5.11 to 5.16: a publicly downloadable
9534
9536
  * vendor interface spec, not an invented quirk. The spec's
9535
9537
  * `TS` timestamps are the HL7-native `YYYYMMDDHHMMSS` form (§2.6), so this
9536
9538
  * profile declares **no** custom `dateFormats`: only the Z-segments.
@@ -9716,7 +9718,7 @@ declare const va: DefinedProfile<{
9716
9718
  * order with the DICOM study: the classic RIS/PACS ↔ HL7 bridge segment
9717
9719
  * defined by the IHE Radiology Technical Framework. BIP-07.
9718
9720
  *
9719
- * Grounded in the public **Visage 7 – HL7 Interface Specification**
9721
+ * Grounded in the public **Visage 7: HL7 Interface Specification**
9720
9722
  * (V23.00, Jun 2026, Visage Imaging GmbH), §4.4 "ORM Messages" + the ZDS
9721
9723
  * segment table ("Study Instance UID … contained in the first component of
9722
9724
  * the first field of the ZDS Segment"): a publicly downloadable vendor
package/dist/index.mjs CHANGED
@@ -101,7 +101,7 @@ function readDelimiters(firstSegment) {
101
101
  if (chars.length !== 4 && chars.length !== 5) {
102
102
  throw new Hl7ParseError(
103
103
  FATAL_CODES.INVALID_ENCODING_CHARACTERS,
104
- `MSH-2 encoding characters must be 4 (v2.1\u2013v2.6) or 5 (v2.7+ adds truncation) characters (got ${String(chars.length)}).`,
104
+ `MSH-2 encoding characters must be 4 (v2.1 to v2.6) or 5 (v2.7+ adds truncation) characters (got ${String(chars.length)}).`,
105
105
  fatalPosition,
106
106
  snip
107
107
  );
@@ -14899,7 +14899,7 @@ async function* parseStream(source, optionsOrProfile) {
14899
14899
  }
14900
14900
 
14901
14901
  // src/index.ts
14902
- var VERSION = "0.1.0";
14902
+ var VERSION = "0.1.2";
14903
14903
 
14904
14904
  export { ACK_CODES, ACK_CONDITIONS, AMBIGUOUS_DATE_ORDER, BUILTIN_DATE_FALLBACKS, DEFAULT_ENCODING_CHARACTERS, ERR_CONDITION_CODES, ERR_CONDITION_CODE_SYSTEM, ERR_SEVERITIES, FATAL_CODES, FINDING_CODES, Field, namespace_exports as HL7, Hl7Message, Hl7ParseError, JSON_SCHEMA_DIALECT, KNOWN_CODING_SYSTEMS, KNOWN_SEGMENTS, MESSAGE_STRUCTURE_DEFINITIONS, PREDICATE_CONNECTORS, PREDICATE_VERBS, PROFILE_LEVELS, ProfileDefinitionError, SCHEMA_EMIT_TARGETS, STRUCTURE_FINDING_CODES, STRUCTURE_NOT_VALIDATED_REASONS, STRUCTURE_REGISTRY_PROVENANCE, SUPPORTED_BUILDER_MESSAGES, SUPPORTED_DATE_TOKENS, SUPPORTED_OVERLAY_MESSAGES, SchemaTargetError, Segment, TYPED_BUILDER_COVERAGE, USAGE_CODES, VERSION, WARNING_CODES, ackNoCorrelationId, alternateCodingSystemOf, analyzeMessageStructure, batchCountMismatch, batchMissingTrailer, buildAck, buildAdt, buildDft, buildMdm, buildMessage, buildOrm, buildOru, buildSiu, buildVxu, canonicalCharset, codingSystem, codingSystemOf, conformance_exports as conformance, decodeText, defineConformanceProfile, defineProfile, detectAckMode, downgradePositiveAck, dtmToDate, duplicateRequiredSegment, emitMessageSchema, encodeCe, encodeComposite, encodeCompositeReps, encodeCwe, encodeCx, encodeHd, encodeNm, encodePl, encodeText, encodeTs, encodeXad, encodeXcn, encodeXpn, encodeXtn, encodingMismatch, extraFields, fieldWhitespaceTrimmed, findMessageStructureDefinition, formatDtm, getDefaultProfile, interpretAck, isPositiveAck, isSchemaEmitTarget, mergeMissingPriorOrSurvivor, messageJsonSchema, messageZodSource, missingExpectedGroup, missingRequiredField, missingRequiredSegment, mllpFramingStripped, outOfOrderSegment, parseCe, parseCwe, parseCx, parseDtm, parseHL7, parseHd, parseNm, parsePath, parsePl, parseSn, parseStream, parseTs, parseXad, parseXcn, parseXpn, parseXtn, pickMrn, profiles, reescape, renderText, resolveCharset, resolvePath, segmentCase, setDefaultProfile, splitBatch, supportsBuilderMessage, text_exports as text, timestampFallbackFormat, toDate, toISO, toObject, unescape, unknownCharset, unknownEscapeSequence, unknownSegment, unsupportedCharset, unterminatedEscapeSequence, unterminatedStreamMessage, usageOutcomes, validateAgainstProfile, validateMessageStructure, versionMismatch };
14905
14905
  //# sourceMappingURL=index.mjs.map