The check digit algorithm used by AMRS is a derivative of the Luhn Algorithm. It is critically important that this algorithm is implemented properly wherever identifier check digits are being created or validated. If an attempt to implement the check digit algorithm is added to a program or application and a subtle mistake is made, then patients can be given invalid identifiers and tremendous burden and cost must be expended to correct the problem.
Therefore, we have created a set of scripts that should always travel together. Please do not pick and choose from among the scripts. If your code is going to validate or generate check digits, then you should import all of the attached scripts and you should run the validation macro to ensure that the scripts are working properly before using them in a production environment.