---
{
  "title": "FHIR Profiling: FHIRPath-Constraints",
  "description": "Constraint – eine Validierungsregel, die in einem Profil definiert und mithilfe der FHIRPath-Syntax beschrieben wird.",
  "date": "2025-04-11",
  "author": "Ivan Bagrov",
  "reading-time": "3 min",
  "tags": [
    "FHIR Profiling",
    "FHIR Standard"
  ]
}
---
## FHIRPath-Constraints

Constraint – eine Validierungsregel, die in einem Profil definiert und mithilfe der [FHIRPath-Syntax](https://hl7.org/fhirpath/N1/) beschrieben wird.

Constraints ermöglichen die Beschreibung komplexerer Datenanforderungen.

Beispiel eines [Profils](https://www.health-samurai.io/articles/fhir-profiling) mit einem Constraint:


```javascript
resourceType: StructureDefinition
url: http://example.org/fhir/StructureDefinition/patient-profile
name: patient-profile
derivation: constraint
type: Patient
status: active
kind: resource
abstract: false
differential:
  element:
	- id: Patient
  	  path: Patient
  	  constraint: 
           - key: patient-data
             severity: error
             human: Patient's name or address are required
             expression: Patient.name.exists() or Patient.address.exists()
```


In diesem Beispiel wird ein Profil mit einem Constraint beschrieben, das prüft, ob für den Patienten entweder ein Name oder eine Adresse angegeben sein muss.

Constraints können sowohl für die gesamte Ressource als auch für spezifische komplexe und primitive Typen definiert werden.

Der Aidbox [FHIR-Server unterstützt die vollständige FHIRPath-Syntax](https://www.health-samurai.io/aidbox).

Siehe auch: [FHIR Profiling](/blog/fhir-profiling) und [Unlocking FHIRPath Power](/blog/unlocking-fhirpath-power-a-deep-dive-into-static-type-analysis-for-robust-tooling).