[Dhis2-devs] Pivot Tables (ReportTable) to Standard Report HTML report format

2015-09-04 Thread moses mwale
Hello All, am keenly interested to learn how to convert Pivot Tables
(ReportTable) to Standard Report HTML report format. I know how to do that
from event report to standard report html report format,

How can I arrange indicators, period which are connected to 2 Organization
Units?
Am used to the one having Program and program stage, But this does not
have, only Having indicator and 2 organization Units

Any Examples on How to complete it.




DB01_Erongo_1Dem_L2_Disability rates 0-24
years_Census_2011




var orgUnit = dhis2.report.organisationUnit;
var orgUnitHierarchy = dhis2.report.organisationUnitHierarchy;
var orgUnitChildren = dhis2.report.organisationUnitChildren;
var date = dhis2.report.date; // A date in -MM-dd format

var periods = dhis2.report.periods; // An array with period identifiers

var period = periods[0]; //var reportUrl = "/api/analytics/events/aggregate/rU1vrYCoRBs.html?stage=BmNIrl52sMO&dimension=ou:" + orgUnit.id + "&dimension=bSsRJcDBG9T&filter=pe:" + period + "&displayProperty=NAME"; var reportUrl = "/api/analytics.xml?dimension=dx:C3KcWZPN5YZ;esQvh8XBqUi;hoAIpggVIaw&dimension=ou:LMGPF478UMN;rgY3dWuhztf&filter=pe:2013&displayProperty=NAME"; Ext.onReady(function() { $("#ou").append("Org Unit: " + orgUnit.name); $("#pe").append("Period: " + period); DHIS.getTable({ "url": "../", "el": "dvReport", "dataType": "aggregated_values", // or "individual_records" "indicators":{ "id" : "JkKAuCwFFM" }, "columns": [{ "dimension": "ou", "items": [{ "id": "" + orgUnit.id + "" //"ImspTQPwCqd" }] } }); }); ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp

Re: [Dhis2-devs] Analytics API: Dimensions cannot be specified more than once

2015-09-04 Thread Greg Rowles
Hi Lars

Problem solved!

It runs successfully under version 2.20 while v2.19 returns error
message Dimensions
cannot be specified more than once: [[de, type: DATAELEMENT, items:
[[cx6F4m5U5v2, type: null, items: [], legend set: null, filter: null],
[Cb3X7x9P7b2, type: null, items: [], legend set: null, filter: null]],
legend set: null, filter: null]]


Original call:

api/analytics.json?dimension=pe:LAST_12_MONTHS&dimension=dx:Cl4D9i5T6j2;N2m4W6w3N4r;cx6F4m5U5v2.JO2HBbjqU3c;Cb3X7x9P7b2.JO2HBbjqU3c;Cb3X7x9P7b2;cx6F4m5U5v2;K2j3J8b4H6c;J1a6I8c1G2k;A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4;N2m4W6w3N4r;Dv1K3w4Z3u0;cl2E3i6X5z9&dimension=ou:LEVEL-3;JLA7wl59oN3&hierarchyMeta=true&displayProperty=NAME&showHierarchy=true

Thanks,
Greg


On Fri, Sep 4, 2015 at 4:53 PM, Lars Helge Øverland 
wrote:

> Hi Greg,
>
> can you post the entire request analytics URL ?
>
> Which version are you on?
>
> If 2.20 the api response should tell you which dimensions are duplicated.
>
> regards,
>
> Lars
>
>
> On Fri, Sep 4, 2015 at 3:25 PM, Greg Rowles  wrote:
>
>> Hi Devs
>>
>> We're working on a report that accepts multiple (indicator) dx parameter
>> values. From this list we're trying to build an API call that includes
>> numerator + denominator formula UIDs so that we also display numerator and
>> denominator totals in the report. Example parameter for 3 indicator UIDs:
>>
>> dx=A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4
>>
>> For each of these indicators we look up the associated data elements UIDs
>> that make up the num + denom formulas. The *new API call looks like this:
>>
>> dx:Cl4D9i5T6j2;N2m4W6w3N4r;*cx6F4m5U5v2*.*JO2HBbjqU3c*;*Cb3X7x9P7b2*.
>> *JO2HBbjqU3c*;*Cb3X7x9P7b2*;*cx6F4m5U5v2*;K2j3J8b4H6c;J1a6I8c1G2k;
>> A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4;cq3K6v5R5e3;Dv1K3w4Z3u0;cl2E3i6X5z9
>>
>> Executing the API calls result in the following error: *Dimensions
>> cannot be specified more than once.*
>>
>> From this list it's obvious to tell which UIDs are repeated but how do we
>> work around it? Do we run multiple/separate analyic API calls for those
>> numerators/denominator that reference category combinations from those that
>> don't?
>>
>>
>> Regards,
>> Greg
>>
>> --
>> *Health Information Systems Program - South Africa*
>> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - -
>> - *
>> Mobile  :073 246 2992
>> Landline:   021 554 3130
>> Fax:  086 733 8432
>> Skype:  gregory_rowles
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org 
>
>


-- 
*Health Information Systems Program - South Africa*
*- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - - - *
Mobile  :073 246 2992
Landline:   021 554 3130
Fax:  086 733 8432
Skype:  gregory_rowles
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Analytics API: Dimensions cannot be specified more than once

2015-09-04 Thread Lars Helge Øverland
Hi Greg,

can you post the entire request analytics URL ?

Which version are you on?

If 2.20 the api response should tell you which dimensions are duplicated.

regards,

Lars


On Fri, Sep 4, 2015 at 3:25 PM, Greg Rowles  wrote:

> Hi Devs
>
> We're working on a report that accepts multiple (indicator) dx parameter
> values. From this list we're trying to build an API call that includes
> numerator + denominator formula UIDs so that we also display numerator and
> denominator totals in the report. Example parameter for 3 indicator UIDs:
>
> dx=A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4
>
> For each of these indicators we look up the associated data elements UIDs
> that make up the num + denom formulas. The *new API call looks like this:
>
> dx:Cl4D9i5T6j2;N2m4W6w3N4r;*cx6F4m5U5v2*.*JO2HBbjqU3c*;*Cb3X7x9P7b2*.
> *JO2HBbjqU3c*;*Cb3X7x9P7b2*;*cx6F4m5U5v2*;K2j3J8b4H6c;J1a6I8c1G2k;
> A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4;cq3K6v5R5e3;Dv1K3w4Z3u0;cl2E3i6X5z9
>
> Executing the API calls result in the following error: *Dimensions cannot
> be specified more than once.*
>
> From this list it's obvious to tell which UIDs are repeated but how do we
> work around it? Do we run multiple/separate analyic API calls for those
> numerators/denominator that reference category combinations from those that
> don't?
>
>
> Regards,
> Greg
>
> --
> *Health Information Systems Program - South Africa*
> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - -
> - *
> Mobile  :073 246 2992
> Landline:   021 554 3130
> Fax:  086 733 8432
> Skype:  gregory_rowles
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19999: Report table, removed unused properties

2015-09-04 Thread noreply

