ca.uhn.hl7v2.validation
Class MessageValidator
java.lang.Object
ca.uhn.hl7v2.validation.MessageValidator
public class MessageValidator
- extends java.lang.Object
Validation utilities for parsed and encoded messages.
- Author:
- Bryan Tripp
Method Summary |
boolean |
validate(Message message)
|
boolean |
validate(java.lang.String message,
boolean isXML,
java.lang.String version)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageValidator
public MessageValidator(ValidationContext theContext,
boolean theFailOnErrorFlag)
- Parameters:
theContext
- context that determines which validation rules applytheFailOnErrorFlag
-
validate
public boolean validate(Message message)
throws HL7Exception
- Parameters:
message
- a parsed message to validate (note that MSH-9-1 and MSH-9-2 must be valued)
- Returns:
- true if the message is OK
- Throws:
HL7Exception
- if there is at least one error and this validator is set to fail on errors
validate
public boolean validate(java.lang.String message,
boolean isXML,
java.lang.String version)
throws HL7Exception
- Parameters:
message
- an ER7 or XML encoded message to validateisXML
- true if XML, false if ER7version
- HL7 version (e.g. "2.2") to which the message belongs
- Returns:
- true if the message is OK
- Throws:
HL7Exception
- if there is at least one error and this validator is set to fail on errors
Copyright © 2001-2011 University Health Network. All Rights Reserved.