The LOINC code is a numeric code suffixed by a dash and Mod 10 check digit. This formula is also referred to a Luhn algorithm. The digit is used as an integrity check.
The algorithm for calculating a Mod 10 check digit is as follows. Note that this algorithm is slightly different for LOINC codes with a prefix (e.g, LP, LL, LA, LG).
Step 1
Using the number 12345, assign positions to the digits, from right to left.
Example:
1st = 5
2nd = 4
3rd = 3
4th = 2
5th = 1Step 2
Take the odd digit positions counting from the right (1st, 3rd, 5th, etc.).
Example:
531Step 3
Multiply by 2.
Example:
1062Step 4
Take the even digit positions starting from the right (2nd, 4th, etc.).
Example:
42Step 5
Prepend the results of Step 4 to the results of Step 3.
Example:
421062Step 6
Add the digits of Step 5 together.
Example:
4 + 2 + 1 + 0 + 6 + 2 = 15Step 7
Find the next highest multiple of 10.
Example:
20Step 8
Subtract the value of Step 6 from the value of Step 7. Thus, 5 is the Mod 10 check digit for 12345.
Example:
20 - 15 = 5Section Contents