gov.nist.hl7.ws.messagevalidation
Interface Hl7MessageValidationInterface


public interface Hl7MessageValidationInterface

NIST HL7 V2 Message Validation Web Service

This service provides an interface for validating HL7 version 2 (V2) message instances against a message profile and a validation context. The interface is designed for use in a web-service environment. The method are intended to be simple and in many cases atomic calls. Parameters and return values are intentionally made to be simple objects. This provides for a flexible interface for building a user specific interface.

This service supports validation for HL7 Version 2.3.1, 2.4, 2.5, and 2.5.1. The version that is used for validation is indicated in the message profile.

Author:
Robert Snelick (NIST)

Method Summary
 java.lang.String getLastExceptionMessage()
          Get the message of the last exception caught.
 boolean getServiceStatus()
          Get the status of the service.
 java.lang.String getValidationReport()
          Get a detailed report of the message validation results in an XML document.
 boolean loadMessage(java.lang.String message)
          Load the message to be validated.
 boolean loadProfile(java.lang.String xmlProfile)
          Load an HL7 version 2 message profile.
 boolean loadResource(java.lang.String xmlResource, java.lang.String resourceType)
          The loadResource method allows a user to load additional resources that can be used in the validation process.
 boolean setValidationContext(java.lang.String xmlValidationContext)
          The validation context describes the circumstances in which the message instance is validated.
 boolean useHandle(java.lang.String oid)
          Use the handle identified by the OID.
 boolean useProfile(java.lang.String oid)
          Use the profile identified by the OID.
 boolean useResource(java.lang.String oid)
          The useResource method allows a user to access a resource that can be used in the validation process.
 boolean validate()
          Perform the message validation.
 

Method Detail

loadMessage

boolean loadMessage(java.lang.String message)
                    throws java.lang.Exception
Load the message to be validated. This is an HL7 V2 message instance. The interface supports the native HL7 V2 ER7 encoding and HL7 V2 XML encoding.

Parameters:
message - an HL7 V2 ER7 encoded message instance or an HL7 V2 XML encoded message instance

Returns:
true if the message instance is valid with respect to the profile and the validation context; false otherwise.
Throws:
java.lang.Exception

useHandle

boolean useHandle(java.lang.String oid)
                  throws java.lang.Exception
Use the handle identified by the OID. A handle represents a package of resources (e.g., a profile and a table file). The repository is searched using the OID, if the handle is located all of the artifacts linked with handle is used when performing message validation.

Parameters:
oid - referencing a handle
Returns:
true if handle was located in the repository and processed successfully; false otherwise.
Throws:
java.lang.Exception

loadProfile

boolean loadProfile(java.lang.String xmlProfile)
                    throws java.lang.Exception
Load an HL7 version 2 message profile. The profile is an XML document that follows the rules given in the HL7 version 2 profile schema.

Parameters:
xmlProfile - an HL7 version 2 message profile.

Returns:
true if profile was loaded and processed successfully; false otherwise.
Throws:
java.lang.Exception

useProfile

boolean useProfile(java.lang.String oid)
                   throws java.lang.Exception
Use the profile identified by the OID. The repository is searched using the OID, if the profile is located it is use for performing message validation.

Parameters:
oid - referencing an HL7 version message profile.

Returns:
true if profile was located in the repository and processed successfully; false otherwise.
Throws:
java.lang.Exception

loadResource

boolean loadResource(java.lang.String xmlResource,
                     java.lang.String resourceType)
                     throws java.lang.Exception
The loadResource method allows a user to load additional resources that can be used in the validation process. This may be a table that specifies local codes. Each resource type defines the format of the given resource. More than one resource can be associated to a validation process.

TBD-what are the resource types and their formats.

Parameters:
xmlResource - a resource that is used in the validation process.

resourceType - a document that describes the type of the xmlResource; for example, an XML schema.

Returns:
true if the resource has been successfully loaded and processed; false otherwise.
Throws:
java.lang.Exception

useResource

boolean useResource(java.lang.String oid)
                    throws java.lang.Exception
The useResource method allows a user to access a resource that can be used in the validation process. This may be a table that specifies local codes. More than one resource can be associated to a validation process. Resource files are stored in the repository.

TBD-what are the resource types and their formats.

Parameters:
oid - an object identifier to reference the resource

Returns:
true if the resource was located in the repository and processed successfully; false otherwise.
Throws:
java.lang.Exception

setValidationContext

boolean setValidationContext(java.lang.String xmlValidationContext)
                             throws java.lang.Exception
The validation context describes the circumstances in which the message instance is validated. It may reference the profile and resources, it may describe how to interpret flagged items, and it may specify specific tests. The validation context is encoded in an XML document that adheres to the validation context schema. For details of the format see...

Parameters:
xmlValidationContext - the message validation context describes the circumstances the message instance will be validated against.

Returns:
true is the validation context has been successfully loaded and processed; false otherwise.
Throws:
java.lang.Exception

validate

boolean validate()
                 throws java.lang.Exception
Perform the message validation.

Returns:
true if the message is valid with respect to the message profile and the message validation context. The method returns false if the message is not valid with respect to the message profile and message validation context or if an error occurred during the validation process (e.g., a profile was not located).
Throws:
java.lang.Exception

getServiceStatus

boolean getServiceStatus()
                         throws java.lang.Exception
Get the status of the service.

Returns:
true if the service is available; false if the service unavailable (e.g., running but too busy).
Throws:
java.lang.Exception

getValidationReport

java.lang.String getValidationReport()
                                     throws java.lang.Exception
Get a detailed report of the message validation results in an XML document. The results are described in the results schema (see .... for details).

Returns:
an XML document with a detailed of the message validation results.
Throws:
java.lang.Exception

getLastExceptionMessage

java.lang.String getLastExceptionMessage()
                                         throws java.lang.Exception
Get the message of the last exception caught.

Returns:
a description of the last exception.
Throws:
java.lang.Exception