Adding Check Digits LOINC Part and Answer identifiers

We are considering adding a mod-10 check digit to the current identifiers for LOINC Parts and Answers, similar to how we use a check digit on the main LOINC codes. Check digits can be used to help prevent mis-keying the identifier.



Would this cause major problems for any current users?

Strictly speaking, the mod10 check digit algorithm is only applicable to numbers. The LOINC part and answer string identifiers are prefixed by the strings “LP” and “LA” respectively. This implies that we cannot use a mod10 check digit algorithm on these identifiers. To get around this problem, we are proposing to using a modification to the algorithm that is described here http://openmrs.org/wiki/Check_Digit_Algorithm#Our_variation_on_the_Luhn_algorithm. This variation allows for the creation of a check digit on an arbitrary ASCII string.

@jhook wrote:

Strictly speaking, the mod10 check digit algorithm is only applicable to numbers. The LOINC part and answer string identifiers are prefixed by the strings “LP” and “LA” respectively. This implies that we cannot use a mod10 check digit algorithm on these identifiers. To get around this problem, we are proposing to using a modification to the algorithm that is described here http://openmrs.org/wiki/Check_Digit_Algorithm#Our_variation_on_the_Luhn_algorithm. This variation allows for the creation of a check digit on an arbitrary ASCII string.




I’m not sure if it’s the same as Luhn mod N algorithm, but it seems to be widely implemented too. It can support alphanumeric characters as well. From the description, it seems to support multibyte (Unicode) characters too.