revno: 1
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 16:39:54 +0200
message:
  Report table, removed unused properties
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java
  
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java
  
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.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/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-08-04 16:05:37 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-09-04 14:39:54 +
@@ -505,51 +505,6 @@
 return relativeOrganisationUnit != null ? relativeOrganisationUnit.getName() : EMPTY;
 }
 
-public boolean isDoIndicators()
-{
-return columnDimensions.contains( DATA_X_DIM_ID );
-}
-
-public void setDoIndicators( boolean doIndicators )
-{
-this.columnDimensions.remove( DATA_X_DIM_ID );
-
-if ( doIndicators )
-{
-this.columnDimensions.add( DATA_X_DIM_ID );
-}
-}
-
-public boolean isDoPeriods()
-{
-return columnDimensions.contains( PERIOD_DIM_ID );
-}
-
-public void setDoPeriods( boolean doPeriods )
-{
-this.columnDimensions.remove( PERIOD_DIM_ID );
-
-if ( doPeriods )
-{
-this.columnDimensions.add( PERIOD_DIM_ID );
-}
-}
-
-public boolean isDoUnits()
-{
-return columnDimensions.contains( ORGUNIT_DIM_ID );
-}
-
-public void setDoUnits( boolean doUnits )
-{
-this.columnDimensions.remove( ORGUNIT_DIM_ID );
-
-if ( doUnits )
-{
-this.columnDimensions.add( ORGUNIT_DIM_ID );
-}
-}
-
 /**
  * Adds an empty list of NameableObjects to the given list if empty.
  */

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2015-03-31 15:22:00 +
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2015-09-04 14:39:54 +
@@ -90,10 +90,6 @@
 match.setName( object.getName() );
 match.setRegression( object.isRegression() );
 
-match.setDoIndicators( match.isDoIndicators() );
-match.setDoPeriods( match.isDoPeriods() );
-match.setDoUnits( match.isDoUnits() );
-
 match.getRelatives().setLastMonth( object.getRelatives().isLastMonth() );
 match.getRelatives().setMonthsThisYear( object.getRelatives().isMonthsThisYear() );
 match.getRelatives().setQuartersThisYear( object.getRelatives().isQuartersThisYear() );
@@ -128,19 +124,6 @@
 return false;
 }
 
-if ( object.isDoIndicators() != existing.isDoIndicators() )
-{
-return false;
-}
-if ( object.isDoPeriods() != existing.isDoPeriods() )
-{
-return false;
-}
-if ( object.isDoUnits() != existing.isDoUnits() )
-{
-return false;
-}
-
 return true;
 }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java	2015-09-03 03:11:47 +
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java	2015-09-04 14:39:54 +
@@ -210,26 +210,17 @@
 assertEquals( indicators, reportTableA.getIndicators() );
 assertEquals( periods, reportTableA.getPeriods() );
 assertEquals( units, reportTableA.getOrganisationUnits() );
-assertEquals( true, reportTableA.isDoIndicators() );
-assertEquals( true, reportTableA.isDoPeriods() );
-assertEquals( false, reportTableA.isDoUnits() );
 assertEquals( relativesA, reportTableA.getRelatives() );
 
 assertEquals( "Prescriptions", reportTableB.getName() );
 assertEquals( dataElements, reportTableB.getDataElements() );
 assertEquals( periods, reportTableB.getPeriods() );
 assertEquals( units, reportT

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19998: PT DV value types updated.

2015-09-04 Thread noreply

revno: 19998
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 16:37:08 +0200
message:
  PT DV value types updated.
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js


--
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-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js	2015-09-03 10:58:40 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js	2015-09-04 14:37:08 +
@@ -159,7 +159,7 @@
 	booleanTypes: ['BOOLEAN','TRUE_ONLY'],
 	dateTypes: ['DATE','DATETIME'],
 	aggregateTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE','BOOLEAN','TRUE_ONLY']
-}
+};
 
 for (var i = 0, obj; i < conf.aggregationType.data.length; i++) {
 obj = conf.aggregationType.data[i];

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 09:07:52 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 14:37:08 +
@@ -4415,7 +4415,7 @@
 teas = isO(program) && isA(program.programTrackedEntityAttributes) ? Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute') : [],
 dataElements = [],
 attributes = [],
-types = ['int', 'string', 'bool', 'trueonly', 'number', 'optionSet'],
+types = ns.core.conf.valueType.aggregateTypes,
 data;
 
 // data elements
@@ -4423,25 +4423,22 @@
 stage = stages[i];
 
 if (isA(stage.programStageDataElements) && stage.programStageDataElements.length) {
-//elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
-dataElements = dataElements.concat(Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []);
+elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
 
-//for (var j = 0; j < elements.length; j++) {
-//if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) {
-//dataElements.push(elements[j]);
-//}
-//}
+for (var j = 0; j < elements.length; j++) {
+if (Ext.Array.contains(types, elements[j].valueType)) {
+dataElements.push(elements[j]);
+}
+}
 }
 }
 
 // attributes
-
-//for (i = 0; i < teas.length; i++) {
-//if (Ext.Array.contains(types, (teas[i].valueType || '').toLowerCase())) {
-//attributes.push(teas[i]);
-//}
-//}
-attributes = teas;
+for (i = 0; i < teas.length; i++) {
+if (Ext.Array.contains(types, teas[i].valueType)) {
+attributes.push(teas[i]);
+}
+}
 
 data = ns.core.support.prototype.array.sort(Ext.Array.clean([].concat(dataElements, attributes))) || [];
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2015-09-02 18:25:31 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2015-09-04 14:37:08 +
@@ -174,6 +174,14 @@
 relativePeriods: []
 			};
 
