Annotation Type Constraint
-
@Repeatable(Constraints.class) @Target(TYPE) @Retention(RUNTIME) public @interface Constraint
An annotation interface that represents a formal constraint (invariant)Constraints can be computationally evaluated using a FHIRPath engine or an instance of
ConstraintValidator
.
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.String
LEVEL_RULE
static java.lang.String
LEVEL_WARNING
static java.lang.String
LOCATION_BASE
static java.lang.String
SOURCE_UNKNOWN
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String
description
A description used in messages identifying that the constraint has been violatedjava.lang.String
expression
A FHIRPath expression that must evaluate to true when run on the validation targetElement
orResource
java.lang.String
id
Identifies the constraint uniquely amongst all the constraints in the contextjava.lang.String
level
The severity of the constraintjava.lang.String
location
The location (path) of the validation targetElement
orResource
java.lang.String
source
The original source of the constraint
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
generated
Indicates whether the constraint was generatedboolean
modelChecked
Indicates whether the constraint is checked in the modeljava.lang.Class<? extends ConstraintValidator<?>>
validatorClass
TheConstraintValidator
class used to validate this constraint
-
-
-
Element Detail
-
id
java.lang.String id
Identifies the constraint uniquely amongst all the constraints in the context- Returns:
- the id
- See Also:
ElementDefinition.Constraint.getKey()
-
-
-
level
java.lang.String level
The severity of the constraint- Returns:
- the level
- See Also:
ElementDefinition.Constraint.getSeverity()
-
-
-
location
java.lang.String location
The location (path) of the validation targetElement
orResource
- Returns:
- the location
- See Also:
ElementDefinition.getPath()
-
-
-
description
java.lang.String description
A description used in messages identifying that the constraint has been violated- Returns:
- the description
- See Also:
ElementDefinition.Constraint.getHuman()
-
-
-
expression
java.lang.String expression
A FHIRPath expression that must evaluate to true when run on the validation targetElement
orResource
- Returns:
- the expression
- See Also:
ElementDefinition.Constraint.getExpression()
-
-
-
source
java.lang.String source
The original source of the constraint- Returns:
- the source
- See Also:
ElementDefinition.Constraint.getSource()
-
-
-
validatorClass
java.lang.Class<? extends ConstraintValidator<?>> validatorClass
TheConstraintValidator
class used to validate this constraint- Returns:
- the
ConstraintValidator
class used to validate this constraint
- Default:
- org.linuxforhealth.fhir.model.annotation.Constraint.FHIRPathConstraintValidator.class
-
-