import { Optionality } from "@glion/utils"; import type { ProfileStore } from "../profiles"; /** Raw shape exported by generated field modules. */ export type FieldModule = Readonly<{ segmentId: string; fields: readonly FieldProfile[]; }>; /** * HL7v2 repetition of a field, the RP/# column of a segment attribute table: * the most occurrences the field may have, or `"unbounded"`. */ export type FieldRepetitions = number | "unbounded"; /** A field of a segment, one row of its HL7v2 segment attribute table. */ export type FieldProfile = Readonly<{ sequence: number; id: string; /** Absent when the standard records no optionality for the field. */ optionality?: Optionality; /** `1` when the field does not repeat. */ repetitions: FieldRepetitions; /** Absent on a withdrawn field the standard gives no datatype. */ datatype?: string; maxLength?: number; table?: string; name?: string; item?: string; }>; /** * Compiled field definition for a segment. * Returned by `profiles.fields.load()`. */ export type FieldDefinition = Readonly<{ segmentId: string; /** O(1) lookup of field profile by sequence number. */ bySequence: ReadonlyMap; /** The sequences of the fields whose optionality is `R`. */ requiredSequences: ReadonlySet; }>; /** The loader of segment field profiles. */ export declare const fields: ProfileStore; //# sourceMappingURL=fields.d.ts.map