← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8413: Exception thrown when to load patient history if displayIncident property of program is null

 

------------------------------------------------------------
revno: 8413
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-10-07 10:09:51 +0700
message:
  Exception thrown when to load patient history if displayIncident property of program is null
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.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/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2012-10-06 16:13:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2012-10-07 03:09:51 +0000
@@ -331,13 +331,14 @@
         grid.addValue( programInstance.getProgram().getDateOfEnrollmentDescription() );
         grid.addValue( format.formatDate( programInstance.getEnrollmentDate() ) );
 
-        if ( programInstance.getProgram().getDisplayIncidentDate() )
+        if ( programInstance.getProgram().getDisplayIncidentDate() != null
+            && programInstance.getProgram().getDisplayIncidentDate() )
         {
             grid.addRow();
             grid.addValue( programInstance.getProgram().getDateOfIncidentDescription() );
             grid.addValue( format.formatDate( programInstance.getDateOfIncident() ) );
         }
-        
+
         getProgramStageInstancesReport( grid, programInstance, format, i18n );
 
         return grid;
@@ -366,17 +367,16 @@
             // due-date && report-date
             // -----------------------------------------------------------------
 
-            Date executionDate = programStageInstance.getExecutionDate();
-            String executionDateValue = (executionDate != null) ? format.formatDate( programStageInstance
-                .getExecutionDate() ) : "[" + i18n.getString( "none" ) + "]";
-
             grid.addRow();
             grid.addValue( i18n.getString( "due_date" ) );
             grid.addValue( format.formatDate( programStageInstance.getDueDate() ) );
 
-            grid.addRow();
-            grid.addValue( programStageInstance.getProgramStage().getReportDateDescription() );
-            grid.addValue( executionDateValue );
+            if ( programStageInstance.getExecutionDate() != null )
+            {
+                grid.addRow();
+                grid.addValue( programStageInstance.getProgramStage().getReportDateDescription() );
+                grid.addValue( format.formatDate( programStageInstance.getExecutionDate() ) );
+            }
 
             // -----------------------------------------------------------------
             // Values

=== 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-10-06 16:13:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2012-10-07 03:09:51 +0000
@@ -187,10 +187,10 @@
         {
             orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren(
                 organisationUnit.getId() ) );
+            orgunitIds.remove( organisationUnit.getId() );
         }
         else
         {
-            orgunitIds.add( organisationUnit.getId() );
             orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren(
                 organisationUnit.getId() ) );
         }

=== 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-10-06 16:13:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-10-07 03:09:51 +0000
@@ -294,11 +294,11 @@
                 OrganisationUnit selectedOrgunit = organisationUnitService.getOrganisationUnit( orgunitId );
                 orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren(
                     selectedOrgunit.getId() ) );
+                orgunitIds.remove( orgunitId );
             }
         }
         else
         {
-            organisationUnits.addAll( orgunitIds );
             for ( Integer orgunitId : orgunitIds )
             {
                 OrganisationUnit selectedOrgunit = organisationUnitService.getOrganisationUnit( orgunitId );