=== 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 searchProgramStageInstances( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ); - Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ); + Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ); - Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ); + Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ); int countProgramStageInstances( ProgramStage programStage, Map searchingKeys, Collection 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 dataElements, - Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, + Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ) { List 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 dataElements, - Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, + Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ) { List 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 programStageInstances, - List dataElements, Date startDate, Date endDate, I18nFormat format, I18n i18n ) + private Grid createTabularGrid( Integer level, ProgramStage programStage, + List programStageInstances, List 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" /> + === 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 orgunitIds = new HashSet(); 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 programs; @@ -80,6 +90,13 @@ return orgunit; } + private List levels; + + public List 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"> + === 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 - style/dataEntry.css,../dhis-web-caseentry/style/patient.css + style/dataEntry.css,style/patient.css F_NAME_BASED_DATA_ENTRY @@ -247,7 +247,7 @@ /dhis-web-caseentry/reportSelect.vm /dhis-web-caseentry/reportsMenu.vm ../dhis-web-commons/ouwt/ouwt.js,javascript/report.js - ../dhis-web-caseentry/style/report.css + style/report.css F_GENERATE_PROGRAM_SUMMARY_REPORT @@ -272,7 +272,7 @@ /dhis-web-caseentry/tabularReportSelect.vm /dhis-web-caseentry/reportsMenu.vm ../dhis-web-commons/ouwt/ouwt.js,javascript/tabularReport.js,javascript/commons.js - ../dhis-web-caseentry/style/report.css + style/report.css F_GENERATE_BENEFICIARY_TABULAR_REPORT === 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 @@ #foreach( $col in $row ) - #set( $index = ( $velocityCount - 1 ) ) + #set( $index = ( $velocityCount - 1 ) ) #if( $anonymous == "false" && ( $index == $row.size() - 1 ) ) #if($col) $i18n.getString( "patient_details_and_history" ) === 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 @@

$i18n.getString( "tabular_report" )

-

+

-
+
@@ -30,7 +30,7 @@ $i18n.getString( "orgunit_level" ) + + + + + @@ -93,7 +106,7 @@
- @@ -39,6 +39,19 @@
+ $i18n.getString( "orgunit_hiererachy_included_on" ) + + +
@@ -82,10 +95,10 @@
- -
- - + +
+ +
-

@@ -117,7 +130,9 @@
-
+ #parse( "dhis-web-commons/loader/loader.vm" ) +
+