Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 4322

Show
Ignore:
Timestamp:
05/21/08 23:25:19 (6 months ago)
Author:
catullus
Message:

Making system IDs use the new validation scheme. Hardcoding Luhn, since all previous system IDs used Luhn. Eventually it would probably be good to have this set as a global property.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/src/api/org/openmrs/api/db/hibernate/HibernateUserDAO.java

    r4095 r4322  
    4141import org.openmrs.api.db.DAOException; 
    4242import org.openmrs.api.db.UserDAO; 
     43import org.openmrs.patient.impl.LuhnIdentifierValidator; 
    4344import org.openmrs.util.OpenmrsUtil; 
    4445import org.openmrs.util.Security; 
     
    124125                String usernameWithCheckDigit = username; 
    125126                try { 
    126                         Integer cd = OpenmrsUtil.getCheckDigit(username); 
    127                         usernameWithCheckDigit = usernameWithCheckDigit + "-" + cd
     127                        //Hardcoding in Luhn since past user IDs used this validator. 
     128                        usernameWithCheckDigit = new LuhnIdentifierValidator().getValidIdentifier(username)
    128129                } 
    129130                catch (Exception e) {}