dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #39002
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19802: Analytics, fixed bug, save operands
------------------------------------------------------------
revno: 19802
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-08-19 19:45:52 -0400
message:
Analytics, fixed bug, save operands
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperandService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementOperandService.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperandService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperandService.java 2015-07-03 07:44:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperandService.java 2015-08-19 23:45:52 +0000
@@ -57,4 +57,6 @@
DataElementOperand getDataElementOperand( String dataElementUid, String categoryOptionComboUid );
DataElementOperand getOrAddDataElementOperand( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo );
+
+ DataElementOperand getOrAddDataElementOperand( String dataElementUid, String categoryOptionComboUid );
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-08-19 20:52:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-08-19 23:45:52 +0000
@@ -447,7 +447,7 @@
{
if ( DimensionalObjectUtils.isValidDimensionalOperand( uid ) )
{
- DataElementOperand operand = operandService.getDataElementOperand(
+ DataElementOperand operand = operandService.getOrAddDataElementOperand(
splitSafe( uid, DataElementOperand.ESCAPED_SEPARATOR, 0 ), splitSafe( uid, DataElementOperand.ESCAPED_SEPARATOR, 1 ) );
if ( operand != null )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementOperandService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementOperandService.java 2015-07-03 07:44:39 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementOperandService.java 2015-08-19 23:45:52 +0000
@@ -182,4 +182,18 @@
return operand;
}
+
+ @Override
+ public DataElementOperand getOrAddDataElementOperand( String dataElementUid, String categoryOptionComboUid )
+ {
+ DataElement dataElement = dataElementService.getDataElement( dataElementUid );
+ DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboUid );
+
+ if ( dataElement == null || categoryOptionCombo == null )
+ {
+ return null;
+ }
+
+ return getOrAddDataElementOperand( dataElement, categoryOptionCombo );
+ }
}