← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12380: Fixed bug - Don't save values of attributes with pre-defined values.

 

------------------------------------------------------------
revno: 12380
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-02 18:21:46 +0700
message:
  Fixed bug - Don't save values of attributes with pre-defined values.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-09-19 06:06:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-10-02 11:21:46 +0000
@@ -311,7 +311,8 @@
                     attributeValue = new PatientAttributeValue();
                     attributeValue.setPatient( patient );
                     attributeValue.setPatientAttribute( attribute );
-
+                    attributeValue.setValue(value);
+                    
                     if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
                     {
                         PatientAttributeOption option = patientAttributeOptionService
@@ -319,7 +320,6 @@
                         if ( option != null )
                         {
                             attributeValue.setPatientAttributeOption( option );
-                            attributeValue.setValue( option.getName() );
                         }
                         else
                         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-09-19 06:06:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-10-02 11:21:46 +0000
@@ -292,12 +292,12 @@
                             if ( option != null )
                             {
                                 attributeValue.setPatientAttributeOption( option );
-                                attributeValue.setValue( option.getName() );
                             }
                             else
                             {
                                 // This option was deleted ???
                             }
+                            attributeValue.setValue( value );
                         }
                         else
                         {