← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9312: Add statistical report in patient module (WIP)

 

------------------------------------------------------------
revno: 9312
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-12-14 12:49:05 +0700
message:
   Add statistical report in patient module (WIP)
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateStatisticalProgramReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReport.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReportSelect.vm
modified:
  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-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportsMenu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties


--
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/report/GenerateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2012-12-13 08:48:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2012-12-14 05:49:05 +0000
@@ -78,13 +78,6 @@
         this.programInstanceService = programInstanceService;
     }
 
-    private ProgramStageInstanceService programStageInstanceService;
-
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -165,13 +158,6 @@
     {
         return total;
     }
-
-    private Map<Integer, Integer> completedMap = new HashMap<Integer, Integer>();
-
-    public Map<Integer, Integer> getCompletedMap()
-    {
-        return completedMap;
-    }
     
     // -------------------------------------------------------------------------
     // Action implementation
@@ -223,12 +209,6 @@
             programInstances = programInstanceService.getProgramInstances( program, orgunitIds, sDate, eDate,
                 paging.getStartPos(), paging.getPageSize() );
 
-            for ( ProgramStage programStage : program.getProgramStages() )
-            {
-                int completedNo = programStageInstanceService.getProgramInstancesCount( programStage, orgunitIds,
-                    sDate, eDate );
-                completedMap.put( programStage.getId(), completedNo );
-            }
         }
 
         return SUCCESS;

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateStatisticalProgramReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateStatisticalProgramReportAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateStatisticalProgramReportAction.java	2012-12-14 05:49:05 +0000
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.caseentry.action.report;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version GenerateStatisticalProgramReportAction.java 11:13:25 AM Dec 14, 2012 $
+ */
+public class GenerateStatisticalProgramReportAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private OrganisationUnitSelectionManager selectionManager;
+
+    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+    {
+        this.selectionManager = selectionManager;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    private ProgramInstanceService programInstanceService;
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+
+    private Integer programId;
+
+    public void setProgramId( Integer programId )
+    {
+        this.programId = programId;
+    }
+
+    private String startDate;
+
+    public void setStartDate( String startDate )
+    {
+        this.startDate = startDate;
+    }
+
+    private String endDate;
+
+    public void setEndDate( String endDate )
+    {
+        this.endDate = endDate;
+    }
+
+    private String facilityLB;
+
+    public void setFacilityLB( String facilityLB )
+    {
+        this.facilityLB = facilityLB;
+    }
+
+    private OrganisationUnit organisationUnit;
+
+    public OrganisationUnit getOrganisationUnit()
+    {
+        return organisationUnit;
+    }
+
+    private Collection<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
+
+    public Collection<ProgramInstance> getProgramInstances()
+    {
+        return programInstances;
+    }
+
+    private Map<Integer, Integer> statusMap = new HashMap<Integer, Integer>();
+
+    public Map<Integer, Integer> getStatusMap()
+    {
+        return statusMap;
+    }
+
+    private Program program;
+
+    public Program getProgram()
+    {
+        return program;
+    }
+
+    private int total;
+
+    public int getTotal()
+    {
+        return total;
+    }
+
+    private Map<Integer, Integer> completedMap = new HashMap<Integer, Integer>();
+
+    public Map<Integer, Integer> getCompletedMap()
+    {
+        return completedMap;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        organisationUnit = selectionManager.getSelectedOrganisationUnit();
+
+        program = programService.getProgram( programId );
+
+        Date sDate = format.parseDate( startDate );
+
+        Date eDate = format.parseDate( endDate );
+
+        // ---------------------------------------------------------------------
+        // Get orgunitIds
+        // ---------------------------------------------------------------------
+
+        Collection<Integer> orgunitIds = new HashSet<Integer>();
+
+        if ( facilityLB.equals( "selected" ) )
+        {
+            orgunitIds.add( organisationUnit.getId() );
+        }
+        else if ( facilityLB.equals( "childrenOnly" ) )
+        {
+            orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren(
+                organisationUnit.getId() ) );
+            orgunitIds.remove( organisationUnit.getId() );
+        }
+        else
+        {
+            orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren(
+                organisationUnit.getId() ) );
+        }
+
+        if ( orgunitIds.size() > 0 )
+        {
+            // ---------------------------------------------------------------------
+            // Program instances for the selected program
+            // ---------------------------------------------------------------------
+
+            total = programInstanceService.countProgramInstances( program, orgunitIds, sDate, eDate );
+
+            for ( ProgramStage programStage : program.getProgramStages() )
+            {
+                int completedNo = programStageInstanceService.getProgramInstancesCount( programStage, orgunitIds,
+                    sDate, eDate );
+                completedMap.put( programStage.getId(), completedNo );
+            }
+        }
+
+        return SUCCESS;
+    }
+}
+

