Skip to content

Cardinality Rules

Cardinality rules validate that element cardinality constraints are valid and consistent.

Severity: Error Fixable: Yes (safe)

Cardinality must be specified as min..max where min <= max.

Example:

// ✓ Good
Profile: PatientProfile
* name 1..1
* telecom 0..*
// ✗ Bad
Profile: PatientProfile
* name 2..1 // min > max

Severity: Error Fixable: No

Multiple cardinality rules on the same element must be compatible.

Example:

// ✗ Bad - Conflicting cardinality
Profile: PatientProfile
* name 1..1
* name 0..* // Conflicts with previous rule

Severity: Info Fixable: Yes (safe)

Cardinality that matches the parent is redundant.

Example:

// ⚠ Redundant
Profile: PatientProfile
Parent: Patient
* identifier 0..* // Same as base Patient.identifier

Valid cardinality ensures:

  • FHIR validation works correctly
  • Clear data requirements
  • Prevents impossible constraints