+conf.valueType = {
+	numericTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE'],
+	text

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19997: Analytics, fixed bug with download in table layout and data element operands / details

2015-09-04 Thread noreply

revno: 19997
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 16:25:32 +0200
message:
  Analytics, fixed bug with download in table layout and data element operands 
/ details
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-09-03 15:25:27 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-09-04 14:25:32 +
@@ -780,8 +780,7 @@
 {
 if ( item.getClass().equals( DataElementOperand.class ) )
 {
-ids.add( ((DataElementOperand) item).getDataElement().getUid() );
-ids.add( ((DataElementOperand) item).getCategoryOptionCombo().getUid() );
+ids.add( ((DataElementOperand) item).getAnalyticsId() );
 }
 else
 {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2015-09-03 02:35:05 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2015-09-04 14:25:32 +
@@ -308,6 +308,16 @@
 {
 return COLUMN_PREFIX + dataElementId + COLUMN_SEPARATOR + optionComboId;
 }
+
+/**
+ * Returns an identifier on the format ..
+ * 
+ * @return an identifier.
+ */
+public String getAnalyticsId()
+{
+return dataElement.getUid() + SEPARATOR + categoryOptionCombo.getUid();
+}
 
 /**
  * Returns a pretty-print name based on the given data element and category

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-09-04 13:51:59 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-09-04 14:25:32 +
@@ -1464,7 +1464,7 @@
  * dimension is specified, all category option combos for the first data 
  * element is returned. Returns an empty array if the dimension is not present.
  */
-public NameableObject[] getDimensionArrayCollapseDxExplodeCoc( String dimension )
+public NameableObject[] getDimensionArrayExplodeCoc( String dimension )
 {
 List items = new ArrayList<>();
 

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-09-02 19:49:48 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-09-04 14:25:32 +
@@ -667,7 +667,7 @@
 {
 reportTable.getColumnDimensions().add( dimension );
 
-tableColumns.add( params.getDimensionArrayCollapseDxExplodeCoc( dimension ) );
+tableColumns.add( params.getDimensionArrayExplodeCoc( dimension ) );
 }
 }
 
@@ -677,7 +677,7 @@
 {
 reportTable.getRowDimensions().add( dimension );
 
-tableRows.add( params.getDimensionArrayCollapseDxExplodeCoc( dimension ) );
+tableRows.add( params.getDimensionArrayExplodeCoc( dimension ) );
 }
 }
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19996: Analytics, streams for filtering

2015-09-04 Thread noreply

revno: 19996
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 15:51:59 +0200
message:
  Analytics, streams for filtering
modified:
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryGroupsTest.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-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-08-21 03:14:08 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-09-04 13:51:59 +
@@ -51,6 +51,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.StringUtils;
 import org.hisp.dhis.common.BaseDimensionalObject;
@@ -1473,12 +1474,7 @@
 
 if ( !des.isEmpty() )
 {
-Set categoryCombos = new HashSet<>();
-
-for ( NameableObject de : des )
-{
-categoryCombos.add( ((DataElement) de).getCategoryCombo() );
-}
+Set categoryCombos = des.stream().map( d -> ((DataElement) d).getCategoryCombo() ).collect( Collectors.toSet() );
 
 for ( DataElementCategoryCombo cc : categoryCombos )
 {
@@ -1707,25 +1703,8 @@
 
 public List getDataElementGroupSets()
 {
-List list = new ArrayList<>();
-
-for ( DimensionalObject dimension : dimensions )
-{
-if ( DimensionType.DATAELEMENT_GROUPSET.equals( dimension.getDimensionType() ) )
-{
-list.add( dimension );
-}
-}
-
-for ( DimensionalObject filter : filters )
-{
-if ( DimensionType.DATAELEMENT_GROUPSET.equals( filter.getDimensionType() ) )
-{
-list.add( filter );
-}
-}
-
-return list;
+return ListUtils.union( dimensions, filters ).stream().
+filter( d -> DimensionType.DATAELEMENT_GROUPSET.equals( d.getDimensionType() ) ).collect( Collectors.toList() );
 }
 
 public void setDataElementGroupSet( DataElementGroupSet groupSet )

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryGroupsTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryGroupsTest.java	2015-09-04 10:49:08 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryGroupsTest.java	2015-09-04 13:51:59 +
@@ -78,7 +78,7 @@
 deB = createDataElement( 'B', ValueType.INTEGER, AGGREGATION_OPERATOR_SUM );
 deC = createDataElement( 'C', ValueType.INTEGER, AGGREGATION_OPERATOR_SUM );
 deD = createDataElement( 'D', ValueType.INTEGER, AGGREGATION_OPERATOR_SUM );
-deE = createDataElement( 'E', ValueType.INTEGER.INTEGER, AGGREGATION_OPERATOR_SUM );
+deE = createDataElement( 'E', ValueType.INTEGER, AGGREGATION_OPERATOR_SUM );
 deF = createDataElement( 'F', ValueType.INTEGER, AGGREGATION_OPERATOR_AVERAGE_SUM );
 deG = createDataElement( 'G', ValueType.INTEGER, AGGREGATION_OPERATOR_AVERAGE_SUM );
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] Analytics API: Dimensions cannot be specified more than once

2015-09-04 Thread Greg Rowles
Hi Devs

We're working on a report that accepts multiple (indicator) dx parameter
values. From this list we're trying to build an API call that includes
numerator + denominator formula UIDs so that we also display numerator and
denominator totals in the report. Example parameter for 3 indicator UIDs:

dx=A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4

For each of these indicators we look up the associated data elements UIDs
that make up the num + denom formulas. The *new API call looks like this:

dx:Cl4D9i5T6j2;N2m4W6w3N4r;*cx6F4m5U5v2*.*JO2HBbjqU3c*;*Cb3X7x9P7b2*.
*JO2HBbjqU3c*;*Cb3X7x9P7b2*;*cx6F4m5U5v2*;K2j3J8b4H6c;J1a6I8c1G2k;
A9s6E9l4W8z;Bt5H0q5L3h7;eo2N8j1S9k4;cq3K6v5R5e3;Dv1K3w4Z3u0;cl2E3i6X5z9

Executing the API calls result in the following error: *Dimensions cannot
be specified more than once.*

>From this list it's obvious to tell which UIDs are repeated but how do we
work around it? Do we run multiple/separate analyic API calls for those
numerators/denominator that reference category combinations from those that
don't?


Regards,
Greg

-- 
*Health Information Systems Program - South Africa*
*- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - - - - *
Mobile  :073 246 2992
Landline:   021 554 3130
Fax:  086 733 8432
Skype:  gregory_rowles
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19995: use InitTableAlteror to upgrade de.valueTypes

2015-09-04 Thread noreply

revno: 19995
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 18:23:32 +0700
message:
  use InitTableAlteror to upgrade de.valueTypes
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml


--
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-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java	2015-07-02 07:05:55 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java	2015-09-04 11:23:32 +
@@ -46,7 +46,7 @@
 
 @Autowired
 private StatementManager statementManager;
-
+
 @Autowired
 private StatementBuilder statementBuilder;
 
@@ -69,39 +69,77 @@
 executeSql( "UPDATE programstageinstance SET status='COMPLETED' WHERE status='1';" );
 executeSql( "UPDATE programstageinstance SET status='SKIPPED' WHERE status='5';" );
 executeSql( "ALTER TABLE program DROP COLUMN displayonallorgunit" );
-
+
 upgradeProgramStageDataElements();
-
-executeSql( "ALTER TABLE program ALTER COLUMN \"type\" TYPE varchar(255);");
-executeSql( "update program set \"type\"='WITH_REGISTRATION' where type='1' or type='2'");
-executeSql( "update program set \"type\"='WITHOUT_REGISTRATION' where type='3'");
+updateValueTypes();
+
+executeSql( "ALTER TABLE program ALTER COLUMN \"type\" TYPE varchar(255);" );
+executeSql( "update program set \"type\"='WITH_REGISTRATION' where type='1' or type='2'" );
+executeSql( "update program set \"type\"='WITHOUT_REGISTRATION' where type='3'" );
 }
 
 // -
 // Supportive methods
 // -
 
+private void updateValueTypes()
+{
+executeSql( "alter table dataelement alter column valuetype type varchar(50)" );
+
+executeSql( "update dataelement set valuetype='NUMBER' where valuetype='int' and numbertype='number'" );
+executeSql( "update dataelement set valuetype='INTEGER' where valuetype='int' and numbertype='int'" );
+executeSql( "update dataelement set valuetype='INTEGER_POSITIVE' where valuetype='int' and numbertype='posInt'" );
+executeSql( "update dataelement set valuetype='INTEGER_NEGATIVE' where valuetype='int' and numbertype='negInt'" );
+executeSql( "update dataelement set valuetype='INTEGER_ZERO_OR_POSITIVE' where valuetype='int' and numbertype='zeroPositiveInt'" );
+executeSql( "update dataelement set valuetype='PERCENTAGE' where valuetype='int' and numbertype='percentage'" );
+executeSql( "update dataelement set valuetype='UNIT_INTERVAL' where valuetype='int' and numbertype='unitInterval'" );
+
+executeSql( "update dataelement set valuetype='TEXT' where valuetype='string' and texttype='text'" );
+executeSql( "update dataelement set valuetype='LONG_TEXT' where valuetype='string' and texttype='longText'" );
+
+executeSql( "update dataelement set valuetype='DATE' where valuetype='date'" );
+executeSql( "update dataelement set valuetype='DATETIME' where valuetype='datetime'" );
+executeSql( "update dataelement set valuetype='BOOLEAN' where valuetype='bool'" );
+executeSql( "update dataelement set valuetype='TRUE_ONLY' where valuetype='trueOnly'" );
+executeSql( "update dataelement set valuetype='USERNAME' where valuetype='username'" );
+
+executeSql( "alter table dataelement drop column numbertype" );
+executeSql( "alter table dataelement drop column texttype" );
+
+executeSql( "update trackedentityattribute set valuetype='TEXT' where valuetype='string'" );
+executeSql( "update trackedentityattribute set valuetype='PHONE_NUMBER' where valuetype='phoneNumber'" );
+executeSql( "update trackedentityattribute set valuetype='EMAIL' where valuetype='email'" );
+executeSql( "update trackedentityattribute set valuetype='NUMBER' where valuetype='number'" );
+executeSql( "update trackedentityattribute set valuetype='LETTER' where valuetype='letter'" );
+executeSql( "update trackedentityattribute set valuetype='BOOLEAN' where valuetype='bool'" );
+executeSql( "update trackedentityattribut

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19994: remove old type/numbertype/texttype from data element

2015-09-04 Thread noreply

revno: 19994
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 17:49:08 +0700
message:
  remove old type/numbertype/texttype from data element
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java
  
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryGroupsTest.java
  
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/QueryPlannerTest.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramDataEntryServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java
  
dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java
  
dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java
  
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.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/common/ValueType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java	2015-09-04 05:24:21 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java	2015-09-04 10:49:08 +
@@ -118,120 +118,7 @@
 return this == DATE || this == DATETIME;
 }
 
-/**
- * TODO replace string value type on data element with ValueType and remove
- * this method.
- */
-public static ValueType getFromDataElement( DataElement dataElement )
-{
-return getFromDataElementTypes( dataElement.getType(), dataElement.getNumberType(), dataElement.getTextType() );
-}
-
-public static void setDataElementTypes( DataElement dataElement, ValueType valueType )
-{
-switch ( valueType )
-{
-case INTEGER:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_INT );
-dataElement.setTextType( null );
-break;
-}
-case INTEGER_POSITIVE:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_POSITIVE_INT );
-dataElement.setTextType( null );
-break;
-}
-case INTEGER_NEGATIVE:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_NEGATIVE_INT );
-dataElement.setTextType( null );
-break;
-}
-case INTEGER_ZERO_OR_POSITIVE:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT );
-dataElement.setTextType( null );
-break;
-}
-case NUMBER:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_NUMBER );
-dataElement.setTextType( null );
-break;
-}
-case UNIT_INTERVAL:
-{
-dataElement.setType( DataElement.VALUE_TYPE_INT );
-dataElement.setNumberType( DataElement.VALUE_TYPE_UNIT_INTERVAL );
-dataElement.setTextType( null );
-break;
-}
-case PERCENTAGE:
-{
-dataElement

Re: [Dhis2-devs] [Web API] Is there a way to do AND with filters?

2015-09-04 Thread Morten Olav Hansen
Hi Harsh

String also has a numeric value, i.e. "1" is smaller than "2", so for those
simple cases you can use it. But don't be fooled, this is -string-
comparing, not comparing integers.

--
Morten

On Fri, Sep 4, 2015 at 3:46 PM, Harsh Atal  wrote:

> Thank You Morten,
> Could you clarify just this one more thing please :-
>
> What does it mean for the operator *gt,lt,ge,le* to be applied on a field
> which is of type string?
>
> For eg what would be compared if I write  
> *api/programs?filter=validationCriteria.value:gt:4
> *? And the type of validationCriteria.value is string...
>
> Can I achieve this somehow from the API?...comparing a string as though it
> was an integer through the gt,lt...operators?
>
> regards
> harsh
>
> On 4 September 2015 at 13:32, Morten Olav Hansen 
> wrote:
>
>> Hi,
>>
>> Sorry, seems the docs are a bit out of date. It was sent out on the
>> mailing list a while that this actually changed, all operators are now AND,
>> it is not possible to do any kind of OR operation (but you can use :in:[])
>>
>> --
>> Morten
>>
>> On Fri, Sep 4, 2015 at 2:58 PM, Harsh Atal  wrote:
>>
>>> Hi
>>>
>>> In the documentation it says (1.6. Meta-data object filter) :-
>>>
>>> Get all data elements with aggregation operator "sum" and value type
>>> "int":
>>>
>>> /api/dataElements.json?filter=aggregationOperator:eq:sum&filter=type:eq:int
>>>
>>> Is this really possible, can I do an AND over multiple filters? may be
>>> with another syntax if not this one..
>>>
>>>
>>> regards
>>> harsh
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19993: de.type => de.valueType conversion, wip

2015-09-04 Thread noreply

revno: 19993
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 16:29:23 +0700
message:
  de.type => de.valueType conversion, wip
removed:
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/DataElementConverter.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/IndicatorConverter.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitConverter.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitHierarchyConverter.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/exporter/
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/exporter/DefaultXLSExportService.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/exporter/XLSExportPipeThread.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/DataElementTypeFilter.java
added:
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/DataElementValueTypesFilter.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataentryform/DataEntryFormServiceTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/QueryServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml
  
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/DataElementStringTypeFilter.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PDFUtils.java
  
dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/AggregatableDataElementFilterTest.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/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2015-09-03 17:49:15 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2015-09-04 09:29:23 +
@@ -622,6 +622,7 @@
 
 public void setValueType( ValueType valueType )
 {
+ValueType.setDataElementTypes( this, valueType );
 this.valueType = valueType;
 }
 

=== modified file 'dhis-2/dhis-

Re: [Dhis2-devs] Moving directly from 2.18 to 2.20

2015-09-04 Thread Pamod Amarakoon
Thank you for the confirmation

On Thu, Sep 3, 2015 at 8:40 PM, Victor Garcia  wrote:

> Thank you both for the comments. They are reassuring ;-)
>
> On 3 September 2015 at 09:46, Jason Pickering
>  wrote:
> > And, be sure to remove everything in the tomcat/webapps/dhis directory
> (or
> > your local equivalent happens to be). You do not want to upgrade the WAR
> > file without also removing the director prior to starting Tomcat. Making
> a
> > backup copy of your database, of course, is smart as well. :)
> >
> > Regards
> > Jason
> >
> >
> > On Thu, Sep 3, 2015 at 9:40 AM, Lars Helge Øverland  >
> > wrote:
> >>
> >>
> >> Hi,
> >>
> >>
>   Also, is it required (or safer) to run
>  before the Upgrade SQL scripts?
> >>
> >>
> >> You should stop the server, run the scripts, upgrade the war file, and
> >> then start the server.
> >>
> >> Lars
> >>
> >>
> >>
> 
> 
>  Thanks,
> 
>  Víctor
> 
>  ___
>  Mailing list: https://launchpad.net/~dhis2-devs
>  Post to : dhis2-devs@lists.launchpad.net
>  Unsubscribe : https://launchpad.net/~dhis2-devs
>  More help   : https://help.launchpad.net/ListHelp
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Lars Helge Øverland
> >>> Lead developer, DHIS 2
> >>> University of Oslo
> >>> Skype: larshelgeoverland
> >>> http://www.dhis2.org
> >>>
> >>
> >>
> >>
> >> --
> >> Lars Helge Øverland
> >> Lead developer, DHIS 2
> >> University of Oslo
> >> Skype: larshelgeoverland
> >> http://www.dhis2.org
> >>
> >>
> >> ___
> >> Mailing list: https://launchpad.net/~dhis2-devs
> >> Post to : dhis2-devs@lists.launchpad.net
> >> Unsubscribe : https://launchpad.net/~dhis2-devs
> >> More help   : https://help.launchpad.net/ListHelp
> >>
> >
> >
> >
> > --
> > Jason P. Pickering
> > email: jason.p.picker...@gmail.com
> > tel:+46764147049
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Regards,
Pamod Amarakoon

