← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 19881
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-08-28 12:23:48 +0200
message:
  Program indicator, added property eventOutputType
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.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/programIndicatorForm.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/analytics/EventOutputType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java	2015-03-23 09:24:15 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java	2015-08-28 10:23:48 +0000
@@ -33,5 +33,5 @@
  */
 public enum EventOutputType
 {
-    EVENT, ENROLLMENT, TRACKED_ENTITY_INSTANCE
+    EVENT, ENROLLMENT, TRACKED_ENTITY_INSTANCE;
 }

=== 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-08-27 17:18:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-08-28 10:23:48 +0000
@@ -32,6 +32,7 @@
 import java.util.regex.Pattern;
 
 import org.hisp.dhis.analytics.AggregationType;
+import org.hisp.dhis.analytics.EventOutputType;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -97,6 +98,8 @@
     
     private AggregationType aggregationType;
 
+    private EventOutputType eventOutputType;
+        
     /**
      * Number of decimals to use for indicator value, null implies default.
      */
@@ -223,6 +226,19 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public EventOutputType getEventOutputType()
+    {
+        return eventOutputType;
+    }
+
+    public void setEventOutputType( EventOutputType eventOutputType )
+    {
+        this.eventOutputType = eventOutputType;
+    }
+
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Integer getDecimals()
     {
         return decimals;

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2015-08-21 22:55:56 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2015-08-28 10:23:48 +0000
@@ -328,6 +328,8 @@
 
     /**
      * Returns the count clause based on the output type.
+     * 
+     * TODO include output type if aggregation type is count
      */
     private String getAggregateClause( EventQueryParams params )
     {

=== 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-08-21 02:55:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml	2015-08-28 10:23:48 +0000
@@ -35,6 +35,13 @@
 		</type> 
 	</property>
     
+    <property name="eventOutputType" length="40">
+		<type name="org.hibernate.type.EnumType">
+			<param name="enumClass">org.hisp.dhis.analytics.EventOutputType</param>
+			<param name="type">12</param>
+		</type> 
+	</property>
+    
     <property name="decimals" />
 
     <property name="displayInForm" />

=== 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-08-21 02:55:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java	2015-08-28 10:23:48 +0000
@@ -33,6 +33,7 @@
 
 import org.apache.commons.lang3.StringUtils;
 import org.hisp.dhis.analytics.AggregationType;
+import org.hisp.dhis.analytics.EventOutputType;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramIndicator;
 import org.hisp.dhis.program.ProgramIndicatorService;
@@ -137,6 +138,13 @@
         this.aggregationType = aggregationType;
     }
 
+    private String eventOutputType;
+    
+    public void setEventOutputType( String eventOutputType )
+    {
+        this.eventOutputType = eventOutputType;
+    }
+
     private Integer decimals;
 
     public void setDecimals( Integer decimals )
@@ -192,6 +200,7 @@
         indicator.setExpression( StringUtils.trimToNull( expression ) );
         indicator.setFilter( StringUtils.trimToNull( filter ) );
         indicator.setAggregationType( AggregationType.valueOf( aggregationType ) );
+        indicator.setEventOutputType( EventOutputType.valueOf( eventOutputType ) );
         indicator.setDecimals( decimals );
         indicator.setDisplayInForm( displayInForm );
         indicator.setRootDate( StringUtils.trimToNull( rootDate ) );

=== 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-08-21 02:55:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java	2015-08-28 10:23:48 +0000
@@ -33,6 +33,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.analytics.AggregationType;
+import org.hisp.dhis.analytics.EventOutputType;
 import org.hisp.dhis.program.ProgramIndicator;
 import org.hisp.dhis.program.ProgramIndicatorService;
 
@@ -123,6 +124,13 @@
         this.aggregationType = aggregationType;
     }
 
+    private String eventOutputType;
+    
+    public void setEventOutputType( String eventOutputType )
+    {
+        this.eventOutputType = eventOutputType;
+    }
+
     private Integer decimals;
 
     public void setDecimals( Integer decimals )
@@ -183,6 +191,7 @@
         indicator.setExpression( StringUtils.trimToNull( expression ) );
         indicator.setFilter( StringUtils.trimToNull( filter ) );
         indicator.setAggregationType( AggregationType.valueOf( aggregationType ) );
