← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2898: Fix bug: Remove invalid spaces into name of patient.

 

------------------------------------------------------------
revno: 2898
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-02-23 11:27:41 +0700
message:
  Fix bug: Remove invalid spaces into name of patient.
modified:
  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/UpdatePatientAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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
         // ---------------------------------------------------------------------