← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12111: Put attribute-values and identifier into the profile tab in Dashsboard

 

------------------------------------------------------------
revno: 12111
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-09-17 16:47:21 +0700
message:
  Put attribute-values and identifier into the profile tab in Dashsboard
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  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/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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/PatientDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2013-09-06 09:06:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2013-09-17 09:47:21 +0000
@@ -41,8 +41,10 @@
 import org.hisp.dhis.patient.PatientAudit;
 import org.hisp.dhis.patient.PatientAuditService;
 import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramIndicatorService;
@@ -81,6 +83,8 @@
 
     private ProgramIndicatorService programIndicatorService;
 
+    private PatientAttributeValueService patientAttributeValueService;
+    
     // -------------------------------------------------------------------------
     // Input && Output
     // -------------------------------------------------------------------------
@@ -114,6 +118,11 @@
         return programIndicatorsMap;
     }
 
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
     public void setPatientAuditService( PatientAuditService patientAuditService )
     {
         this.patientAuditService = patientAuditService;
@@ -215,7 +224,45 @@
         relationships = relationshipService.getRelationshipsForPatient( patient );
 
         Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient );
-
+        
+        // ---------------------------------------------------------------------
+        // Get patient-attribute-values
+        // ---------------------------------------------------------------------
+
+        Collection<PatientAttributeValue> _attributeValues = patientAttributeValueService
+            .getPatientAttributeValues( patient );
+        attributeValues = new HashSet<PatientAttributeValue>();
+
+        for ( Program program : programs )
+        {
+            Collection<PatientAttribute> atttributes = program.getPatientAttributes();
+            for ( PatientAttributeValue attributeValue : _attributeValues )
+            {
+                if ( atttributes.contains( attributeValue.getPatientAttribute() ) )
+                {
+                    attributeValues.add( attributeValue );
+                }
+            }
+        }
+
+        // ---------------------------------------------------------------------
+        // Get patient-identifiers
+        // ---------------------------------------------------------------------
+
+        Collection<PatientIdentifier> _identifiers = patient.getIdentifiers();
+        identifiers = new HashSet<PatientIdentifier>();
+
+        for ( Program program : programs )
+        {
+            Collection<PatientIdentifierType> identifierTypes = program.getPatientIdentifierTypes();
+            for ( PatientIdentifier identifier : _identifiers )
+            {
+                if ( !identifierTypes.contains( identifier.getIdentifierType() ) )
+                {
+                    identifiers.add( identifier );
+                }
+            }
+        }
         // ---------------------------------------------------------------------
         // Get program enrollment
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-09-17 06:08:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-09-17 09:47:21 +0000
@@ -1123,6 +1123,8 @@
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 		<property name="programIndicatorService"
 			ref="org.hisp.dhis.program.ProgramIndicatorService" />
+		<property name="patientAttributeValueService"
+			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 	</bean>
 
 	<bean

=== 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	2013-09-17 07:53:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-09-17 09:47:21 +0000
@@ -683,4 +683,7 @@
 update_success = Update successfully
 send_message = Send message
 sms = SMS
-enrollment_date = Enrollment date
\ No newline at end of file
+enrollment_date = Enrollment date
+add_relative = Add relative
+who_is_the_new_relative_to_the_existing_person = Who is the new relative to the existing person?
+program_for_new_relative_to_be_enrolled_in = Program for new relative to be enrolled in
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-09-16 09:47:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-09-17 09:47:21 +0000
@@ -74,6 +74,16 @@
 					<td>$!programIndicatorsMap.get($key)</td>
 				</tr>
 				#end
+				#foreach( $identifier in $identifiers )
+				<tr>
+					#if($!identifier.identifierType)
+						<td>$!identifier.identifierType.displayName</td>
+					#else
+						<td>$i18n.getString("system_identifier")</td>
+					#end
+					<td id='dashboard_iden$identifier.identifierType.id'>$identifier.identifier</td>
+				</tr>
+				#end
 				#foreach( $attributeValue in $attributeValues )
 				<tr>
 					<td>$attributeValue.patientAttribute.displayName</td>
@@ -90,15 +100,6 @@
 					</td>
 				</tr>
 				#end
-				#foreach( $identifier in $identifiers )
-				<tr>
-					#if($!identifier.identifierType)
-					#else
-						<td>$i18n.getString("system_identifier")</td>
-						<td id='dashboard_iden$identifier.identifierType.id'>$identifier.identifier</td>
-					#end
-				</tr>
-				#end
 			</table>
 		</div>
 	</div>
@@ -216,7 +217,7 @@
 			$i18n.getString("relationships")
 			
 			#if( $auth.hasAccess( "dhis-web-caseentry", "showAddRelationshipPatient" ) )			
-				&#8226; <a href="javascript:showAddRelationshipPatient( '$patient.id', false, '' );">$i18n.getString("add_new_patient")</a>
+				&#8226; <a href="javascript:showRelationshipList( '$patient.id');">$i18n.getString("add_relative")</a>
 				<span id="patientRelatedStageSpan">&nbsp;<span>
 			#end
 		</p>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-09-17 06:08:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-09-17 09:47:21 +0000
@@ -221,14 +221,14 @@
 		</tr>
 		
 		<tr name='nonAnonymous'>
-			<td>$i18n.getString("relationship_details")</td>
+			<td>$i18n.getString("who_is_the_new_relative_to_the_existing_person")</td>
 			<td>
 				<select type='text' id='relationshipFromA' name='relationshipFromA'></select>
 			</td>
 		</tr>
 		
 		<tr name='nonAnonymous'>
-			<td>$i18n.getString("program_related")</td>
+			<td>$i18n.getString("program_for_new_relative_to_be_enrolled_in")</td>
 			<td>
 				<select type='text' id='relatedProgramId' name='relatedProgramId' >
 					<option value=''>[$i18n.getString("please_select")]</option>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-09-17 06:08:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-09-17 09:47:21 +0000
@@ -226,7 +226,7 @@
 		</tr>
 		
 		<tr name='nonAnonymous'>
-			<td>$i18n.getString("relationship_details")</td>
+			<td>$i18n.getString("who_is_the_new_relative_to_the_existing_person")</td>
 			<td>
 				<select id='relationshipFromA' name='relationshipFromA'>
 					#if($!program.relationshipType)
@@ -238,7 +238,7 @@
 		</tr>
 		
 		<tr name='nonAnonymous'>
-			<td>$i18n.getString("program_related")</td>
+			<td>$i18n.getString("program_for_new_relative_to_be_enrolled_in")</td>
 			<td>
 				<select type='text' id='relatedProgramId' name='relatedProgramId' >
 					<option value=''>[$i18n.getString("please_select")]</option>