← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6361: (patient) Include orgunit hiererachy in Tabular report.

 

------------------------------------------------------------
revno: 6361
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-03-23 10:46:08 +0700
message:
  (patient) Include orgunit hiererachy in Tabular report.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  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/DefaultProgramValidationService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.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/javascript/tabularReport.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.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-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2012-03-10 05:06:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2012-03-23 03:46:08 +0000
@@ -89,9 +89,9 @@
             
     List<ProgramStageInstance> searchProgramStageInstances( ProgramStage programStage, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max );
 
-    Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n );
+    Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n );
     
-    Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n );
+    Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n );
 
     int countProgramStageInstances( ProgramStage programStage, Map<Integer,String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate );
     

=== 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	2012-03-10 05:06:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2012-03-23 03:46:08 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
@@ -72,6 +73,13 @@
         this.patientDataValueService = patientDataValueService;
     }
 
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
     // -------------------------------------------------------------------------
     // Implementation methods
     // -------------------------------------------------------------------------
@@ -203,23 +211,25 @@
     }
 
     public Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements,
-        Map<Integer, String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate,
+        Map<Integer, String> searchingKeys, Collection<Integer> orgunitIds, int level, Date startDate, Date endDate,
         boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n )
     {
         List<ProgramStageInstance> programStageInstances = searchProgramStageInstances( programStage, searchingKeys,
             orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc, min, max );
 
-        return createTabularGrid( programStage, programStageInstances, dataElements, startDate, endDate, format, i18n );
+        return createTabularGrid( level, programStage, programStageInstances, dataElements, startDate, endDate, format,
+            i18n );
     }
 
     public Grid getTabularReport( ProgramStage programStage, List<DataElement> dataElements,
-        Map<Integer, String> searchingKeys, Collection<Integer> orgunitIds, Date startDate, Date endDate,
+        Map<Integer, String> searchingKeys, Collection<Integer> orgunitIds, int level, Date startDate, Date endDate,
         boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n )
     {
         List<ProgramStageInstance> programStageInstances = searchProgramStageInstances( programStage, searchingKeys,
             orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc );
 
-        return createTabularGrid( programStage, programStageInstances, dataElements, startDate, endDate, format, i18n );
+        return createTabularGrid( level, programStage, programStageInstances, dataElements, startDate, endDate, format,
+            i18n );
     }
 
     @Override
@@ -300,8 +310,9 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
-    private Grid createTabularGrid( ProgramStage programStage, List<ProgramStageInstance> programStageInstances,
-        List<DataElement> dataElements, Date startDate, Date endDate, I18nFormat format, I18n i18n )
+    private Grid createTabularGrid( Integer level, ProgramStage programStage,
+        List<ProgramStageInstance> programStageInstances, List<DataElement> dataElements, Date startDate, Date endDate,
+        I18nFormat format, I18n i18n )
     {
         Grid grid = new ListGrid();
 
@@ -343,7 +354,7 @@
             for ( ProgramStageInstance programStageInstance : programStageInstances )
             {
                 grid.addRow();
-                grid.addValue( programStageInstance.getOrganisationUnit().getName() );
+                grid.addValue( getHierarchyOrgunit( programStageInstance.getOrganisationUnit(), level ) );
                 grid.addValue( format.formatDate( programStageInstance.getExecutionDate() ) );
 
                 for ( DataElement dataElement : dataElements )
@@ -367,18 +378,30 @@
                         grid.addValue( "" );
                     }
                 }
-
-                if ( programStageInstance.getProgramInstance().getPatient() != null )
+                
+                if ( !anonymous )
                 {
                     grid.addValue( programStageInstance.getProgramInstance().getPatient().getId() );
                 }
-                else if ( !anonymous )
-                {
-                    grid.addValue( "" );
-                }
             }
         }
 
         return grid;
     }
