← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9926: Fix bug Don't load relationship list in Patient Dashboard; and Thrown exception if to click on Se...

 

------------------------------------------------------------
revno: 9926
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-02-28 15:50:43 +0700
message:
  Fix bug Don't load relationship list in Patient Dashboard; and Thrown exception if to click on Set as representative icon in Relationship management
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPartnerAction.java
  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/webapp/dhis-web-caseentry/detailsPartner.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.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/GetPartnerAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPartnerAction.java	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPartnerAction.java	2013-02-28 08:50:43 +0000
@@ -32,8 +32,6 @@
 
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientIdentifier;
-import org.hisp.dhis.patient.PatientIdentifierService;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
@@ -60,13 +58,6 @@
         this.patientService = patientService;
     }
 
-    private PatientIdentifierService patientIdentifierService;
-
-    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
-    {
-        this.patientIdentifierService = patientIdentifierService;
-    }
-
     private ProgramService programService;
 
     public void setProgramService( ProgramService programService )
@@ -123,13 +114,6 @@
         return partner;
     }
 
-    private PatientIdentifier patientIdentifier;
-
-    public PatientIdentifier getPatientIdentifier()
-    {
-        return patientIdentifier;
-    }
-
     private Collection<Program> programs;
 
     public Collection<Program> getPrograms()
@@ -163,8 +147,6 @@
             }
         }
 
-        patientIdentifier = patientIdentifierService.getPatientIdentifier( partner );
-
         for ( PatientAttribute patientAttribute : partner.getAttributes() )
         {
             patientAttributeValueMap.put( patientAttribute.getId(), PatientAttributeValue.UNKNOWN );
@@ -175,8 +157,8 @@
 
         for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
         {
-            patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue
-                .getValue() );
+            patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
+                patientAttributeValue.getValue() );
         }
 
         programs = programService.getAllPrograms();

=== 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-02-27 14:39:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2013-02-28 08:50:43 +0000
@@ -92,8 +92,6 @@
 
     private Collection<PatientAttributeValue> attributeValues;
 
-    private Collection<Relationship> relationship;
-
     private Collection<ProgramInstance> activeProgramInstances;
 
     private Collection<ProgramInstance> completedProgramInstances;
@@ -101,8 +99,8 @@
     private Collection<PatientAudit> patientAudits;
 
     private Map<PatientAttribute, String> attributeMap = new HashMap<PatientAttribute, String>();
-    
-    Collection<Relationship> relationships = new HashSet<Relationship>();
+
+    private Collection<Relationship> relationships = new HashSet<Relationship>();
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -112,17 +110,17 @@
     {
         this.patientAuditService = patientAuditService;
     }
-    
+
     public Map<PatientAttribute, String> getAttributeMap()
     {
         return attributeMap;
     }
-    
+
     public void setFormat( I18nFormat format )
     {
         this.format = format;
     }
-    
+
     public void setPatientAttributeService( PatientAttributeService patientAttributeService )
     {
         this.patientAttributeService = patientAttributeService;
@@ -158,6 +156,11 @@
         this.relationshipService = relationshipService;
     }
 
+    public Collection<Relationship> getRelationships()
+    {
+        return relationships;
+    }
+
     public void setProgramInstanceService( ProgramInstanceService programInstanceService )
     {
         this.programInstanceService = programInstanceService;
@@ -178,11 +181,6 @@
         return attributeValues;
     }
 
-    public Collection<Relationship> getRelationship()
-    {
-        return relationship;
-    }
-
     public void setPatientService( PatientService patientService )
     {
         this.patientService = patientService;
@@ -233,7 +231,7 @@
         // ---------------------------------------------------------------------
 
         relationships = relationshipService.getRelationshipsForPatient( patient );
-        
+
         Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient );
 
         activeProgramInstances = new HashSet<ProgramInstance>();
@@ -263,7 +261,8 @@
         long dateOnly = (currentTime / millisInDay) * millisInDay;
         Date date = new Date( dateOnly );
         String visitor = currentUserService.getCurrentUsername();
-        PatientAudit patientAudit = patientAuditService.getPatientAudit( patientId, visitor, date, PatientAudit.MODULE_PATIENT_DASHBOARD );
+        PatientAudit patientAudit = patientAuditService.getPatientAudit( patientId, visitor, date,
+            PatientAudit.MODULE_PATIENT_DASHBOARD );
         if ( patientAudit == null )
         {
             patientAudit = new PatientAudit( patient, visitor, date, PatientAudit.MODULE_PATIENT_DASHBOARD );

=== 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-02-27 14:39:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-02-28 08:50:43 +0000
@@ -701,8 +701,6 @@
 	<bean id="org.hisp.dhis.caseentry.action.patient.GetPartnerAction"
 		class="org.hisp.dhis.caseentry.action.patient.GetPartnerAction" scope="prototype">
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-		<property name="patientIdentifierService"
-			ref="org.hisp.dhis.patient.PatientIdentifierService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 		<property name="patientAttributeValueService"
 			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm	2013-02-13 15:58:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm	2013-02-28 08:50:43 +0000
@@ -33,8 +33,8 @@
 	#foreach( $patientIdentifier in $partner.identifiers )
 	<tr>
 		<td>
-				#if($!patientIdentifier.identifierType)  $!patientIdentifier.identifierType.displayName
-				#else $i18n.getString( "patient_system_id") #end 
+			#if($!patientIdentifier.identifierType)  $!patientIdentifier.identifierType.displayName
+			#else $i18n.getString( "patient_system_id") #end 
 		</td>
 		<td>: $patientIdentifier.identifier</td>
 	</tr>
@@ -57,10 +57,10 @@
 	
 	<tr><td>&nbsp;</td></tr>
 	<tr>
-		<td><label class="bold">$i18n.getString( "enrolled_in_program" )</label></td>
+		<td valign='top'><label class="bold">$i18n.getString( "enrolled_in_program" )</label></td>
 		<td>: 
 		#foreach( $program in $partner.programs )
-			$encoder.htmlEncode($program.displayName)
+			- $encoder.htmlEncode($program.displayName)<br>
 		#end
 		</td>
 	</tr>

=== 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-02-27 14:39:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-02-28 08:50:43 +0000
@@ -176,7 +176,7 @@
 		</p>
 		<div class="contentProviderTable">
 			<table>
-				#foreach( $rel in $relationship )
+				#foreach( $rel in $relationships )
 					#if($rel.patientA.id==$patient.id)
 						<tr onclick="showPatientDashboardForm($rel.patientB.id)" title='$i18n.getString( "move_to_dashboard_of" ) $rel.patientB.getFullName()'>
 							<td><a href='#'>$rel.relationshipType.bIsToA</a></td>