=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java 2011-01-20 04:05:32 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java 2011-02-23 04:27:41 +0000 @@ -175,36 +175,18 @@ if ( startIndex == endIndex ) { middleName = ""; - lastName = fullName.substring( startIndex, fullName.length() ); + lastName = fullName.substring( startIndex + 1, fullName.length() ); } else { middleName = fullName.substring( startIndex + 1, endIndex ); - lastName = fullName.substring( endIndex, fullName.length() ); + lastName = fullName.substring( endIndex + 1, fullName.length() ); } } patient.setFirstName( firstName ); patient.setMiddleName( middleName ); patient.setLastName( lastName ); - - /* - if ( startIndex == endIndex ) - { - patient.setMiddleName( "" ); - - lastName = fullName.substring( startIndex, fullName.length() ); - patient.setLastName( lastName ); - } - else - { - middleName = fullName.substring( startIndex + 1, endIndex ); - patient.setMiddleName( middleName ); - - lastName = fullName.substring( endIndex, fullName.length() ); - patient.setLastName( lastName ); - } - */ // --------------------------------------------------------------------- // Set Other information for patient === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/UpdatePatientAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/UpdatePatientAction.java 2011-01-19 11:13:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/UpdatePatientAction.java 2011-02-23 04:27:41 +0000 @@ -166,12 +166,12 @@ if ( startIndex == endIndex ) { middleName = ""; - lastName = fullName.substring( startIndex, fullName.length() ); + lastName = fullName.substring( startIndex + 1, fullName.length() ); } else { middleName = fullName.substring( startIndex + 1, endIndex ); - lastName = fullName.substring( endIndex, fullName.length() ); + lastName = fullName.substring( endIndex + 1, fullName.length() ); } } @@ -179,25 +179,6 @@ patient.setMiddleName( middleName ); patient.setLastName( lastName ); - /* - if ( startIndex == endIndex ) - { - patient.setMiddleName( "" ); - - lastName = fullName.substring( startIndex, fullName.length() ); - patient.setLastName( lastName ); - } - else - { - middleName = fullName.substring( startIndex + 1, endIndex ); - patient.setMiddleName( middleName ); - - lastName = fullName.substring( endIndex, fullName.length() ); - patient.setLastName( lastName ); - } - */ - //patient.setLastName( fullName.substring( endIndex, fullName.length() ) ); - // --------------------------------------------------------------------- // Set Other information for patient // ---------------------------------------------------------------------