Interface: FieldRule
A rule for one field position within a segment. Every
constraint is optional; a rule with only a field index is a no-op.
Remarks
field is the 1-indexed HL7 position (MSH offset handled internally, exactly
like Segment.field(n): { field: 9 } on MSH targets MSH-9). Length and
value-set checks read the value at component (default 1), so a coded
field's code (CWE.1 / CE.1) is checked by default; set component to
check a different component. Both are applied per present repetition.
Properties
cardinality?
readonlyoptionalcardinality?:Cardinality
Repetition-count constraint for this field.
component?
readonlyoptionalcomponent?:number
1-indexed component whose value the length / valueSet checks read.
Defaults to 1 (the first component: a coded element's code).
field
readonlyfield:number
1-indexed HL7 field position (e.g. 3 for PID-3, 9 for MSH-9).
length?
readonlyoptionallength?:number
Maximum character length of the checked component value (inclusive).
name?
readonlyoptionalname?:string
Optional human label for the field (e.g. "Patient Identifier List").
Structural documentation for the profile author only: findings identify a
field by its PHI-free structural locus (segment + index), never by this
label, so the label is never echoed into a finding message.
severity?
readonlyoptionalseverity?:FindingSeverity
Severity for findings this rule produces. Defaults to "error". A profile
author can downgrade a data-quality rule (e.g. a length or value-set check)
to "warning" or "info" without changing the check itself.
usage?
readonlyoptionalusage?:UsageCode
Usage constraint (see UsageCode). Omitted ⇒ Optional.
valueSet?
readonlyoptionalvalueSet?: readonlystring[]
Consumer-supplied permitted-value list. The checked component value must be a member (case-sensitive exact match). hl7 ships no code set: this is BYO terminology; membership is a literal string check, never a LOINC / SNOMED / ICD / RxNorm lookup and never a network call.