Reputation: 535
I have override the existing Patient Registration form and render the Xform Patient Registration from successfully[Reference].
When I create a new Patient I'm getting following error
"Patient#null failed to validate with reason :Invalid check digit for identifier:10005G".
I given following information for patient creation
Family Name: Patient
Given Name:One
Other Identifiers
Some please help how to fix the issue.
Upvotes: 1
Views: 762
Reputation: 42
OpenMRS uses a modified Luhn Algorithm to calculate check digits, where the last character in an identifier is calculated from the preceding characters. Check digits allow for self-validation of identifiers that are manually entered (an approach also used by the credit card industry). The default algorithm used for new identifier types is a Luhn Mod-30 Check Digit Validator. This Mod-30 algorithm uses the character set "0123456789ACDEFGHJKLMNPRTUVWXY" for characters within identifiers and check digits (avoiding letters that may be confused with numbers or other letters: B, I, O, Q, S, and Z).
Presumably, this algorithm is being applied to your supplied identifier(s). The correct Mod-30 check digit for "10005" is "K" (not "C" or "G"). This is probably why you are getting the error. The algorithm used, if any, to validate identifiers depends on the Patient Identifier Type, so you can figure out which algorithm(s) are being used on your system by looking at the patient identifier types defined in your system.
Upvotes: 1