=== 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	2012-12-13 08:48:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-12-14 05:49:05 +0000
@@ -246,7 +246,6 @@
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 		<property name="organisationUnitService"
 			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-		<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.caseentry.action.report.ViewRecordsAction"
@@ -256,6 +255,18 @@
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
+	
+	<bean id="org.hisp.dhis.caseentry.action.report.GenerateStatisticalProgramReportAction"
+		class="org.hisp.dhis.caseentry.action.report.GenerateStatisticalProgramReportAction"
+		scope="prototype">
+		<property name="selectionManager"
+			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
+		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+	</bean>
 
 	<!-- Case Aggregation -->
 

=== 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-12-13 08:48:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-12-14 05:49:05 +0000
@@ -56,7 +56,7 @@
 search_result_matching_the_search_criteria=Result matches the search criteria
 registering_unit=Registering unit
 select=Select
-program_summary_report=Program Summary Report
+program_summary_report=Program summary report
 intro_program_summary=View the summary report to get an overview of the services provided for a program.
 other_facility=Private facility
 error_required_field=Please enter value for all data element in red color
@@ -477,4 +477,7 @@
 you_have_active_filters = You have active filters
 back_to_event_list = Back to event list
 add_patient_and_add_new = Add person and Add new
-number_of_completed_events = Completed Events No.
\ No newline at end of file
+events_completed = Events completed
+statistical_program = Statistical Program
+statistical_program_report = Statistical program report
+intro_statistical_program = Statistical reports on program performance, e.g. drop-out rates, how many completed every month/year - counts/percentages etc 
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-11-20 15:34:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-12-14 05:49:05 +0000
@@ -323,6 +323,7 @@
 			<result name="success" type="velocity">/content.vm</result>
 			<param name="page">/dhis-web-caseentry/report.vm</param>
 			<param name="javascripts">javascript/commons.js,javascript/report.js</param>
+			<param name="requiredAuthorities">F_GENERATE_PROGRAM_SUMMARY_REPORT</param>
 		</action>
 
 		<action name="viewRecords"
@@ -331,6 +332,25 @@
 			<param name="page">/dhis-web-caseentry/records.vm</param>
 		</action>
 		
+		<action name="statisticalProgramReportSelect"
+			class="org.hisp.dhis.caseentry.action.report.ReportSelectAction">
+			<interceptor-ref name="organisationUnitTreeStack" />
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-caseentry/statisticalProgramReportSelect.vm</param>
+			<param name="menu">/dhis-web-caseentry/reportsMenu.vm</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/statisticalReport.js</param>
+			<param name="stylesheets">style/style.css</param>
+			<param name="requiredAuthorities">F_GENERATE_STATISTICAL_PROGRAM_REPORT</param>
+		</action>
+		
+		<action name="generateStatisticalProgramReport"
+			class="org.hisp.dhis.caseentry.action.report.GenerateStatisticalProgramReportAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-caseentry/statisticalProgramReport.vm</param>
+			<param name="javascripts">javascript/commons.js,javascript/statisticalReport.js</param>
+			<param name="requiredAuthorities">F_GENERATE_STATISTICAL_PROGRAM_REPORT</param>
+		</action>
+		
 		<!-- i18n -->
 
 		<action name="i18n" class="org.hisp.dhis.caseentry.action.NoAction">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-12-07 13:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-12-14 05:49:05 +0000
@@ -27,6 +27,10 @@
 		#introListImgItem( "app/index.html" "tabular_report" "summaryreport" )
 	#end
 	
+	#if( $auth.hasAccess( "dhis-web-caseentry", "statisticalProgramReportSelect" ) )
+		#introListImgItem( "statisticalProgramReportSelect.action" "statistical_program" "validationanalysis" )
+	#end
+	
 	#if( $auth.hasAccess( "dhis-web-caseentry", "caseAggregationForm" ) )
 		#introListImgItem( "caseAggregationForm.action" "manual_person_aggregation" "caseaggregation" )
 	#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-12-07 13:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-12-14 05:49:05 +0000