Confidentiality Notice: the information contained in this email and any
attachments may be legally privileged and confidential. If you are not an
intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this e-mail is strictly prohibited. If you have
received this e-mail in error, please notify the sender and permanently
delete the e-mail and any attachments immediately. You should not retain,
copy or use this e-mail or any attachments for any purpose, nor disclose
all or any part of the contents to any other person.

[image: eHealth Asia 2015] 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19992: PT minor fix.

2015-09-04 Thread noreply

revno: 19992
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 11:07:52 +0200
message:
  PT minor fix.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js


--
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-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 09:06:49 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 09:07:52 +
@@ -3665,7 +3665,7 @@
 data: [
  {id: 'in', name: NS.i18n.indicators},
  {id: 'de', name: NS.i18n.data_elements},
- {id: 'ds', name: NS.i18n.data_sets},
+ {id: 'ds', name: NS.i18n.reporting_rates},
  {id: 'di', name: NS.i18n.event_data_items},
  {id: 'pi', name: NS.i18n.program_indicators}
 ]

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19991: PT removed value type filtering for data items.

2015-09-04 Thread noreply

revno: 19991
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 11:06:49 +0200
message:
  PT removed value type filtering for data items.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js


--
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-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-08-19 21:26:45 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 09:06:49 +
@@ -4404,7 +4404,7 @@
 }
 
 Ext.Ajax.request({
-url: ns.core.init.contextPath + '/api/programs.json?paging=false&fields=programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType]],programStages[programStageDataElements[dataElement[id,name,type]]]&filter=id:eq:' + programId,
+url: ns.core.init.contextPath + '/api/programs.json?paging=false&fields=programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType]],programStages[programStageDataElements[dataElement[id,name,valueType]]]&filter=id:eq:' + programId,
 success: function(r) {
 r = Ext.decode(r.responseText);
 
@@ -4423,22 +4423,25 @@
 stage = stages[i];
 
 if (isA(stage.programStageDataElements) && stage.programStageDataElements.length) {
-elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
+//elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
+dataElements = dataElements.concat(Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []);
 
-for (var j = 0; j < elements.length; j++) {
-if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) {
-dataElements.push(elements[j]);
-}
-}
+//for (var j = 0; j < elements.length; j++) {
+//if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) {
+//dataElements.push(elements[j]);
+//}
+//}
 }
 }
 
 // attributes
-for (i = 0; i < teas.length; i++) {
-if (Ext.Array.contains(types, (teas[i].valueType || '').toLowerCase())) {
-attributes.push(teas[i]);
-}
-}
+
+//for (i = 0; i < teas.length; i++) {
+//if (Ext.Array.contains(types, (teas[i].valueType || '').toLowerCase())) {
+//attributes.push(teas[i]);
+//}
+//}
+attributes = teas;
 
 data = ns.core.support.prototype.array.sort(Ext.Array.clean([].concat(dataElements, attributes))) || [];
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19990: Typo

2015-09-04 Thread noreply

revno: 19990
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 11:00:49 +0200
message:
  Typo
modified:
  dhis-2/dhis-api/pom.xml


--
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/pom.xml'
--- dhis-2/dhis-api/pom.xml	2015-09-04 08:57:35 +
+++ dhis-2/dhis-api/pom.xml	2015-09-04 09:00:49 +
@@ -40,7 +40,7 @@
   jasperreports
 
 
-  net.sf.jasperreports
+  net.sf.jasperreports
   jasperreports-fonts
 
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] error using curl command