+        indicator.setEventOutputType( EventOutputType.valueOf( eventOutputType ) );
         indicator.setDecimals( decimals );
         indicator.setDisplayInForm( displayInForm );
         indicator.setRootDate( StringUtils.trimToNull( rootDate ) );

=== 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-08-25 09:48:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties	2015-08-28 10:23:48 +0000
@@ -547,4 +547,8 @@
 design_custom_registration_form=Design custom registration form
 program_registration_form=Program registration form
 aggregation_type=Aggregation type
-display_in_form=Display in form
\ No newline at end of file
+display_in_form=Display in form
+event=Event
+enrollment=Enrollment
+tracked_entity_instance=Tracked entity instance
+event_output_type=Event output type
\ 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-08-21 12:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm	2015-08-28 10:23:48 +0000
@@ -77,6 +77,16 @@
 	            </select>
 	        </td>
 	    </tr>
+	    <tr>
+	    	<td><label for="eventOutputType">$i18n.getString( "event_output_type" )</label></td>
+	    	<td>
+	    		<select id="eventOutputType" name="eventOutputType">
+	    			<option value="EVENT">$i18n.getString( "event" )</option>
+	    			<option value="ENROLLMENT">$i18n.getString( "enrollment" )</option>
+	    			<option value="TRACKED_ENTITY_INSTANCE">$i18n.getString( "tracked_entity_instance" )</option>
+	    		</select>
+	    	</td>
+	    </tr>
 		<tr>
 			<td><label for="decimals">$i18n.getString( "decimals_in_data_output" )</label></td>
 			<td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-08-27 17:18:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-08-28 10:23:48 +0000
@@ -115,7 +115,7 @@
 		</td>
 	</tr>
 	<tr>
-        <th style="padding-top:15px">$i18n.getString( "expression" ) <span class="tipText">Tip: use d2:daysBetween(x,y) d2:zing(x) d2:oizp(x)</span></th>
+        <th style="padding-top:15px">$i18n.getString( "expression" ) <span class="tipText">Tip: use d2:daysBetween(x,y) d2:condition(bool-expr,true-val,false-val) d2:zing(x) d2:oizp(x)</span></th>
     </tr>
 	<tr>
 		<td>
@@ -259,7 +259,7 @@
 		</td>
 	</tr>
 	<tr>
-        <th style="padding-top:15px">$i18n.getString( "filter" ) <span class="tipText">Tip: use d2:daysBetween(x,y) d2:zing(x) d2:oizp(x)</span></th>
+        <th style="padding-top:15px">$i18n.getString( "filter" ) <span class="tipText">Tip: use d2:daysBetween(x,y) d2:condition(bool-expr,true-val,false-val) d2:zing(x) d2:oizp(x)</span></th>
     </tr>	
 	<tr>
 		<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-08-21 12:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-08-28 10:23:48 +0000
@@ -76,6 +76,16 @@
 	            <option value="CUSTOM"#if( $programIndicator.aggregationType == 'CUSTOM' ) selected="selected"#end>$i18n.getString( "custom" )</option>
             </select>
         </td>
+    </tr>    
+    <tr>
+    	<td><label for="eventOutputType">$i18n.getString( "event_output_type" )</label></td>
+    	<td>
+    		<select id="eventOutputType" name="eventOutputType">
+    			<option value="EVENT"#if( $programIndicator.eventOutputType == 'EVENT' ) selected="selected"#end>$i18n.getString( "event" )</option>
+    			<option value="ENROLLMENT"#if( $programIndicator.eventOutputType == 'ENROLLMENT' ) selected="selected"#end>$i18n.getString( "enrollment" )</option>
+    			<option value="TRACKED_ENTITY_INSTANCE"#if( $programIndicator.eventOutputType == 'TRACKED_ENTITY_INSTANCE' ) selected="selected"#end>$i18n.getString( "tracked_entity_instance" )</option>
+    		</select>
+    	</td>
     </tr>
 	<tr>
 		<td><label for="decimals">$i18n.getString( "decimals_in_data_output" )</label></td>