+
+    private String getHierarchyOrgunit( OrganisationUnit orgunit, int level )
+    {
+        String hierarchyOrgunit = orgunit.getName();
+        
+        orgunit = orgunit.getParent();
+        
+        while ( orgunit != null && organisationUnitService.getLevelOfOrganisationUnit( orgunit.getId() ) >= level )
+        {
+            hierarchyOrgunit = orgunit.getName() + " / " + hierarchyOrgunit;
+
+            orgunit = orgunit.getParent();
+        }
+
+        return hierarchyOrgunit;
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2012-03-22 14:17:16 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2012-03-23 03:46:08 +0000
@@ -50,7 +50,6 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
 import org.nfunk.jep.JEP;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-03-09 03:20:39 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-03-23 03:46:08 +0000
@@ -210,6 +210,8 @@
 			ref="org.hisp.dhis.program.ProgramStageInstanceStore" />
 		<property name="patientDataValueService"
 			ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.program.ProgramInstanceService" class="org.hisp.dhis.program.DefaultProgramInstanceService">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-03-12 07:03:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-03-23 03:46:08 +0000
@@ -150,6 +150,13 @@
         this.orderByExecutionDateByAsc = orderByExecutionDateByAsc;
     }
 
+    private Integer level;
+
+    public void setLevel( Integer level )
+    {
+        this.level = level;
+    }
+
     private Grid grid;
 
     public Grid getGrid()
@@ -211,7 +218,7 @@
         // ---------------------------------------------------------------------
 
         OrganisationUnit selectedOrgunit = selectedStateManager.getSelectedOrganisationUnit();
-        
+
         Set<Integer> orgunitIds = new HashSet<Integer>();
 
         if ( facilityLB.equals( "selected" ) )
@@ -231,7 +238,7 @@
                 orgunitIds.remove( selectedOrgunit.getId() );
             }
         }
-        
+
         // ---------------------------------------------------------------------
         // Get program-stage, start-date, end-date
         // ---------------------------------------------------------------------
@@ -278,12 +285,13 @@
             this.paging = createPaging( total );
 
             grid = programStageInstanceService.getTabularReport( programStage, dataElements, searchingKeys, orgunitIds,
-                startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, paging.getStartPos(), paging.getPageSize(), format, i18n );
+                level, startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, paging
+                    .getStartPos(), paging.getPageSize(), format, i18n );
             return SUCCESS;
         }
 
         grid = programStageInstanceService.getTabularReport( programStage, dataElements, searchingKeys, orgunitIds,
-            startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, format, i18n );
+            level, startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, format, i18n );
 
         return type;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java	2012-03-10 05:06:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java	2012-03-23 03:46:08 +0000
@@ -28,9 +28,12 @@
 package org.hisp.dhis.caseentry.action.report;
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.caseentry.state.SelectedStateManager;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramService;
 
@@ -47,7 +50,7 @@
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
-    
+
     private SelectedStateManager selectedStateManager;
 
     public void setSelectedStateManager( SelectedStateManager selectedStateManager )
@@ -55,6 +58,13 @@
         this.selectedStateManager = selectedStateManager;
     }
 
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
     private ProgramService programService;
 
     public void setProgramService( ProgramService programService )
@@ -63,7 +73,7 @@
     }
 
     // -------------------------------------------------------------------------
-    // Dependencies
+    // Input/Output
     // -------------------------------------------------------------------------
 
     private Collection<Program> programs;
@@ -80,6 +90,13 @@
         return orgunit;
     }
 