2015-09-04 Thread channara rin
If i tried use test with -u ... that is work fine. but if i add more
function like -X POST -d -v it doesn't work

On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe  wrote:

> Hi Channara
>
> I just had a look at your original mail and I see that the user admin was
> recognized so it means the curl option was ok but some issue with the
> password.  My guess is that you have some strange characters in the
> password which are being expanded/interpreted by the shell.
>
> Try quoting like:
> -u "admin:x"
> or
> -u 'admin:x'
>
>
> On 4 September 2015 at 09:46, channara rin  wrote:
>
>> Hi Morten,
>> Hi tried test with user:password first. but still error.
>>
>> On Thu, Sep 3, 2015 at 11:43 PM, channara rin 
>> wrote:
>>
>>> yes, it work too.
>>>
>>>
>>> On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen 
>>> wrote:
>>>
 Try to test with something simpler

 curl -u user:pass http://server/api/dataElements

 And see if it works

 --
 Morten

 On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring  wrote:

> Channara, are you using GOW?
>
> https://github.com/bmatzelle/gow
>
> On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen <
> morte...@gmail.com> wrote:
>
>> I have also seen weird issues on window versions of cURL where -u
>> user:pass is required to be FIRST (mac/linux should be fine)
>>
>> --
>> Morten
>>
>> On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe 
>> wrote:
>>
>>> Hi Channara
>>>
>>> The man page for curl indicates that the format of the command is:
>>>
>>> curl  
>>>
>>> Try moving your url to the end of the line, after the options.  Also
>>> you might want to add "http://localhost...";
>>>
>>> On 3 September 2015 at 11:01, channara rin 
>>> wrote:
>>>
 Hi DHIS2 friends,
 i tried use curl command to import tracker, but i got error.
 can you help me what is problem?
 ***THIS IS COMMAND RUNNING:
 [image: Inline image 1]

 ***THIS IS CONSOLE in APACHE
 [image: Inline image 2]

 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp


