FHIR Profiling: FHIRPath Constraints

Ivan Bagrov
April 11, 2025
3 min

FHIRPath Constraints

Constraint - a validation rule that is defined on a profile and described using the FHIRPath syntax.

Constraints allow for describing more complex data requirements.

Example of a profile with a constraint:

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 this example, a profile with a constraint is described that checks whether the patient must have either a name or an address specified.

Constraints can be specified for the entire resource and for specific complex and primitive types.

Aidbox FHIR server supports the entire FHIRPath syntax.

How did you like the article?
Be the first to know!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

contact us

Get in touch with us today!

By submitting the form you agree to Privacy Policy and Cookie Policy.
Thank you!
We’ll be in touch soon.

In the meantime, you can:
Oops! Something went wrong while submitting the form.

Never miss a thing
Subscribe for more content!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
By clicking “Subscribe” you agree to Health Samurai Privacy Policy and consent to Health Samurai using your contact data for newsletter purposes