← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7318: Sometimes some values of attribute aren't saved in Enrollment form.

 

------------------------------------------------------------
revno: 7318
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-18 10:29:11 +0700
message:
  Sometimes some values of attribute aren't saved in Enrollment form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm


--
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/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2012-05-24 10:44:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2012-06-18 03:29:11 +0000
@@ -300,17 +300,8 @@
 
         for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
         {
-            if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttributeValue.getPatientAttribute()
-                .getValueType() ) )
-            {
-                patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
-                    patientAttributeValue.getPatientAttributeOption().getName() );
-            }
-            else
-            {
-                patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
-                    patientAttributeValue.getValue() );
-            }
+            patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue
+                .getValue() );
         }
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java	2012-03-29 04:32:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java	2012-06-18 03:29:11 +0000
@@ -221,7 +221,7 @@
 
         if ( attributes != null && attributes.size() > 0 )
         {
-            patient.getAttributes().clear();
+            // patient.getAttributes().clear();
 
             for ( PatientAttribute attribute : attributes )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-15 07:11:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-18 03:29:11 +0000
@@ -290,7 +290,7 @@
 create = Create
 migration_patient = Migration person
 patient_info = Person information
-enroll_for = enroll for
+enroll_for = Enroll for
 identifier_and_attribute = Identifier/Attribute
 unenrollment = Un-enrollment
 modify_due_date_or_visit_date = Modify due/Visit dates

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-06-14 03:58:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-06-18 03:29:11 +0000
@@ -40,7 +40,7 @@
 					<tr><th colspan="2" class="heading-column">$attributeGroup.name</th></tr>
 					#set( $mark = false )
 					#foreach($attribute in $attributeGroup.attributes)
-						#if( $!attribute.program )
+						#if( $attribute.program && $attribute.program.id == $programInstance.program.id )
 							#set( $attributeValue = '')
 							#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
 							<tr #alternate( $mark )>
@@ -81,7 +81,7 @@
 					<tr><th colspan="2" class="heading-column">$i18n.getString( "Other details" )</th></tr>
 					#set( $mark = false )
 					#foreach($attribute in $noGroupAttributes )
-						#if( $attribute.program )
+						#if( $attribute.program && $attribute.program.id == $programInstance.program.id)
 							#set( $attributeValue = '')
 							#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
 							<tr #alternate( $mark )>