>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522
> Skype: knutstar
> http://dhis2.org
>


 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp


>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19989: ProgramIndicator, removed valueType and rootDate properties, not in use

2015-09-04 Thread noreply

revno: 19989
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Fri 2015-09-04 10:57:35 +0200
message:
  ProgramIndicator, removed valueType and rootDate properties, not in use
modified:
  dhis-2/dhis-api/pom.xml
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicatorService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
  
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/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java
  
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java
  
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/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/pom.xml'
--- dhis-2/dhis-api/pom.xml	2015-07-20 02:01:37 +
+++ dhis-2/dhis-api/pom.xml	2015-09-04 08:57:35 +
@@ -40,7 +40,7 @@
   jasperreports
 
 
-  net.sf.jasperreports
+  net.sf.jasperreports
   jasperreports-fonts
 
 

=== 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-03 15:30:38 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2015-09-04 08:57:35 +
@@ -71,9 +71,6 @@
 public static final String VAR_VALUE_COUNT = "value_count";
 public static final String VAR_ZERO_POS_VALUE_COUNT = "zero_pos_value_count";
 
-public static final String VALUE_TYPE_DATE = "date";
-public static final String VALUE_TYPE_INT = "int";
-
 private static final String EXPRESSION_REGEXP = "(" + KEY_DATAELEMENT + "|" + KEY_ATTRIBUTE + "|" + KEY_PROGRAM_VARIABLE + "|" + KEY_CONSTANT + ")\\{(\\w+|" +
 VAR_INCIDENT_DATE + "|" + VAR_ENROLLMENT_DATE + "|" + VAR_CURRENT_DATE + ")" + SEPARATOR_ID + "?(\\w*)\\}";
 private static final String SQL_FUNC_REGEXP = "d2:(.+?)\\(([^,]+)\\,?([^,]*)\\,?([^,]*)\\)";
@@ -91,8 +88,6 @@
 
 private Program program;
 
-private String valueType;
-
 private String expression;
 
 private String filter;
@@ -106,8 +101,6 @@
 
 private Boolean displayInForm;
 
-private String rootDate;
-
 // -
 // Constructors
 // -
@@ -183,19 +176,6 @@
 @JsonProperty
 @JsonView( { DetailedView.class, ExportView.class } )
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-public String getValueType()
-{
-return valueType;
-}
-
-public void setValueType( String valueType )
-{
-this.valueType = valueType;
-}
-
-@JsonProperty
-@JsonView( { DetailedView.class, ExportView.class } )
-@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public String getExpression()
 {
 return expression;
@@ -258,19 +238,6 @@
 this.displayInForm = displayInForm;
 }
 
-@JsonProperty
-@JsonView( { DetailedView.class, ExportView.class } )
-@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-public String getRootDate()
-{
-return rootDate;
-}
-
-public void setRootDate( String rootDate )
-{
-this.rootDate = rootDate;
-}
-
 @Override
 public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
 {
@@ -283,22 +250,18 @@
 if ( strategy.isReplace() )
 {
 program = programIndicator.getProgram();
-valueType

Re: [Dhis2-devs] error using curl command

2015-09-04 Thread Bob Jolliffe
Hi Channara

I just had a look at your original mail and I see that the user admin was
recognized so it means the curl option was ok but some issue with the
password.  My guess is that you have some strange characters in the
password which are being expanded/interpreted by the shell.

Try quoting like:
-u "admin:x"
or
-u 'admin:x'


On 4 September 2015 at 09:46, channara rin  wrote:

> Hi Morten,
> Hi tried test with user:password first. but still error.
>
> On Thu, Sep 3, 2015 at 11:43 PM, channara rin 
> wrote:
>
>> yes, it work too.
>>
>>
>> On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen 
>> wrote:
>>
>>> Try to test with something simpler
>>>
>>> curl -u user:pass http://server/api/dataElements
>>>
>>> And see if it works
>>>
>>> --
>>> Morten
>>>
>>> On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring  wrote:
>>>
 Channara, are you using GOW?

 https://github.com/bmatzelle/gow

 On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen >>> > wrote:

> I have also seen weird issues on window versions of cURL where -u
> user:pass is required to be FIRST (mac/linux should be fine)
>
> --
> Morten
>
> On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe 
> wrote:
>
>> Hi Channara
>>
>> The man page for curl indicates that the format of the command is:
>>
>> curl  
>>
>> Try moving your url to the end of the line, after the options.  Also
>> you might want to add "http://localhost...";
>>
>> On 3 September 2015 at 11:01, channara rin 
>> wrote:
>>
>>> Hi DHIS2 friends,
>>> i tried use curl command to import tracker, but i got error.
>>> can you help me what is problem?
>>> ***THIS IS COMMAND RUNNING:
>>> [image: Inline image 1]
>>>
>>> ***THIS IS CONSOLE in APACHE
>>> [image: Inline image 2]
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


 --
 Knut Staring
 Dept. of Informatics, University of Oslo
 Norway: +4791880522
 Skype: knutstar
 http://dhis2.org

>>>
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] error using curl command

2015-09-04 Thread Morten Olav Hansen
Can you show us the file you are trying to send?

--
Morten

On Fri, Sep 4, 2015 at 3:46 PM, channara rin  wrote:

> Hi Morten,
> Hi tried test with user:password first. but still error.
>
> On Thu, Sep 3, 2015 at 11:43 PM, channara rin 
> wrote:
>
>> yes, it work too.
>>
>>
>> On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen 
>> wrote:
>>
>>> Try to test with something simpler
>>>
>>> curl -u user:pass http://server/api/dataElements
>>>
>>> And see if it works
>>>
>>> --
>>> Morten
>>>
>>> On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring  wrote:
>>>
 Channara, are you using GOW?

 https://github.com/bmatzelle/gow

 On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen >>> > wrote:

> I have also seen weird issues on window versions of cURL where -u
> user:pass is required to be FIRST (mac/linux should be fine)
>
> --
> Morten
>
> On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe 
> wrote:
>
>> Hi Channara
>>
>> The man page for curl indicates that the format of the command is:
>>
>> curl  
>>
>> Try moving your url to the end of the line, after the options.  Also
>> you might want to add "http://localhost...";
>>
>> On 3 September 2015 at 11:01, channara rin 
>> wrote:
>>
>>> Hi DHIS2 friends,
>>> i tried use curl command to import tracker, but i got error.
>>> can you help me what is problem?
>>> ***THIS IS COMMAND RUNNING:
>>> [image: Inline image 1]
>>>
>>> ***THIS IS CONSOLE in APACHE
>>> [image: Inline image 2]
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


 --
 Knut Staring
 Dept. of Informatics, University of Oslo
 Norway: +4791880522
 Skype: knutstar
 http://dhis2.org

>>>
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Web API] Is there a way to do AND with filters?

2015-09-04 Thread Harsh Atal
Thank You Morten,
Could you clarify just this one more thing please :-

