Element Has Too Few or Too Many Entries (Cardinality)
A cardinality constraint sets a minimum and maximum number of repetitions for an element (for example 1..1 or 1..*). The actual count falls outside that range.
FHIR · Error
The error
must have a certain number of entries but has a different countWhy it happens
Omitting a required repeating element (count 0 when minimum is 1), or supplying more entries than the maximum allows on a singular element.
How to fix it
Adjust the number of entries to fall within the min..max range. A 1..1 element must appear exactly once; a 1..* element must appear at least once. Remove extras or add the missing entry.
Example
The snippet below triggers the error:
{
"resourceType": "Patient",
"name": []
}The corrected version:
{
"resourceType": "Patient",
"name": [{ "family": "Doe", "given": ["John"] }]
}Frequently asked questions
What does 1..* mean?
It is FHIR cardinality notation: minimum 1, maximum unbounded. The element must appear at least once and may repeat any number of times. 0..1 means optional and singular; 1..1 means required and singular.
Related
- Open the FHIR Profile Coverage (US Core / IPS)
- All validation errors
- resourceType Is Required
- Unknown FHIR R4 Resource Type
- Required Element Is Missing for This Resource
- gender Must Be male, female, other, or unknown
- birthDate Must Be YYYY, YYYY-MM, or YYYY-MM-DD
- instant Must Include a Timezone
- Resource id Has an Invalid Format
- subject Must Be a Reference Object, Not a String