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 String
LEVEL_RULE
static String
LEVEL_WARNING
static String
LOCATION_BASE
static String
SOURCE_UNKNOWN
-
Required Element Summary
Required Elements Modifier and Type Required Element Description String
description
A description used in messages identifying that the constraint has been violatedString
expression
A FHIRPath expression that must evaluate to true when run on the validation targetElement
orResource
String
id
Identifies the constraint uniquely amongst all the constraints in the contextString
level
The severity of the constraintString
location
The location (path) of the validation targetElement
orResource
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 modelClass<? extends ConstraintValidator<?>>
validatorClass
TheConstraintValidator
class 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 targetElement
orResource
- 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 targetElement
orResource
- 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
TheConstraintValidator
class used to validate this constraint- Returns:
- the
ConstraintValidator
class used to validate this constraint
- Default:
- com.ibm.fhir.model.annotation.Constraint.FHIRPathConstraintValidator.class
-
-