What does it mean for the operator *gt,lt,ge,le* to be applied on a field
which is of type string?

For eg what would be compared if I write
*api/programs?filter=validationCriteria.value:gt:4
*? And the type of validationCriteria.value is string...

Can I achieve this somehow from the API?...comparing a string as though it
was an integer through the gt,lt...operators?

regards
harsh

On 4 September 2015 at 13:32, Morten Olav Hansen  wrote:

> Hi,
>
> Sorry, seems the docs are a bit out of date. It was sent out on the
> mailing list a while that this actually changed, all operators are now AND,
> it is not possible to do any kind of OR operation (but you can use :in:[])
>
> --
> Morten
>
> On Fri, Sep 4, 2015 at 2:58 PM, Harsh Atal  wrote:
>
>> Hi
>>
>> In the documentation it says (1.6. Meta-data object filter) :-
>>
>> Get all data elements with aggregation operator "sum" and value type
>> "int":
>>
>> /api/dataElements.json?filter=aggregationOperator:eq:sum&filter=type:eq:int
>>
>> Is this really possible, can I do an AND over multiple filters? may be
>> with another syntax if not this one..
>>
>>
>> regards
>> harsh
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19988: update add/update de ui to use value types

2015-09-04 Thread noreply

revno: 19988
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 15:14:19 +0700
message:
  update add/update de ui to use value types
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.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-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java	2015-09-02 05:15:31 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java	2015-09-04 08:14:19 +
@@ -122,20 +122,6 @@
 this.domainType = domainType;
 }
 
-private String numberType;
-
-public void setNumberType( String numberType )
-{
-this.numberType = numberType;
-}
-
-private String textType;
-
-public void setTextType( String textType )
-{
-this.textType = textType;
-}
-
 private String valueType;
 
 public void setValueType( String valueType )
@@ -222,8 +208,7 @@
 {
 DataElement dataElement = new DataElement();
 
-DataElementCategoryCombo categoryCombo = dataElementCategoryService
-.getDataElementCategoryCombo( selectedCategoryComboId );
+DataElementCategoryCombo categoryCombo = dataElementCategoryService.getDataElementCategoryCombo( selectedCategoryComboId );
 
 OptionSet optionSet = optionService.getOptionSet( selectedOptionSetId );
 OptionSet commentOptionSet = optionService.getOptionSet( selectedCommentOptionSetId );
@@ -235,18 +220,7 @@
 dataElement.setDescription( StringUtils.trimToNull( description ) );
 dataElement.setFormName( StringUtils.trimToNull( formName ) );
 dataElement.setDomainType( DataElementDomain.fromValue( domainType ) );
-dataElement.setType( valueType );
-
-if ( DataElement.VALUE_TYPE_STRING.equalsIgnoreCase( valueType ) )
-{
-dataElement.setTextType( textType );
-}
-else
-{
-dataElement.setNumberType( numberType );
-}
-
-dataElement.setValueType( ValueType.getFromDataElement( dataElement ) );
+dataElement.setValueType( ValueType.valueOf( valueType) );
 dataElement.setAggregationOperator( aggregationOperator );
 dataElement.setUrl( url );
 dataElement.setZeroIsSignificant( zeroIsSignificant );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2015-09-02 05:15:31 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2015-09-04 08:14:19 +
@@ -135,13 +135,6 @@
 this.domainType = domainType;
 }
 
-private String numberType;
-
-public void setNumberType( String numberType )
-{
-this.numberType = numberType;
-}
-
 private String valueType;
 
 public void setValueType( String valueType )
@@ -149,13 +142,6 @@
 this.valueType = valueType;
 }
 
-private String textType;
-
-public void setTextType( String textType )
-{
-this.textType = textType;
-}
-
 private String aggregationOperator;
 
 public void setAggregationOperator( String aggregationOperator )
@@ -255,20 +241,7 @@
 dataElement.setDescription( StringUtils.trimToNull( description ) );
 dataElement.setFormName( StringUtils.trimToNull( formName ) );
 dataElement.setDomainType( DataElementDomain.fromValue( domainType ) );
-dataElement.setType( valueType );
-
-if ( DataElement.VALUE_TYPE_STRING.equalsIgnoreCase( valueType ) )
-{
-dataElement.setTextType( textType );
- 

Re: [Dhis2-devs] [Web API] Is there a way to do AND with filters?

2015-09-04 Thread Morten Olav Hansen
Hi,

Sorry, seems the docs are a bit out of date. It was sent out on the mailing
list a while that this actually changed, all operators are now AND, it is
not possible to do any kind of OR operation (but you can use :in:[])

--
Morten

On Fri, Sep 4, 2015 at 2:58 PM, Harsh Atal  wrote:

> Hi
>
> In the documentation it says (1.6. Meta-data object filter) :-
>
> Get all data elements with aggregation operator "sum" and value type "int":
>
> /api/dataElements.json?filter=aggregationOperator:eq:sum&filter=type:eq:int
>
> Is this really possible, can I do an AND over multiple filters? may be
> with another syntax if not this one..
>
>
> regards
> harsh
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Web API] Is there a way to do AND with filters?

2015-09-04 Thread Harsh Atal
Hi

In the documentation it says (1.6. Meta-data object filter) :-

Get all data elements with aggregation operator "sum" and value type "int":

/api/dataElements.json?filter=aggregationOperator:eq:sum&filter=type:eq:int

Is this really possible, can I do an AND over multiple filters? may be with
another syntax if not this one..


regards
harsh
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19987: use value types in data element importer

2015-09-04 Thread noreply

revno: 19987
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 14:12:38 +0700
message:
  use value types in data element importer
modified:
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.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-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java	2015-09-04 07:12:38 +
@@ -54,13 +54,13 @@
 this.batchHandler = batchHandler;
 this.dataElementService = dataElementService;
 }
-
+
 @Override
 public void importObject( DataElement object, ImportParams params )
 {
 NameMappingUtil.addDataElementMapping( object.getId(), object.getName() );
 NameMappingUtil.addDataElementAggregationOperatorMapping( object.getId(), object.getAggregationOperator() );
-
+
 read( object, GroupMemberType.NONE, params );
 }
 
@@ -77,7 +77,7 @@
 match.setShortName( object.getShortName() );
 match.setCode( object.getCode() );
 match.setDescription( object.getDescription() );
-match.setType( object.getType() );
+match.setValueType( object.getValueType() );
 match.setDomainType( object.getDomainType() );
 match.setAggregationOperator( object.getAggregationOperator() );
 match.setLastUpdated( object.getLastUpdated() );
@@ -98,7 +98,7 @@
 {
 match = dataElementService.getDataElementByCode( object.getCode() );
 }
-
+
 return match;
 }
 
@@ -113,19 +113,19 @@
 {
 return false;
 }
