Cardinality in HL7 v2
Cardinality says how many times a field may appear: a minimum and a maximum, written here as 0..*. The standard does not print it. It prints optionality in the OPT column and repetition in the RP/# column and leaves the two to be combined. This site does that combining and shows the result, which is why cardinality is the one column on a segment page that HL7 did not publish.
The minimum comes from OPT
| OPT | Meaning | Minimum |
|---|---|---|
| R | Required. The field must be present and populated. | 1 |
| RE | Required but may be empty. Send it if you have it. | 1 |
| O | Optional. The standard states no requirement either way. | 0 |
| C | Conditional on a rule stated in the field notes. | 0 |
| CE | Conditional, and may be empty when the condition holds. | 0 |
| X | Not supported. Do not send it. | 0 |
| B | Kept for backward compatibility only. Do not use in new work. | 0 |
| W | Withdrawn. It no longer carries meaning. | 0 |
| U | Not designated in the source table for this version. | 0 |
The maximum comes from RP/#
| RP/# | Meaning | Maximum |
|---|---|---|
| blank or N | Does not repeat. | 1 |
| Y | Repeats, with no stated limit. | * |
| Y/3 | Repeats, at most three times. | 3 |
| 3 | Repeats, at most three times. | 3 |
Put together
| OPT | RP/# | Cardinality | Reads as |
|---|---|---|---|
| R | blank | 1..1 | exactly once |
| O | blank | 0..1 | never or once |
| R | Y | 1..* | at least once, no upper limit |
| O | Y | 0..* | any number of times, including none |
| O | Y/3 | 0..3 | up to three times |
Where it is less certain
Conditional fields are shown with a minimum of 0. A field marked C is required when its condition holds, and that condition is written out in the field notes rather than given in a column. Showing 0 keeps us from claiming a requirement the table never states. It also means the cardinality on its own will not tell you whether your message is valid.
HL7 publishes XML schemas for v2.5.1. We take the maximum from the schema's maxOccurs rather than the printed RP/# column, because the schema states it exactly. The two agree almost everywhere they overlap.
Cardinality describes the segment definition, not any particular message. A message profile can constrain a field further, and most real interfaces do. A field this site shows as 0..* may be required exactly once by the specification you were handed.