Function: get834Enrollments()
get834Enrollments(
delimiters,tx):AsyncIterable<X12Enrollment>
Stream the 834 member-level detail loops - one X12Enrollment per
INS segment. For a non-834 transaction the iterable yields nothing.
Async-generator typed so the contract leaves room for a future
file→iterator streaming source; the v1 implementation iterates the
already-parsed tx.segments synchronously under the hood.
Parameters
delimiters
tx
Returns
AsyncIterable<X12Enrollment>
Example
import { parseX12, get834Enrollments } from "@cosyte/x12";
const ix = parseX12(raw);
const tx = ix.groups[0]?.transactions.find((t) => t.st.elements[1] === "834");
if (tx !== undefined) {
for await (const member of get834Enrollments(ix.delimiters, tx)) {
member.maintenanceTypeCode; // "021"
member.member?.idCode; // verbatim member id
}
}