-if ( !isSimiliar( object.getCode(), existing.getCode() ) || ( isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() ) ) )
-{
-return false;
-}
-if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || ( isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() ) ) )
-{
-return false;
-}
-if ( !object.getType().equals( existing.getType() ) )
-{
-return false;
-}
-if ( !isSimiliar( object.getDomainType(), existing.getDomainType() ) || ( isNotNull( object.getDomainType(), existing.getDomainType() ) && !object.getDomainType().equals( existing.getDomainType() ) ) )
+if ( !isSimiliar( object.getCode(), existing.getCode() ) || (isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() )) )
+{
+return false;
+}
+if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || (isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() )) )
+{
+return false;
+}
+if ( !(object.getValueType() == existing.getValueType()) )
+{
+return false;
+}
+if ( !isSimiliar( object.getDomainType(), existing.getDomainType() ) || (isNotNull( object.getDomainType(), existing.getDomainType() ) && !object.getDomainType().equals( existing.getDomainType() )) )
 {
 return false;
 }

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19986: comment out de types usage in dhis14 import and mobile/sms services, will be updated later

2015-09-04 Thread noreply

revno: 19986
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 14:11:50 +0700
message:
  comment out de types usage in dhis14 import and mobile/sms services, will be 
updated later
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/J2MEDataValueSMSListener.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.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-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java	2015-06-23 15:59:19 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java	2015-09-04 07:11:50 +
@@ -28,22 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import org.apache.commons.lang3.StringUtils;
+import org.hisp.dhis.common.ValueType;
+import org.hisp.dhis.commons.util.TextUtils;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -68,11 +55,25 @@
 import org.hisp.dhis.sms.incoming.SmsMessageStatus;
 import org.hisp.dhis.sms.parse.ParserType;
 import org.hisp.dhis.sms.parse.SMSParserException;
-import org.hisp.dhis.commons.util.TextUtils;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 public class DataValueSMSListener
 implements IncomingSmsListener
 {
@@ -140,7 +141,7 @@
 {
 this.dataElementService = dataElementService;
 }
-
+
 @Transactional
 @Override
 public boolean accept( IncomingSms sms )
@@ -254,16 +255,16 @@
 {
 HashMap output = new HashMap<>();
 Pattern pattern = Pattern.compile( defaultPattern );
-
+
 if ( !StringUtils.isBlank( smsCommand.getSeparator() ) )
 {
-	String x = "([^\\s|" +  smsCommand.getSeparator().trim() +"]+)\\s*\\" + smsCommand.getSeparator().trim() + "\\s*([\\w ]+)\\s*(\\"
- + smsCommand.getSeparator().trim() + "|$)*\\s*";
+String x = "([^\\s|" + smsCommand.getSeparator().trim() + "]+)\\s*\\" + smsCommand.getSeparator().trim() + "\\s*([\\w ]+)\\s*(\\"
++ smsCommand.getSeparator().trim() + "|$)*\\s*";
 pattern = Pattern.compile( x );
 }
-
+
 Matcher m = pattern.matcher( sms );
-
+
 while ( m.find() )
 {
 String key = m.group( 1 );
@@ -350,18 +351,18 @@
 if ( orgUnit == null && orgUnits.size() > 1 )
 {
 String messageListingOrgUnits = smsCommand.getMoreThanOneOrgUnitMessage();
-
+
 for ( Iterator i = orgUnits.iterator(); i.hasNext(); )
 {
 OrganisationUnit o = i.next();
 messageListingOrgUnits += TextUtils.SPACE + o.getName() + ":" + o.getCode();
-
+
 if ( i.hasNext() )
 {
 messageListingOrgUnits += ",";
 }
 }
-
+
 throw new SMSParserException( messageListingOrgUnits );
 }
 
@@ -438,7 +439,7 @@
 newDataValue =

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19985: use ValueType in DataElementConverter

2015-09-04 Thread noreply

revno: 19985
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2015-09-04 14:09:36 +0700
message:
  use ValueType in DataElementConverter
modified:
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.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-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java	2015-09-04 07:09:36 +
@@ -28,12 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
-import java.util.Map;
-
 import org.amplecode.quick.BatchHandler;
 import org.amplecode.staxwax.reader.XMLReader;
 import org.amplecode.staxwax.writer.XMLWriter;
+import org.hisp.dhis.common.ValueType;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementDomain;
@@ -46,6 +44,9 @@
 import org.hisp.dhis.importexport.importer.DataElementImporter;
 import org.hisp.dhis.system.util.DateUtils;
 
+import java.util.Collection;
+import java.util.Map;
+
 /**
  * @author Lars Helge Overland
  * @version $Id: DataElementConverter.java 6455 2008-11-24 08:59:37Z larshelg $
@@ -62,7 +63,7 @@
 private static final String FIELD_NAME = "name";
 private static final String FIELD_SHORT_NAME = "shortName";
 private static final String FIELD_DESCRIPTION = "description";
-private static final String FIELD_TYPE = "type";
+private static final String FIELD_VALUE_TYPE = "valueType";
 private static final String FIELD_DOMAIN_TYPE = "domainType";
 private static final String FIELD_AGGREGATION_OPERATOR = "aggregationOperator";
 private static final String FIELD_CATEGORY_COMBO = "categoryCombo";
@@ -73,7 +74,7 @@
 // -
 
 private Map categoryComboMapping;
-
+
 // -
 // Constructor
 // -
@@ -85,21 +86,21 @@
 {
 this.dataElementService = dataElementService;
 }
-
+
 /**
  * Constructor for read operations.
- * 
- * @param batchHandler the batchHandler to use.
- * @param importObjectService the importObjectService to use.
+ *
+ * @param batchHandler the batchHandler to use.
+ * @param importObjectService  the importObjectService to use.
  * @param categoryComboMapping the categoryComboMapping to use.
- * @param dataElementService the dataElementService to use.
+ * @param dataElementService   the dataElementService to use.
  */
-public DataElementConverter( BatchHandler batchHandler, 
+public DataElementConverter( BatchHandler batchHandler,
 ImportObjectService importObjectService,
 Map categoryComboMapping,
 DataElementService dataElementService,
 ImportAnalyser importAnalyser )
-{
+{
 this.batchHandler = batchHandler;
 this.importObjectService = importObjectService;
 this.categoryComboMapping = categoryComboMapping;
@@ -115,68 +116,68 @@
 public void write( XMLWriter writer, ExportParams params )
 {
 Collection elements = dataElementService.getDataElements( params.getDataElements() );
-
+
 if ( elements != null && elements.size() > 0 )
 {
 writer.openElement( COLLECTION_NAME );
-
+
 for ( DataElement element : elements )
 {
 writer.openElement( ELEMENT_NAME );
-
+
 writer.writeElement( FIELD_ID, String.valueOf( element.getId() ) );
 writer.writeElement( FIELD_UID, element.getUid() );
 writer.writeElement( FIELD_NAME, element.getName() );
 writer.writeElement( FIELD_SHORT_NAME, element.getShortName() );
 writer.writeElement( FIELD_CODE, element.getCode() ); // historic positioning from v1.2
 writer.writeElement( FIELD_DESCRIPTION, element.getDescription() );
-writer.writeElement( FIELD_TYPE, element.getType() );
+writer.writeElement( FIELD_VALUE_TYPE, element.getValueType().toString() );
 writer.wr