ca.uhn.hl7v2.validation.app
Class ProfileTestApplication

java.lang.Object
  extended by ca.uhn.hl7v2.validation.app.TestApplication
      extended by ca.uhn.hl7v2.validation.app.ProfileTestApplication
All Implemented Interfaces:
Application

public class ProfileTestApplication
extends TestApplication

Tests messages against conformance profiles. A constant profile can be used, or each message can be tested against the profiles that it declares.

Note that profiles are referenced by ID, and that the ca.uhn.hl7v2.conf.store package is used to get the actual profiles.

Author:
Bryan Tripp

Constructor Summary
ProfileTestApplication()
          Creates a new instance of ProfileTestApplication that tests using profiles declared in each message (if any)
ProfileTestApplication(java.lang.String profileID)
          Creates a new instance of ProfileTestApplication.
 
Method Summary
 boolean canProcess(Message in)
          Returns true if this Application wishes to accept the message.
 java.lang.String getProfileID()
           
 HL7Exception[] test(Message in)
          Tests the message against a profile or profiles.
 
Methods inherited from class ca.uhn.hl7v2.validation.app.TestApplication
processMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileTestApplication

public ProfileTestApplication()
Creates a new instance of ProfileTestApplication that tests using profiles declared in each message (if any)


ProfileTestApplication

public ProfileTestApplication(java.lang.String profileID)
Creates a new instance of ProfileTestApplication.

Parameters:
profileID - the ID of the profile against which to test messages; null means use profiles declared in the message (if any)
Method Detail

canProcess

public boolean canProcess(Message in)
Returns true if this Application wishes to accept the message. By returning true, this Application declares itself the recipient of the message, accepts responsibility for it, and must be able to respond appropriately to the sending system.

Specified by:
canProcess in interface Application
Specified by:
canProcess in class TestApplication

test

public HL7Exception[] test(Message in)
                    throws HL7Exception
Tests the message against a profile or profiles. A constant profile is used if one was provided to the constructor, otherwise any profiles declared in the message are used.

Specified by:
test in class TestApplication
Returns:
exceptions that describe any identified problems with the message
Throws:
HL7Exception - if the message can't be tested (not for errors disovered during testing)

getProfileID

public java.lang.String getProfileID()


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