D.Roos, J.Kardoeus: ISO7064-standardised Check Digits Applied to Blood Bag Numbers release 1.1.1i (draft)

ISO7064-standardised Check Digits Applied to Blood Bag Numbers
Purpose
Blood product bag numbers
MOD11,10 algorithm
Calculation and validation examples
Coding sample
Hints to users
Hints to developers
References, copyright, disclaimer
 

 
MOD 11,10 algorithm (from ISO 7064[4])

Caution! - Mathematics!
This chapter can be skipped by readers, who are not interested in the mathematics of check digit algorithms

The check digit is concatenated right-terminating to the original numerical string.

A numerical string having a check digit passes as "valid", that is "probably transmitted correctly", if it meets the condition as follows (see calculation example):

( (( ... (( ... (( (( 10 + a1)||10 * 2)|11 + a2)||10 * 2)|11 + ... + aj)||10 * 2)|11 + ... + an-1)||10 * 2)|11 + an)||10 = 1 (1)
              =T0 =T1 =T2 =Tj =Tn-1

Having:

n Length of the numerical string including check digit.
j Position within numerical string, starting from left. That is the right-most digit has position j=n. Blanks ignored.
aj Value of numerical digit at position j.
(...)||10 The remainder after dividing the term within brackets through 10. If the remainder equals 0, it must be replaced with 10. Because the maximum value of the operand will be 19, the result of this operation equals:
(k)||10 = k for any k<=10
(k)||10 = k-10 for any k>10
(...)|11 The remainder after dividing the term enclosed in brackets through 11. Because the operand is even under any circumstance, the remainder will neber be 0. Because the maximum value of the operand will be 20, the result of this operation equals:
(k)||11 = k for any k<11
(k)||11 = k-11 for any k>=11

Algorithmic steps

The brackets appearing in the check digit equation are calculated recursively starting with the inner-most and processing the source string from left (j=1) to right (j=n-1) (see calculation example). For that the intermediate results Tj are calculated recursively for j = 1, 2, ..., n-1 starting with T0=10:

Tj = ((Tj-1 + an-j+1)||10 * 2)|11   (2)

If either a numerical string with check digit enclosed has to be validated or a check digit has to be attached to a source string the procedure continues alternatively as follows:

Validation

The numerical string is valid (that is "probably transmitted correct"), if Tn-1 from equation (2) is:

(Tn-1 + an)||10 =1   (3)

Check digit calculation (see calculation example)

The check digit an is calculated from Tn-1 using equation (2):

an = (11 - Tn-1)|10   (4)

having (...)|10 the remainder after deviding the term in brackets through 10.

nach oben nächste Seite

Disclaimer | Copyright last revision: 25.11.2000 21:46
Signature