Type 5 Validation Methods

The Pack for Healthcare supports two methods of Type 5 Validation: Code Value and Pattern Match. The choice of validation method is generally determined by the requirements of your organization, the nature of the code list, and access to code list contents.

The hipaa_X12_qualifier.json file contains Type 5 rules that can be checked. These rules will have a validation type of T5, with the syntax “ValidationType”: “T5.” Each Type 5 rule also has additional attributes to indicate what method of Type 5 validation to use, which code table to reference, or which pattern to match.

The Code Value method, with "ValidationSubType": "CV", checks that the data content selected for Type 5 validation is in a particular code list. The Code Table ID, or "CodeTableID" is used to specify the Code List collection that contains the list of all acceptable code items. An example is "CodeTableID" : "T5_022". This method also includes the option to define start and/ or end dates for individual code list items. The transaction processing date determines whether the code item falls within the effective date restrictions.

The Pattern Match method, with "ValidationSubType": "PM", checks that the data content is consistent with a particular format or pattern. The Pattern Identifier, or "PatternID", is used to specify the Regular Expression to be used for validation. A Regular Expression, or regex for short, is a codified text string describing a search pattern. Examples of Pattern IDs that are used in the Pack include:
  • [0-9A-Z]{2} Exactly two uppercase alphabetic or numeric characters.
  • [0-9]{9} Exactly nine numeric characters.
  • [A-Z]{3,5} Between three and five uppercase alphabetic characters.
If the Type 5 validation is enabled, all elements that contain an HIPAA National Provider Identifier (NPI) have specific rules to validate:
  • The first digit of the NPI must be either 1 or 2.
  • The check digit(last digit) is correct, based on the assumed prefix of 80840.

The rules of this element include the PatternID of NPI.

You can calculate the NPI check digit using the Luhn formula, a method for computing the modulus 10 double-add-double check digit:
  1. Double the value of alternate digits, start from the rightmost digit.
  2. Add a constant of 24 to account for the 80840 prefix present on a card issuer identifier, in addition to the individual digits of products of doubling, and the unaffected digits.
  3. Subtract the result from the next higher number that ends in zero.