+    private List<OrganisationUnitLevel> levels;
+
+    public List<OrganisationUnitLevel> getLevels()
+    {
+        return levels;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -88,6 +105,8 @@
     {
         orgunit = selectedStateManager.getSelectedOrganisationUnit();
 
+        levels = organisationUnitService.getFilledOrganisationUnitLevels();
+
         programs = programService.getAllPrograms();
 
         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-03-15 09:25:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-03-23 03:46:08 +0000
@@ -253,6 +253,8 @@
 		scope="prototype">
 		<property name="selectedStateManager"
 			ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 		<property name="programService"
 			ref="org.hisp.dhis.program.ProgramService" />
 	</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	2012-03-22 14:17:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-03-23 03:46:08 +0000
@@ -284,4 +284,6 @@
 V=Verified
 D=Declared
 A=Approximated
-some_data_element_not_exist = Some data element is not exist
\ No newline at end of file
+some_data_element_not_exist = Some data element is not exist
+orgunit_hiererachy_included_on = Organisation unit hiererachy included on
+level = Level
\ 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-03-13 06:09:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-03-23 03:46:08 +0000
@@ -114,7 +114,7 @@
 				,javascript/anonymousRegistration.js
 				,javascript/entry.js
 				,../dhis-web-commons/javascripts/date.js</param>
-			<param name="stylesheets">style/dataEntry.css,../dhis-web-caseentry/style/patient.css</param>
+			<param name="stylesheets">style/dataEntry.css,style/patient.css</param>
 			<param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>
 		</action>
 		
@@ -247,7 +247,7 @@
 			<param name="page">/dhis-web-caseentry/reportSelect.vm</param>
 			<param name="menu">/dhis-web-caseentry/reportsMenu.vm</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/report.js</param>
-			<param name="stylesheets">../dhis-web-caseentry/style/report.css</param>
+			<param name="stylesheets">style/report.css</param>
 			<param name="requiredAuthorities">F_GENERATE_PROGRAM_SUMMARY_REPORT</param>
 		</action>
 
@@ -272,7 +272,7 @@
 			<param name="page">/dhis-web-caseentry/tabularReportSelect.vm</param>
 			<param name="menu">/dhis-web-caseentry/reportsMenu.vm</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/tabularReport.js,javascript/commons.js</param>
-			<param name="stylesheets">../dhis-web-caseentry/style/report.css</param>
+			<param name="stylesheets">style/report.css</param>
 			<param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
 		</action>
 		

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js	2012-03-22 01:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js	2012-03-23 03:46:08 +0000
@@ -315,7 +315,8 @@
 				+ "&endDate=" + getFieldValue('endDate')
 				+ "&facilityLB=" + getFieldValue('facilityLB')
 				+ "&orderByOrgunitAsc=" + orderByOrgunitAsc
-				+ "&orderByExecutionDateByAsc=" + orderByExecutionDateByAsc;
+				+ "&orderByExecutionDateByAsc=" + orderByExecutionDateByAsc
+				+ "&level=" + getFieldValue('level');
 }
 
 function getFormula( value )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm	2012-03-10 05:06:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm	2012-03-23 03:46:08 +0000
@@ -3,6 +3,7 @@
 #set( $i = 1 )
 
 #set( $anonymous = "true")
+
 #if( $grid.getVisibleHeaders().size() <  $grid.getHeaders().size() )
 	#set( $anonymous = "false" )
 #end
@@ -15,7 +16,7 @@
 		</td>
 		#foreach( $col in $row )
 			<td>
-				#set( $index = ( $velocityCount - 1 ) )
+				#set( $index = ( $velocityCount - 1 ) ) 
 				#if( $anonymous == "false" && ( $index == $row.size() - 1 ) )
 					#if($col)
 					<a href="javascript:showPatientHistory( '$col' )" title='$i18n.getString( "patient_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "patient_details_and_history" )'></a>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css	2012-03-12 04:19:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css	2012-03-23 03:46:08 +0000
@@ -40,4 +40,14 @@
 
 .small-button { font-size: .8em !important; }
 
-.ui-autocomplete { height: 100px; overflow-y: scroll; overflow-x: hidden;}
\ No newline at end of file
+.ui-autocomplete { height: 100px; overflow-y: scroll; overflow-x: hidden;}
+
+.hidden 
+{
+	display: none;
+}
+
+.visible
+{
+	display: block;
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm	2012-03-12 13:38:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm	2012-03-23 03:46:08 +0000
@@ -15,9 +15,9 @@
 
 <h3>$i18n.getString( "tabular_report" )</h3>
 <form id="reportForm" name="reportForm" method="post">
-<p><input type="button" value="$i18n.getString('data')" onclick="showCriteria();" style="width:150px;" ></p>
+<p><input type="button" value="$i18n.getString('data')" onclick="showCriteria();" ></p>
 
-<div class="inputCriteria" id='criteriaDiv' style="width:550px;height:460px;margin-bottom:20px;">
+<div class="inputCriteria" id='criteriaDiv' style="width:600px;height:480px;margin-bottom:20px;">
 
 <table>	
     <tr>
@@ -30,7 +30,7 @@
 		   $i18n.getString( "orgunit_level" )
 		</td>
 		<td>
-			<select id="facilityLB" name="facilityLB" style="width: 30em">
+			<select id="facilityLB" name="facilityLB">
 				<option value="all" selected="selected" >$i18n.getString( "all" )</option>
 				<option value="childrenOnly" >$i18n.getString( "children_only" )</option>
 				<option value="selected" >$i18n.getString( "selected" )</option>
@@ -39,6 +39,19 @@
 	</tr>
 	
 	<tr>
+		<td>
+		   $i18n.getString( "orgunit_hiererachy_included_on" )
+		</td>
+		<td>
+			<select id="level" name="level">
+				#foreach( $level in $levels )
+					<option value="$level.level">$i18n.getString( "level" ) $level.level</option>
+				#end
+			</select>
+		</td>
+	</tr>
+	
+	<tr>
         <td><label>$i18n.getString( "start_date" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
         <td colspan='2'>
             <input type="text" id="startDate" name="startDate" />
@@ -82,10 +95,10 @@
 	<tr>
         <td></td>
 		<td> 
-			<input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add_selected' )" style="width:120px" onclick="moveSelectedById( 'availableDataElementIds', 'dataElementIds' )" class="button" />
-            <input type="button" value="$i18n.getString( 'add_all' )" title="$i18n.getString( 'add_all' )" style="width:120px" onclick="moveAllById( 'availableDataElementIds', 'dataElementIds' )" class="button" /> <br>
-            <input type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove_selected' )" style="width:120px" onclick="moveSelectedById( 'dataElementIds', 'availableDataElementIds' )" class="button" />
-            <input type="button" value="$i18n.getString( 'remove_all' )" title="$i18n.getString( 'remove_all' )" style="width:120px" onclick="moveAllById( 'dataElementIds', 'availableDataElementIds' )" class="button" />
+			<input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add_selected' )" onclick="moveSelectedById( 'availableDataElementIds', 'dataElementIds' )" class="button" />
+            <input type="button" value="$i18n.getString( 'add_all' )" title="$i18n.getString( 'add_all' )" onclick="moveAllById( 'availableDataElementIds', 'dataElementIds' )" class="button" /> <br>
+            <input type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove_selected' )" onclick="moveSelectedById( 'dataElementIds', 'availableDataElementIds' )" class="button" />
+            <input type="button" value="$i18n.getString( 'remove_all' )" title="$i18n.getString( 'remove_all' )" onclick="moveAllById( 'dataElementIds', 'availableDataElementIds' )" class="button" />
         </td>
     </tr>
 	
@@ -93,7 +106,7 @@
 		<td><label>$i18n.getString( "selected_data_elements" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
         <td>
 			<select id="dataElementIds" name="dataElementIds" multiple size='6' ondblclick="moveSelectedById( 'dataElementIds', 'availableDataElementIds' )" ></select>
-			<select id="memberValidator" multiple="multiple" style="display:none" class="{validate:{required:true}}"/>
+			<select id="memberValidator" multiple="multiple" class="{validate:{required:true}} hidden"/>
         </td> 
 		<td style="width:30px; text-align:center">
             <a href="javascript:moveUpSelectedOption('dataElementIds')"><img src="../images/move_up.png"/></a><br/><br/>
@@ -117,7 +130,9 @@
 <span id="message"></span>
 <div id="detailsInfo"></div>
 
-<div id="contentDiv"></div>
+	#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" ), "'")';