Rules File

Rules validation picks up where schema validation leaves off, providing context and content analysis. The content of the document can be examined against assertions, and values can be examined in the light of other values in the document. Services exist to validate content against tables and databases, and exits can be written to perform specialized analysis if needed.

The rules file is an XML document. One file should exist for each document to be validated. The outer tag should be the document name, and under this tag are rule tags which may be enclosed within using tags. For example, for a HIPAA835, the file (very shortened) might look like this:

<HIPAA835>
<using class="XDHipaaRules">
  <rule tag="_835.DTM" method="checkDTM" code="405" cd="R020305,C0203,P0506"/>
  <rule tag="_2100.DTM" method="checkDTM" code="036,050,232,233"/>
</using>
</HIPAA835>

The rules are expressed in an XML document tied into the iWay Service Manager dictionary through <validation> tags, which associate one or more rule sets with the specific document entry. The outer tag of the rules document should be explanatory, describing the type of document, but the actual tag is ignored. The rule document itself is a structure containing specific rule applications.

All attributes of rules must be specified in lowercase.

The following diagram illustrates the document flow and how the rules are applied in that flow.

The document entry is the outer tag of the rules file. The name "document" is arbitrary and can be replaced with any meaningful, XML-legal name.

<document>entry

Attribute

Description

ackagent

Java program class to be called to construct the acknowledgement. This is a standard iWay Service Manager business process agent. For details on standard iWay Service Managaer business process agents, see Document Business Agents.

<using>entry

Attribute

Description

class

Java program class containing all <rule>s within the section, unless overridden by a class= attribute in the <rule> entry itself.

other

Any unrecognized attribute is passed to each rule in the rule attributes. For example, to apply the "radix=','" attribute to all rules, it can be specified here rather than on each rule. Naturally, rules that do not use the "radix" attribute would ignore it.

The rule tag and method attributes are required. The remaining attributes are rule-specific and their inclusion is based on the rule itself. The Validator uses the required tags to identify the rule in question and to identify the node or nodes of the document to which it applies. Common <rule> tags are:

<rule>entry

Attribute

Description

class

Rule class to which this rule belongs. This corresponds to a Java object class, and each rule is a method of the class. If this is omitted, the class from the enclosing USING tag is used.

method

Specific rule.

name

Rule identification; should be a unique name. This is used in trace messages to specify which rule caused a violation. If omitted, no unique identification can be given.

stag

For HIPAA documents, this is a specification subsection tag. For more information, see the iWay Format Adapter for HIPAA manual.

tag

Names the right-most parts of the tag to which this rule applies. The rule applies to any node of the document that meets the tag criteria. For example, "DTM" would cause this rule to be applied to every DTM in the incoming document. "X.DTM" applies to all DTM parts prefixed by X. Tags are case sensitive. If omitted, stag must be used.

usage

Specify usage="M" (mandatory) to specify that there must be a value in the identified node. This check is applied before the actual rule logic is executed.

The rule document is located by the <validation> tag value in the dictionary system section, and is identified with the specific document in its <document> entry. Rules validation is performed for document input (<in_validation>) and output (<out_validation>). If several tags are found in the document description, each rules validation is performed in the order in which the tags are found.

A section of the dictionary that illustrates this is:

<system>
   <validation>
       <name file="hipaa835.xml">hipaa835</name>
   </validation>
</system>
   
<document>hipaa-835
   <in_validation>hipaa835</in_validation>
   <agent>XDHipaaAgent</agent>
</document>

iWay Software