← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20372: Program indicator, added property missingValueReplacement

 

------------------------------------------------------------
revno: 20372
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-25 19:51:47 +0200
message:
  Program indicator, added property missingValueReplacement
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.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/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-09-24 19:18:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-09-25 17:51:47 +0000
@@ -102,6 +102,12 @@
      */
     private Integer decimals;
 
+    /**
+     * Value to use in expression when data element and attribute values are not
+     * present.
+     */
+    private Integer missingValueReplacement;
+    
     private Boolean displayInForm;
 
     // -------------------------------------------------------------------------
@@ -218,6 +224,19 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public Integer getMissingValueReplacement()
+    {
+        return missingValueReplacement;
+    }
+
+    public void setMissingValueReplacement( Integer missingValueReplacement )
+    {
+        this.missingValueReplacement = missingValueReplacement;
+    }
+
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getDisplayInForm()
     {
         return displayInForm;
@@ -243,6 +262,7 @@
                 expression = programIndicator.getExpression();
                 filter = programIndicator.getFilter();
                 decimals = programIndicator.getDecimals();
+                missingValueReplacement = programIndicator.getMissingValueReplacement();
                 displayInForm = programIndicator.getDisplayInForm();
             }
             else if ( strategy.isMerge() )
@@ -251,6 +271,7 @@
                 expression = programIndicator.getExpression() == null ? expression : programIndicator.getExpression();
                 filter = programIndicator.getFilter() == null ? filter : programIndicator.getFilter();
                 decimals = programIndicator.getDecimals() == null ? decimals : programIndicator.getDecimals();
+                missingValueReplacement = programIndicator.getMissingValueReplacement() == null ? missingValueReplacement : programIndicator.getMissingValueReplacement();
                 displayInForm = programIndicator.getDisplayInForm() == null ? displayInForm : programIndicator.getDisplayInForm();
             }
         }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml	2015-09-18 10:16:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml	2015-09-25 17:51:47 +0000
@@ -36,6 +36,8 @@
     <property name="decimals" />
 
     <property name="displayInForm" />
+    
+    <property name="missingValueReplacement" column="missingvaluereplacement" />
         
     <!-- Access properties -->
     <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_programindicator_userid" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java	2015-09-18 10:16:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java	2015-09-25 17:51:47 +0000
@@ -140,6 +140,13 @@
     {
         this.displayInForm = displayInForm;
     }
+    
+    private Integer missingValueReplacement;
+
+    public void setMissingValueReplacement( Integer missingValueReplacement )
+    {
+        this.missingValueReplacement = missingValueReplacement;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -162,6 +169,7 @@
         indicator.setAggregationType( AggregationType.valueOf( aggregationType ) );
         indicator.setDecimals( decimals );
         indicator.setDisplayInForm( displayInForm );
+        indicator.setMissingValueReplacement( missingValueReplacement );
 
         programIndicatorService.addProgramIndicator( indicator );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java	2015-09-23 12:27:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java	2015-09-25 17:51:47 +0000
@@ -134,6 +134,13 @@
         return programId;
     }
 
+    private Integer missingValueReplacement;
+
+    public void setMissingValueReplacement( Integer missingValueReplacement )
+    {
+        this.missingValueReplacement = missingValueReplacement;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -153,6 +160,7 @@
         indicator.setAggregationType( AggregationType.valueOf( aggregationType ) );
         indicator.setDecimals( decimals );
         indicator.setDisplayInForm( displayInForm );
+        indicator.setMissingValueReplacement( missingValueReplacement );
 
         programIndicatorService.updateProgramIndicator( indicator );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2015-09-09 20:18:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2015-09-25 17:51:47 +0000
@@ -551,4 +551,5 @@
 enrollment=Enrollment
 tracked_entity_instance=Tracked entity instance
 event_output_type=Event output type
-category_combo=Combination of categories
\ No newline at end of file
+category_combo=Combination of categories
+missing_value_replacement=Missing value replacement
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm	2015-09-18 12:14:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm	2015-09-25 17:51:47 +0000
@@ -78,6 +78,16 @@
 	        </td>
 			<td></td>
 	    </tr>
+	    <tr>
+	        <td><label for="missingValueReplacement">$i18n.getString( "missing_value_replacement" )</label></td>
+	        <td>
+	            <select id="missingValueReplacement" name="missingValueReplacement">
+	                <option value="0">0</option>
+	                <option value="1">1</option>
+	                <option value="-1">-1</option>
+	            </select>
+	        </td>
+	    </tr>
 		<tr>
 			<td><label for="displayInForm">$i18n.getString( "display_in_form" )</label></td>
 			<td><input type="checkbox" id="displayInForm" name="displayInForm" value="true"></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-09-18 12:14:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-09-25 17:51:47 +0000
@@ -77,6 +77,16 @@
           </select>
 		</td>
     </tr>
+    <tr>
+        <td><label for="missingValueReplacement">$i18n.getString( "missing_value_replacement" )</label></td>
+        <td>
+            <select id="missingValueReplacement" name="missingValueReplacement">
+                <option value="0"#if( $programIndicator.missingValueReplacement == 0 ) selected="selected"#end>0</option>
+                <option value="1"#if( $programIndicator.missingValueReplacement == 1 ) selected="selected"#end>1</option>
+                <option value="-1"#if( $programIndicator.missingValueReplacement == -1 ) selected="selected"#end>-1</option>
+            </select>
+        </td>
+    </tr>
 	<tr>
 		<td><label for="displayInForm">$i18n.getString( "display_in_form" )</label></td>
 		<td><input type="checkbox" id="displayInForm" name="displayInForm" value="true"#if( $programIndicator.displayInForm ) checked="checked"#end></td>