Skip to main content
Version: v0.0.4

Function: duplicateRequiredSegment()

duplicateRequiredSegment(position, segmentName): Hl7ParseWarning

Build a DUPLICATE_REQUIRED_SEGMENT warning. Emitted when a segment the profile marks as singleton appears more than once (e.g. two MSH segments). The parser keeps both; the warning alerts the consumer to potential sender bugs.

Parameters

position

Hl7Position

segmentName

string

Returns

Hl7ParseWarning

Example

import { duplicateRequiredSegment } from "@cosyte/hl7";
const w = duplicateRequiredSegment({ segmentIndex: 1 }, "MSH");