Package ca.uhn.hl7v2.validation
Interface Rule<T>
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CompositeTypeRule,EncodingRule,MessageRule,PredicateRuleSupport<T>,PrimitiveTypeRule
- All Known Implementing Classes:
AbstractEncodingRule,AbstractMessageRule,AbstractPrimitiveTypeRule,ChoiceElementsRespectedRule,ConformanceProfileRule,OnlyAllowableSegmentsInSuperstructureRule,OnlyKnownSegmentsRule,PredicateMessageRule,PredicatePrimitiveTypeRule,RegexPrimitiveRule,RuleSupport,SizeRule,TerserMessageRule,TrimLeadingWhitespace,TrimTrailingWhitespace,VisitorMessageRule,WithdrawnDatatypeRule,WrongVersionRule,XMLSchemaRule
A testable rule to which HL7 messages (at least certain specific message) should conform.
There are three kinds of rules:
- PrimitiveTypeRule: Called when the values of simple datatypes are set, like the existing hard-coded datatype validations (e.g. TNFollowsNorthAmericanFormat).
- MessageRule: Called when complete message content is to be checked on a parsed message (e.g. conformance profile).
- EncodingRule: Applied to an encoded message (e.g. validation against a .xml Schema, a rule that prohibits empty tags, etc.).
- Author:
- Bryan Tripp
-
Method Summary
Modifier and TypeMethodDescriptionApplies to rule to an object to be checkedReturns a text description of the rule.Returns a string indicating the section of the HL7 standard from which this rule is derived (if applicable).
-
Method Details
-
getDescription
Returns a text description of the rule. This description may be used as a message in exceptions generated if validation against the rule fails, or in a user interface for rule configuration.- Returns:
- rule description
-
getSectionReference
Returns a string indicating the section of the HL7 standard from which this rule is derived (if applicable). Like the description, this may be used in an exception message or configuration UI.- Returns:
- HL7 specification section reference
-
apply
Applies to rule to an object to be checked- Parameters:
value- object to be checked- Returns:
- an (potentially empty) array of ValidationExceptions
-