ca.uhn.hl7v2.validation.impl
Class ConformanceProfileRule

java.lang.Object
  extended by ca.uhn.hl7v2.validation.impl.ConformanceProfileRule
All Implemented Interfaces:
MessageRule, Rule, java.io.Serializable

public class ConformanceProfileRule
extends java.lang.Object
implements MessageRule

A MessageRule that checks conformance to message profiles. Messges can either be tested agaist 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:
Serialized Form

Constructor Summary
ConformanceProfileRule()
          Creates an instance that tests messages against whatever profiles they declare in MSH-21.
ConformanceProfileRule(java.lang.String theProfileID)
           
 
Method Summary
 java.lang.String getDescription()
          Returns a text description of the rule.
 java.lang.String getSectionReference()
          A string indicating the section of the HL7 standard from which this rule is derived (if applicable).
 ValidationException[] test(Message msg)
          Tests the given (fully populated) message against the criteria defined by this rule class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConformanceProfileRule

public ConformanceProfileRule()
Creates an instance that tests messages against whatever profiles they declare in MSH-21.


ConformanceProfileRule

public ConformanceProfileRule(java.lang.String theProfileID)
Parameters:
theProfileID - the ID of a constant profile against which to test all messages (instead of the profiles they declare in MSH-21)
Method Detail

test

public ValidationException[] test(Message msg)
Description copied from interface: MessageRule
Tests the given (fully populated) message against the criteria defined by this rule class.

Specified by:
test in interface MessageRule
Returns:
a list of exceptions indicating points at which the given message failed to validate (empty if validation succeeds; may not be a complete list as testing may be aborted after failure). The list should be empty if this rule is evaluated against a type of message to which it doesn't apply.
See Also:
MessageRule.test(ca.uhn.hl7v2.model.Message)

getDescription

public java.lang.String getDescription()
Description copied from interface: Rule
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.

Specified by:
getDescription in interface Rule
See Also:
Rule.getDescription()

getSectionReference

public java.lang.String getSectionReference()
Description copied from interface: Rule
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:
getSectionReference in interface Rule
See Also:
Rule.getSectionReference()


Copyright © 2001-2011 University Health Network. All Rights Reserved.