Package ca.uhn.hl7v2.validation.impl
Class ConformanceProfileRule
java.lang.Object
ca.uhn.hl7v2.validation.impl.RuleSupport<Message>
ca.uhn.hl7v2.validation.impl.AbstractMessageRule
ca.uhn.hl7v2.validation.impl.ConformanceProfileRule
- All Implemented Interfaces:
MessageRule,Rule<Message>,Serializable
A MessageRule that checks conformance to message profiles. Messages can either be tested
against the profiles they declare, or against a pre-defined profile. If you want both,
use two
ConformanceProfileRules.- Version:
- $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:40 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that tests messages against whatever profiles they declare in MSH-21.ConformanceProfileRule(String theProfileID) -
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).voidsetEnableCaching(boolean enableCaching) Methods inherited from class ca.uhn.hl7v2.validation.impl.AbstractMessageRule
testMethods inherited from class ca.uhn.hl7v2.validation.impl.RuleSupport
failed, failed, failed, failed, failedWithValue, getErrorCode, getSeverity, passed, result, result, setDescription, setErrorCode, setSectionReference, setSeverity
-
Constructor Details
-
ConformanceProfileRule
public ConformanceProfileRule()Creates an instance that tests messages against whatever profiles they declare in MSH-21. The ID declared in MSH-21 is evaluated in a way that the corresponding profile file is expected to be BASEDIR/profiles/ID.xml. -
ConformanceProfileRule
- Parameters:
theProfileID- the ID of a constant profile against which to test all messages (instead of the profiles they declare in MSH-21). The ID is evaluated in a way that the corresponding profile file is expected to be BASEDIR/profiles/ID.xml.
-
-
Method Details
-
apply
Description copied from interface:RuleApplies to rule to an object to be checked- Parameters:
msg- object to be checked- Returns:
- an (potentially empty) array of ValidationExceptions
- See Also:
-
getDescription
Description copied from interface:RuleReturns 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.- Specified by:
getDescriptionin interfaceRule<Message>- Overrides:
getDescriptionin classRuleSupport<Message>- Returns:
- rule description
- See Also:
-
getSectionReference
Description copied from interface:RuleReturns 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.- Specified by:
getSectionReferencein interfaceRule<Message>- Overrides:
getSectionReferencein classRuleSupport<Message>- Returns:
- HL7 specification section reference
- See Also:
-
getProfileID
-
setEnableCaching
-