We use a variant of the basic Mod 10 algorithm to calculate LOINC Part, Answer List, Answer, and Group identifiers because those identifiers contain the alpha prefixes “LP”, “LL”, “LA”, and “LG”, respectively.

A detailed description of the method is documented the OpenMRS Wiki. This source also has code for calculating the check digit in numerous languages including Java, Python, JavaScript, and C#.

This same algorithm can be used for calculating check digits for user-assigned “X codes” (that contain a leading “X” character) as well.