Package com.ibm.fhir.model.annotation
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 StringLEVEL_RULEstatic StringLEVEL_WARNINGstatic StringLOCATION_BASEstatic StringSOURCE_UNKNOWN
-
Required Element Summary
Required Elements Modifier and Type Required Element Description StringdescriptionA description used in messages identifying that the constraint has been violatedStringexpressionA FHIRPath expression that must evaluate to true when run on the validation targetElementorResourceStringidIdentifies the constraint uniquely amongst all the constraints in the contextStringlevelThe severity of the constraintStringlocationThe location (path) of the validation targetElementorResourceStringsourceThe original source of the constraint
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleangeneratedIndicates whether the constraint was generatedbooleanmodelCheckedIndicates whether the constraint is checked in the modelClass<? extends ConstraintValidator<?>>validatorClassTheConstraintValidatorclass used to validate this constraint
-
-
-
Field Detail
-
LEVEL_RULE
static final String LEVEL_RULE
-
-
-
LEVEL_WARNING
static final String LEVEL_WARNING
-
-
-
LOCATION_BASE
static final String LOCATION_BASE
-
-
-
SOURCE_UNKNOWN
static final String SOURCE_UNKNOWN
-
-
Element Detail
-
id
String id
Identifies the constraint uniquely amongst all the constraints in the context- Returns:
- the id
- See Also:
ElementDefinition.Constraint.getKey()
-
-
-
level
String level
The severity of the constraint- Returns:
- the level
- See Also:
ElementDefinition.Constraint.getSeverity()
-
-
-
location
String location
The location (path) of the validation targetElementorResource- Returns:
- the location
- See Also:
ElementDefinition.getPath()
-
-
-
description
String description
A description used in messages identifying that the constraint has been violated- Returns:
- the description
- See Also:
ElementDefinition.Constraint.getHuman()
-
-
-
expression
String expression
A FHIRPath expression that must evaluate to true when run on the validation targetElementorResource- Returns:
- the expression
- See Also:
ElementDefinition.Constraint.getExpression()
-
-
-
source
String source
The original source of the constraint- Returns:
- the source
- See Also:
ElementDefinition.Constraint.getSource()
-
-
-
validatorClass
Class<? extends ConstraintValidator<?>> validatorClass
TheConstraintValidatorclass used to validate this constraint- Returns:
- the
ConstraintValidatorclass used to validate this constraint
- Default:
- com.ibm.fhir.model.annotation.Constraint.FHIRPathConstraintValidator.class
-
-