@@ -9,7 +9,7 @@
 function loadGeneratedReport()
 {
 	showLoader();
-
+	
 	jQuery( "#contentDiv" ).load( "generateReport.action",
 	{
 		programId: getFieldValue( 'programId' ),

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js	2012-12-14 05:49:05 +0000
@@ -0,0 +1,24 @@
+function organisationUnitSelected( orgUnits, orgUnitNames )
+{
+    setFieldValue( 'orgunitname', orgUnitNames[0] );
+}
+
+selection.setListenerFunction( organisationUnitSelected );
+
+function generatedStatisticalProgramReport()
+{
+	showLoader();
+	
+	jQuery( "#contentDiv" ).load( "generateStatisticalProgramReport.action",
+	{
+		programId: getFieldValue( 'programId' ),
+		startDate: getFieldValue( 'startDate' ),
+		endDate: getFieldValue( 'endDate' ),
+		facilityLB: $('input[name=facilityLB]:checked').val()
+	}, function() 
+	{ 
+		setTableStyles();
+		hideLoader();
+		showById( 'contentDiv' );
+	});
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-12-07 13:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-12-14 05:49:05 +0000
@@ -38,6 +38,9 @@
 	#if( $auth.hasAccess( "dhis-web-caseentry", "generateTabularReport" ) )
 	<li><a href="app/index.html"> $i18n.getString( "tabular_report" )&nbsp;</a></li>
 	#end
+	#if( $auth.hasAccess( "dhis-web-caseentry", "statisticalProgramReportSelect" ) )
+	<li><a href="statisticalProgramReportSelect.action"> $i18n.getString( "statistical_program" )&nbsp;</a></li>
+	#end
 </ul>
 
 #if( $auth.hasAccess( "dhis-web-caseentry", "caseAggregationForm" ) )	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm	2012-12-13 08:48:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm	2012-12-14 05:49:05 +0000
@@ -1,17 +1,7 @@
-<table class='contentProviderTable' style="width:600px;" >
-	<tr class="bold"> 
-		<td>$i18n.getString( "program_stage")</td>
-		<td align="center">$i18n.getString("number_of_completed_events")</td>
-	</tr>
-	#foreach($programStage in $program.programStages)
+<table>
 	<tr>
-		<td class='text-column'>$encoder.htmlEncode($programStage.name)</td>
-		<td align="center">$completedMap.get($programStage.id)</td>
-	</tr>
-	#end
-	<tr class="bold">
-		<td class='text-column'>$i18n.getString( "total_result" )</td>
-		<td align="center">
+		<td style="text-align:left">$i18n.getString( "total_result" ): </td>
+		<td>
 			#if($!total)
 				$total
 			#else
@@ -21,7 +11,6 @@
 	</tr>
 </table>
 
-
 #if( $programInstances && $programInstances.size() > 0 )
 <p>#parse( "/dhis-web-caseentry/colorHelp.vm" )</p>
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportsMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportsMenu.vm	2012-12-07 13:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportsMenu.vm	2012-12-14 05:49:05 +0000
@@ -7,6 +7,9 @@
 	#if( $auth.hasAccess( "dhis-web-caseentry", "generateTabularReport" ) )
 		<li><a href="app/index.html"> $i18n.getString( "tabular_report" )&nbsp;</a></li> 
 	#end
+	#if( $auth.hasAccess( "dhis-web-caseentry", "statisticalProgramReportSelect" ) )
+		<li><a href="statisticalProgramReportSelect.action"> $i18n.getString( "statistical_program" )&nbsp;</a></li>
+	#end
 </ul>
 
 <br>

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReport.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReport.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReport.vm	2012-12-14 05:49:05 +0000
@@ -0,0 +1,40 @@
+<h3>$encoder.htmlEncode($program.name) ( <span id="dateLbl"></span> )</h3>
+<h5>
+	$i18n.getString( "total_result" ): #if($!total) $total #else 0 #end
+</h5>
+
+<script>
+	setInnerHTML("dateLbl", getFieldValue("startDate") + " - " + getFieldValue("endDate") );
+</script>
+
+<table class='listTable gridTable'>
+	
+	#if($total>0)
+		<thead>
+			<tr> 
+				<th style="text-align:left">$i18n.getString( "program_stage")</th>
+				<th>$i18n.getString("events_completed")</th>
+				<th>$i18n.getString("percent")</th>
+			</tr>
+		</thead>
+		<tbody>
+			#set( $mark = false ) 
+			#foreach($programStage in $program.programStages)
+				#set($completeEventsNo = $completedMap.get($programStage.id) )
+			<tr #alternate( $mark )>
+				<td style="text-align:left">$encoder.htmlEncode($programStage.name)</td>
+				<td>$completeEventsNo</td>
+				<td id="rate$programStage.id"></td>
+				<script>
+					var rate = ($completeEventsNo/$total * 100);
+					if(!isInt( rate )){
+						rate = rate.toFixed(2);
+					}
+					setInnerHTML("rate$programStage.id", rate + "%");
+				</script>
+			</tr>
+			#set( $mark = !$mark )
+			#end
+		</tbody>
+	#end
+</table>

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReportSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReportSelect.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramReportSelect.vm	2012-12-14 05:49:05 +0000
@@ -0,0 +1,79 @@
+<script>
+	jQuery(document).ready(	function(){
+		validation( 'reportForm', function(form){
+			generatedStatisticalProgramReport();
+		}); 
+		datePickerInRange( 'startDate' , 'endDate' );
+	});		
+</script>
+
+<h3>$i18n.getString( "statistical_program_report" )</h3>
+<form id="reportForm" name="reportForm" method="post">
+
+<div class="inputCriteria" style="width:600px;height:180px;margin-bottom:20px;">
+
+<table>	
+    <tr>
+	  <td><label>$i18n.getString( "orgunit_boundary" )</label></td>
+	  <td><input type="text" readonly="readonly" id='orgunitname' name='orgunitname' #if($!orgunit) value="$!orgunit.name" #else value="[$i18n.getString( 'please_select' )]" #end ></td>
+    </tr>
+    
+    <tr>
+        <td><label for="programId">$i18n.getString( "program" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+        <td>
+            <select id="programId" name="programId" #if($!programs) #else disabled #end class="{validate:{required:true}}" >
+				<option value=''>[$i18n.getString('please_select_a_program')]</option>
+				#foreach( $program in $programs )
+				<option value='$program.id'>$program.name</option>
+				#end
+			</select>
+        </td>
+    </tr>
+        
+    <tr>
+        <td><label>$i18n.getString( "start_date" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+        <td>
+            <input type="text" id="startDate" name="startDate" />
+        </td>
+    </tr>
+    
+    <tr>
+        <td><label>$i18n.getString( "end_date" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+        <td>
+            <input type="text" id="endDate" name="endDate" />
+        </td>      
+    </tr>
+	
+	<tr>
+		<td>$i18n.getString('use_data_from_level')</td>
+		<td>
+			<input type="radio" id='facilityLB1' name="facilityLB" value="selected" checked> $i18n.getString('selected')
+			<input type="radio" id='facilityLB2' name="facilityLB" value="childrenOnly"> $i18n.getString('children_only')
+			<input type="radio" id='facilityLB3' name="facilityLB" value="all"> $i18n.getString('all')
+		</td>
+	</tr>
+    
+    <tr>
+    	<td></td>
+    	<td><input type="submit" id='generateBtn' name='generateBtn' #if($!programs) #else disabled #end value="$i18n.getString( 'generate' )" style="width:10em" />
+    		<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='index.action'" style="width:10em"/>
+    	</td>
+    </tr>	                		
+</table>
+
+</div>
+
+</form>
+
+#parse( "dhis-web-commons/loader/loader.vm" )
+
+<div id="contentDiv"></div>
+
+<script type="text/javascript">   
+    var i18n_report_generation_failed = '$encoder.jsEscape( $i18n.getString( "report_generation_failed" ), "'")';    
+	var i18n_please_select_a_program = '[' + '$encoder.jsEscape( $i18n.getString( "please_select_a_program" ), "'")' + ']'; 
+	var i18n_reports = '$encoder.jsEscape( $i18n.getString( "reports" ), "'")';    	
+	var i18n_patient_profile = '$encoder.jsEscape( $i18n.getString( "patient_profile" ), "'")';    	
+	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ), "'")';    	
+	var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
+</script>   

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-12-07 13:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-12-14 05:49:05 +0000
@@ -282,7 +282,6 @@
   padding-top:3px;
   padding-bottom:3px;
   border-bottom:1px solid #cad5e5;
-  cursor:pointer;
 }
 
 div.event-dashboard
@@ -498,3 +497,10 @@
   width:60%;
   overflow:hidden;
 }
+
+.gridTable th, .gridTable td {
+    line-height: 170%;
+    text-align: center;
+    width: 150px;
+}
+

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2012-12-10 13:53:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2012-12-14 05:49:05 +0000
@@ -172,6 +172,7 @@
 F_ACTIVITY_PLAN_EXPORT = Export Activity Plan to XLS file
 F_GENERATE_ACTIVITY_PLANS = Generate Activity Plans
 F_GENERATE_PROGRAM_SUMMARY_REPORT = Generate Program Summary Report
+F_GENERATE_STATISTICAL_PROGRAM_REPORT = Generate Statistical Program Report
 F_GENERATE_BENEFICIARY_TABULAR_REPORT = Generate Person Tabular report
 F_PATIENT_AGGREGATION = Person Aggregation
 F_GENERATE_PATIENT_CHART = Generate Person Chart