← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2019: Bug fixed in PatientSummary Report & added Purpole Color for activity plan

 

------------------------------------------------------------
revno: 2019
committer: Bharath Kumar <chbharathk@xxxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-06-20 13:50:32 +0530
message:
  Bug fixed in PatientSummary Report & added Purpole Color for activity plan
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-portal/pom.xml
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.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-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2010-06-20 08:20:32 +0000
@@ -40,7 +40,9 @@
 
     public static final String COLOR_YELLOW = "#ffff00";
     
-    public static final String COLOR_GREEN = "#00ff00";    
+    public static final String COLOR_GREEN = "#00ff00";
+    
+    public static final String COLOR_LIGHTRED = "#ff00ff";
 
     private int id;
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2010-03-18 13:06:11 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2010-06-20 08:20:32 +0000
@@ -103,6 +103,10 @@
             {
                 colorMap.put( programStageInstance.getId(), ProgramStageInstance.COLOR_GREEN );
             }
+            else if( programStageInstance.getExecutionDate() != null )
+            {
+            	colorMap.put( programStageInstance.getId(), ProgramStageInstance.COLOR_LIGHTRED );
+            }
             else
             {
                 // -------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2009-11-25 08:30:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2010-06-20 08:20:32 +0000
@@ -35,6 +35,8 @@
 import org.hisp.dhis.caseentry.state.SelectedStateManager;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
@@ -66,6 +68,13 @@
         this.selectedStateManager = selectedStateManager;
     }
 
+    private PatientService patientService;
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
     private ProgramService programService;
 
     public void setProgramService( ProgramService programService )
@@ -179,16 +188,28 @@
 
         programs = programService.getPrograms( organisationUnit );
 
+        // Getting the list of Patients that are related to selected OrganisationUnit
+        
+        Collection<Patient> patientListByOrgUnit = new ArrayList<Patient>();
+        patientListByOrgUnit.addAll( patientService.getPatientsByOrgUnit( organisationUnit ) );
+        
         // ---------------------------------------------------------------------
         // Program instances for the selected program
         // ---------------------------------------------------------------------
-
+        
         Collection<ProgramInstance> selectedProgramInstances = programInstanceService.getProgramInstances( program );
 
         Collection<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
 
         for ( ProgramInstance programInstance : selectedProgramInstances )
         {
+        	Patient patient = programInstance.getPatient();
+            //taking patient present in selected orgunit
+            if ( !patientListByOrgUnit.contains( patient ) )
+            {
+                continue;
+            }
+            
             if ( !programInstance.isCompleted() )
             {
                 programInstances.add( programInstance );

=== 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	2010-05-27 08:42:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2010-06-20 08:20:32 +0000
@@ -281,7 +281,9 @@
     <property name="programInstanceService"
       ref="org.hisp.dhis.program.ProgramInstanceService"/>   
     <property name="programStageInstanceService"
-      ref="org.hisp.dhis.program.ProgramStageInstanceService"/>              
+      ref="org.hisp.dhis.program.ProgramStageInstanceService"/>      
+    <property name="patientService"
+      ref="org.hisp.dhis.patient.PatientService"/>      
   </bean>
   
   <bean id="org.hisp.dhis.caseentry.action.report.ViewRecordsAction"

=== modified file 'dhis-2/dhis-web/dhis-web-portal/pom.xml'
--- dhis-2/dhis-web/dhis-web-portal/pom.xml	2010-06-15 11:33:00 +0000
+++ dhis-2/dhis-web/dhis-web-portal/pom.xml	2010-06-20 08:20:32 +0000
@@ -77,7 +77,7 @@
     </dependency>
     
     <!-- Web service modules -->
-  
+ 
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-importexport</artifactId>
@@ -126,6 +126,7 @@
       <version>${version}</version>
       <type>war</type>
     </dependency>
+	
 	<dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-caseentry</artifactId>
@@ -149,12 +150,13 @@
       <version>${version}</version>
       <type>war</type>
     </dependency> 
+	
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-reports-national</artifactId>
       <version>${version}</version>
       <type>war</type>
-    </dependency> -->
+    </dependency>-->
     <!--<dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-validationrule-local-in</artifactId>

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2010-06-15 11:26:37 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2010-06-20 08:20:32 +0000
@@ -162,12 +162,12 @@
 
     private ProgramService programService;
 
-    public void setProgramService( ProgramService programService )
+    public void setProgramService(ProgramService programService) 
     {
-        this.programService = programService;
-    }
+		this.programService = programService;
+	}
 
-    private ProgramInstanceService programInstanceService;
+	private ProgramInstanceService programInstanceService;
 
     public void setProgramInstanceService( ProgramInstanceService programInstanceService )
     {