Skip to main content
Version: v0.0.3

Function: missingExpectedGroup()

missingExpectedGroup(position, messageType, groupName, anchorSegments): Hl7ParseWarning

Build a MISSING_EXPECTED_GROUP warning. Emitted once per absent Required segment group when the message's (MSH-9.1, MSH-9.2) type is one the structure safety net recognizes and an expected group is entirely missing: e.g. an ORU^R01 carrying no OBR/OBX result group, the signature of a truncated or misrouted feed. Tier-2 and additive: lenient parse never throws on it, strict mode may promote it. The message carries only the structural fact (message type, group name, anchor segment names), NEVER a field value, so no PHI is exposed. position references MSH-9.

Parameters

position

Hl7Position

messageType

string

groupName

string

anchorSegments

readonly string[]

Returns

Hl7ParseWarning

Example

import { missingExpectedGroup } from "@cosyte/hl7";
const w = missingExpectedGroup(
{ segmentIndex: 0, fieldIndex: 9 },
"ORU^R01",
"result",
["OBR", "OBX"],
);