Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 4324

Show
Ignore:
Timestamp:
05/21/08 23:39:57 (8 months ago)
Author:
djazayeri
Message:

sync: merging trunk to data_synchronization_bidir [4313]:[4322]

Files:

Legend:

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

    r4121 r4324  
    3838import org.openmrs.api.db.DAOException; 
    3939import org.openmrs.api.db.UserDAO; 
     40import org.openmrs.patient.impl.LuhnIdentifierValidator; 
    4041import org.openmrs.util.OpenmrsUtil; 
    4142import 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) {} 
  • openmrs/branches/data_synchronization_bidirectional/test/api/org/openmrs/test/api/AdministrationServiceTest.java

    r4161 r4324  
    451451        public void testExecuteSqlGroupBy() throws Exception { 
    452452                 
    453                 String sql = "select encounter1_.location_id, encounter1_.creator, encounter1_.encounter_type, encounter1_.form_id, location2_.location_id, count(obs0_.obs_id) from obs obs0_ right outer join encounter encounter1_ on obs0_.encounter_id=encounter1_.encounter_id inner join location location2_ on encounter1_.location_id=location2_.location_id inner join users user3_ on encounter1_.creator=user3_.user_id inner join person user3_1_ on user3_.user_id=user3_1_.person_id inner join encounter_type encountert4_ on encounter1_.encounter_type=encountert4_.encounter_type_id inner join form form5_ on encounter1_.form_id=form5_.form_id where encounter1_.date_created>='20070505' and encounter1_.date_created<= '20080505' group by encounter1_.location_id, encounter1_.creator , encounter1_.encounter_type , encounter1_.form_id"; 
    454                  
     453                String sql = "select encounter1_.location_id, encounter1_.creator, encounter1_.encounter_type, encounter1_.form_id, location2_.location_id, count(obs0_.obs_id) from obs obs0_ right outer join encounter encounter1_ on obs0_.encounter_id=encounter1_.encounter_id inner join location location2_ on encounter1_.location_id=location2_.location_id inner join users user3_ on encounter1_.creator=user3_.user_id inner join person user3_1_ on user3_.user_id=user3_1_.person_id inner join encounter_type encountert4_ on encounter1_.encounter_type=encountert4_.encounter_type_id inner join form form5_ on encounter1_.form_id=form5_.form_id where encounter1_.date_created>='2007-05-05' and encounter1_.date_created<= '2008-05-05' group by encounter1_.location_id, encounter1_.creator , encounter1_.encounter_type , encounter1_.form_id"; 
    455454                as.executeSQL(sql, true); 
    456455                 
     456                String sql2 = "select encounter_id, count(*) from encounter encounter_id group by encounter_id"; 
     457                as.executeSQL(sql2, true); 
    457458        } 
    458459