← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15686: Rename data element domain type from patient to tracker. Use Enum for domain type.

 

------------------------------------------------------------
revno: 15686
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-06-15 21:20:39 +0800
message:
  Rename data element domain type from patient to tracker. Use Enum for domain type.
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addCaseAggregation.vm
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDomainUserType.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.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/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/minmax/MinMaxDataElementStoreTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/DataElementRowHandler.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-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java
  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-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementController.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java
  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/GetDataElementListAction.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/dataElement.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.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-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2014-06-06 07:44:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2014-06-15 13:20:39 +0000
@@ -97,9 +97,6 @@
     public static final String VALUE_TYPE_TEXT = "text";
     public static final String VALUE_TYPE_LONG_TEXT = "longText";
 
-    public static final String DOMAIN_TYPE_AGGREGATE = "aggregate";
-    public static final String DOMAIN_TYPE_PATIENT = "patient";
-
     public static final String AGGREGATION_OPERATOR_SUM = "sum";
     public static final String AGGREGATION_OPERATOR_AVERAGE = "average";
     public static final String AGGREGATION_OPERATOR_COUNT = "count";
@@ -122,10 +119,10 @@
     private boolean active;
 
     /**
-     * The domain of this DataElement; e.g. DataElement.DOMAIN_TYPE_AGGREGATE or
-     * DataElement.DOMAIN_TYPE_PATIENT.
+     * The domain of this DataElement; e.g. DataElementDomainType.aggregate or
+     * DataElementDomainType.TRACKER.
      */
-    private String domainType;
+    private DataElementDomain domainType;
 
     /**
      * The value type of this DataElement; e.g. DataElement.VALUE_TYPE_INT or
@@ -398,7 +395,7 @@
      */
     public String getDomainTypeNullSafe()
     {
-        return domainType != null ? domainType : DOMAIN_TYPE_AGGREGATE;
+        return domainType != null ? domainType.getValue() : DataElementDomain.aggregate.getValue();
     }
 
     /**
@@ -486,12 +483,12 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public String getDomainType()
+    public DataElementDomain getDomainType()
     {
         return domainType;
     }
 
-    public void setDomainType( String domainType )
+    public void setDomainType( DataElementDomain domainType )
     {
         this.domainType = domainType;
     }

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java	2014-06-15 13:20:39 +0000
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.dataelement;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $ DataElementDomain.java Jun 14, 2014 12:12:23 PM $
+ */
+public enum DataElementDomain
+{
+    aggregate( "aggregate" ), tracker( "tracker" );
+
+    private final String value;
+
+    public static DataElementDomain fromValue( String value )
+    {
+        for ( DataElementDomain domainType : DataElementDomain.values() )
+        {
+            if ( domainType.getValue().equals( value ) )
+            {
+                return domainType;
+            }
+        }
+
+        throw new IllegalArgumentException();
+    }
+    
+    DataElementDomain( String value )
+    {
+        this.value = value;
+    }
+
+    public String getValue()
+    {
+        return value;
+    }
+}

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2014-06-15 13:20:39 +0000
@@ -182,18 +182,18 @@
     /**
      * Returns all DataElements with the given domain type.
      *
-     * @param domainType the domainType.
+     * @param domainType the DataElementDomainType.
      * @return all DataElements with the given domainType.
      */
-    Collection<DataElement> getDataElementsByDomainType( String domainType );
+    Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType );
 
     /**
      * Returns all DataElements with the given domain type.
      *
-     * @param domainType the domainType.
+     * @param domainType the DataElementDomainType.
      * @return all DataElements with the given domainType.
      */
-    Collection<DataElement> getDataElementsByDomainType( String domainType, int first, int max );
+    Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType, int first, int max );
 
     /**
      * Returns all DataElements with the given type.
@@ -296,7 +296,7 @@
 
     int getDataElementCountByName( String name );
 
-    int getDataElementCountByDomainType( String domainType );
+    int getDataElementCountByDomainType( DataElementDomain domainType );
 
     /**
      * Returns a mapping of data element uid and associated category option combo

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java	2014-06-15 13:20:39 +0000
@@ -90,7 +90,7 @@
      * @param domainType the domainType.
      * @return all DataElements with the given domainType.
      */
-    Collection<DataElement> getDataElementsByDomainType( String domainType );
+    Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType );
 
     /**
      * Returns all DataElements with the given domain type.
@@ -98,7 +98,7 @@
      * @param domainType the domainType.
      * @return all DataElements with the given domainType.
      */
-    Collection<DataElement> getDataElementsByDomainType( String domainType, int first, int max );
+    Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType, int first, int max );
 
     /**
      * Returns all DataElements with the given type.
@@ -188,5 +188,5 @@
     
     Collection<DataElement> get( DataSet dataSet, String key, Integer max );
 
-    int getCountByDomainType( String domainType );
+    int getCountByDomainType( DataElementDomain domainType );
 }

=== added file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDomainUserType.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDomainUserType.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDomainUserType.java	2014-06-15 13:20:39 +0000
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.dataelement;
+
+import org.hisp.dhis.hibernate.EnumUserType;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $ DataElementDomainUserType.java Jun 15, 2014 2:18:38 PM $
+ */
+public class DataElementDomainUserType
+    extends EnumUserType<DataElementDomain>
+{
+    public  DataElementDomainUserType()
+    {
+        super(  DataElementDomain.class );
+    }
+}

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2014-04-24 21:46:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2014-06-15 13:20:39 +0000
@@ -237,12 +237,12 @@
         } );
     }
 
-    public Collection<DataElement> getDataElementsByDomainType( String domainType )
+    public Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType )
     {
         return i18n( i18nService, dataElementStore.getDataElementsByDomainType( domainType ) );
     }
 
-    public Collection<DataElement> getDataElementsByDomainType( String domainType, int first, int max )
+    public Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType, int first, int max )
     {
         return i18n( i18nService, dataElementStore.getDataElementsByDomainType( domainType, first, max ) );
     }
@@ -326,7 +326,7 @@
         return getCountByName( i18nService, dataElementStore, name );
     }
 
-    public int getDataElementCountByDomainType( String domainType )
+    public int getDataElementCountByDomainType( DataElementDomain domainType )
     {
         return dataElementStore.getCountByDomainType( domainType );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2014-04-02 11:58:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2014-06-15 13:20:39 +0000
@@ -46,6 +46,7 @@
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementStore;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.system.util.TextUtils;
@@ -101,13 +102,13 @@
     }
 
     @SuppressWarnings( "unchecked" )
-    public Collection<DataElement> getDataElementsByDomainType( String domainType )
+    public Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType )
     {
         return getCriteria( Restrictions.eq( "domainType", domainType ) ).list();
     }
 
     @SuppressWarnings("unchecked")
-    public Collection<DataElement> getDataElementsByDomainType( String domainType, int first, int max )
+    public Collection<DataElement> getDataElementsByDomainType( DataElementDomain domainType, int first, int max )
     {
         Criteria criteria = getCriteria();
         criteria.add( Restrictions.eq( "domainType", domainType ) );
@@ -177,7 +178,7 @@
     {
         String hql = "from DataElement d where d.dataSets.size = 0 and d.domainType =:domainType";
 
-        return getQuery( hql ).setParameter( "domainType", "aggregate" ).setCacheable( true ).list();
+        return getQuery( hql ).setParameter( "domainType", DataElementDomain.aggregate ).setCacheable( true ).list();
     }
 
     @SuppressWarnings("unchecked")
@@ -259,7 +260,7 @@
     }
 
     @Override
-    public int getCountByDomainType( String domainType )
+    public int getCountByDomainType( DataElementDomain domainType )
     {
         return getCriteria( Restrictions.eq( "domainType", domainType ) ).list().size(); // TODO improve
     }

=== modified file '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/java/org/hisp/dhis/startup/TableAlteror.java	2014-05-22 13:07:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-06-15 13:20:39 +0000
@@ -724,6 +724,8 @@
         upgradeDataValuesWithAttributeOptionCombo();
         upgradeMapViewsToAnalyticalObject();
         upgradeTranslations();
+        
+        executeSql( "update dataelement set domaintype='tracker' where domaintype='patient'");
 
         log.info( "Tables updated" );
     }

=== modified file '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/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2014-03-24 18:52:45 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2014-06-15 13:20:39 +0000
@@ -30,8 +30,8 @@
 
     <property name="textType" column="textType" length="16" />
 
-    <property name="domainType" not-null="true" column="domaintype" length="16" />
-
+    <property name="domainType" column="domainType" type="org.hisp.dhis.dataelement.DataElementDomainUserType" not-null="true" />
+    
     <property name="aggregationOperator" not-null="true" column="aggregationtype" length="16" />
 
     <many-to-one name="categoryCombo" class="org.hisp.dhis.dataelement.DataElementCategoryCombo"

=== modified file '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/DataElementServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java	2014-06-15 13:20:39 +0000
@@ -368,25 +368,25 @@
     @Test
     public void testGetDataElementsByDomainType()
     {
-        assertEquals( 0, dataElementService.getDataElementsByType( DataElement.DOMAIN_TYPE_AGGREGATE ).size() );
-        assertEquals( 0, dataElementService.getDataElementsByType( DataElement.DOMAIN_TYPE_PATIENT ).size() );
+        assertEquals( 0, dataElementService.getDataElementsByType( DataElement.VALUE_TYPE_INT ).size() );
+        assertEquals( 0, dataElementService.getDataElementsByType( DataElement.VALUE_TYPE_BOOL ).size() );
 
         DataElement dataElementA = createDataElement( 'A' );
-        dataElementA.setType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementA.setType( DataElement.VALUE_TYPE_INT );
         DataElement dataElementB = createDataElement( 'B' );
-        dataElementB.setType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementB.setType( DataElement.VALUE_TYPE_BOOL );
         DataElement dataElementC = createDataElement( 'C' );
-        dataElementC.setType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementC.setType( DataElement.VALUE_TYPE_BOOL );
         DataElement dataElementD = createDataElement( 'D' );
-        dataElementD.setType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementD.setType( DataElement.VALUE_TYPE_BOOL );
 
         dataElementService.addDataElement( dataElementA );
         dataElementService.addDataElement( dataElementB );
         dataElementService.addDataElement( dataElementC );
         dataElementService.addDataElement( dataElementD );
 
-        assertEquals( 1, dataElementService.getDataElementsByType( DataElement.DOMAIN_TYPE_AGGREGATE ).size() );
-        assertEquals( 3, dataElementService.getDataElementsByType( DataElement.DOMAIN_TYPE_PATIENT ).size() );
+        assertEquals( 1, dataElementService.getDataElementsByType( DataElement.VALUE_TYPE_INT ).size() );
+        assertEquals( 3, dataElementService.getDataElementsByType( DataElement.VALUE_TYPE_BOOL ).size() );
     }
 
     @Test

=== modified file '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/dataelement/DataElementStoreTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java	2014-06-15 13:20:39 +0000
@@ -330,25 +330,25 @@
     @Test
     public void testGetDataElementsByDomainType()
     {
-        assertEquals( 0, dataElementStore.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_AGGREGATE ).size() );
-        assertEquals( 0, dataElementStore.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ).size() );
+        assertEquals( 0, dataElementStore.getDataElementsByDomainType( DataElementDomain.aggregate ).size() );
+        assertEquals( 0, dataElementStore.getDataElementsByDomainType( DataElementDomain.tracker ).size() );
 
         DataElement dataElementA = createDataElement( 'A' );
-        dataElementA.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementA.setDomainType( DataElementDomain.aggregate);
         DataElement dataElementB = createDataElement( 'B' );
-        dataElementB.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementB.setDomainType( DataElementDomain.tracker );
         DataElement dataElementC = createDataElement( 'C' );
-        dataElementC.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementC.setDomainType( DataElementDomain.tracker );
         DataElement dataElementD = createDataElement( 'D' );
-        dataElementD.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementD.setDomainType( DataElementDomain.tracker );
 
         dataElementStore.save( dataElementA );
         dataElementStore.save( dataElementB );
         dataElementStore.save( dataElementC );
         dataElementStore.save( dataElementD );
 
-        assertEquals( 1, dataElementStore.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_AGGREGATE ).size() );
-        assertEquals( 3, dataElementStore.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ).size() );
+        assertEquals( 1, dataElementStore.getDataElementsByDomainType( DataElementDomain.aggregate ).size() );
+        assertEquals( 3, dataElementStore.getDataElementsByDomainType( DataElementDomain.tracker ).size() );
     }
 
     @Test

=== modified file '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/minmax/MinMaxDataElementStoreTest.java	2014-04-27 21:28:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java	2014-06-15 13:20:39 +0000
@@ -39,6 +39,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -81,28 +82,28 @@
         dataElement1.setShortName( "DE1sname" );
         dataElement1.setAggregationOperator( DataElement.AGGREGATION_OPERATOR_SUM );
         dataElement1.setType( DataElement.VALUE_TYPE_INT );
-        dataElement1.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement1.setDomainType( DataElementDomain.aggregate );
         
         DataElement dataElement2 = new DataElement();
         dataElement2.setName( "DE2name" );
         dataElement2.setShortName( "DE2sname" );
         dataElement2.setAggregationOperator( DataElement.AGGREGATION_OPERATOR_SUM );
         dataElement2.setType( DataElement.VALUE_TYPE_INT );
-        dataElement2.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement2.setDomainType( DataElementDomain.aggregate );
 
         DataElement dataElement3 = new DataElement();
         dataElement3.setName( "DE3name" );
         dataElement3.setShortName( "DE3sname" );
         dataElement3.setAggregationOperator( DataElement.AGGREGATION_OPERATOR_SUM );
         dataElement3.setType( DataElement.VALUE_TYPE_INT );
-        dataElement3.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement3.setDomainType( DataElementDomain.aggregate );
         
         DataElement dataElement4 = new DataElement();
         dataElement4.setName( "DE4name" );
         dataElement4.setShortName( "DE4sname" );
         dataElement4.setAggregationOperator( DataElement.AGGREGATION_OPERATOR_SUM );
         dataElement4.setType( DataElement.VALUE_TYPE_INT );
-        dataElement4.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement4.setDomainType( DataElementDomain.aggregate );
         
         dataElementService.addDataElement( dataElement1 );
         dataElementService.addDataElement( dataElement2 );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java	2014-05-13 18:18:04 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java	2014-06-15 13:20:39 +0000
@@ -43,6 +43,7 @@
 import org.hisp.dhis.dataelement.CategoryOptionGroup;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dxf2.metadata.MetaData;
 import org.hisp.dhis.option.OptionSet;
@@ -59,11 +60,11 @@
     public static MetaData fromCsv( InputStream input, Class<?> clazz )
         throws IOException
     {
-        CsvReader reader = new CsvReader( input, Charset.forName( "UTF-8" ) );        
+        CsvReader reader = new CsvReader( input, Charset.forName( "UTF-8" ) );
         reader.readRecord(); // Ignore first row
-        
+
         MetaData metaData = new MetaData();
-        
+
         if ( DataElement.class.equals( clazz ) )
         {
             metaData.setDataElements( dataElementsFromCsv( reader, input ) );
@@ -92,15 +93,15 @@
         {
             metaData.setOptionSets( getOptionSetsFromCsv( reader, input ) );
         }
-        
+
         return metaData;
     }
-    
+
     private static List<DataElementCategoryOption> categoryOptionsFromCsv( CsvReader reader, InputStream input )
         throws IOException
     {
         List<DataElementCategoryOption> list = new ArrayList<DataElementCategoryOption>();
-        
+
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
@@ -112,15 +113,15 @@
                 list.add( object );
             }
         }
-        
+
         return list;
-    }    
+    }
 
     private static List<CategoryOptionGroup> categoryOptionGroupsFromCsv( CsvReader reader, InputStream input )
         throws IOException
     {
         List<CategoryOptionGroup> list = new ArrayList<CategoryOptionGroup>();
-        
+
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
@@ -132,15 +133,15 @@
                 list.add( object );
             }
         }
-        
+
         return list;
     }
-    
+
     private static List<DataElement> dataElementsFromCsv( CsvReader reader, InputStream input )
         throws IOException
     {
         List<DataElement> list = new ArrayList<DataElement>();
-        
+
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
@@ -153,18 +154,21 @@
                 object.setDescription( getSafe( values, 4, null, null ) );
                 object.setFormName( getSafe( values, 5, null, 230 ) );
                 object.setActive( true );
-                object.setDomainType( getSafe( values, 6, DataElement.DOMAIN_TYPE_AGGREGATE, 16 ) );
+
+                String domainType = getSafe( values, 6, DataElementDomain.aggregate.getValue(), 16 );
+                object.setDomainType( DataElementDomain.fromValue( domainType ) );
+
                 object.setType( getSafe( values, 7, DataElement.VALUE_TYPE_INT, 16 ) );
                 object.setNumberType( getSafe( values, 8, DataElement.VALUE_TYPE_NUMBER, 16 ) );
                 object.setTextType( getSafe( values, 9, null, 16 ) );
                 object.setAggregationOperator( getSafe( values, 10, DataElement.AGGREGATION_OPERATOR_SUM, 16 ) );
                 object.setUrl( getSafe( values, 11, null, 255 ) );
                 object.setZeroIsSignificant( Boolean.valueOf( getSafe( values, 12, "false", null ) ) );
-                
+
                 list.add( object );
             }
         }
-        
+
         return list;
     }
 
@@ -184,15 +188,15 @@
                 list.add( object );
             }
         }
-        
+
         return list;
     }
-    
+
     private static List<OrganisationUnit> organisationUnitsFromCsv( CsvReader reader, InputStream input )
         throws IOException
     {
         List<OrganisationUnit> list = new ArrayList<OrganisationUnit>();
-        
+
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
@@ -219,7 +223,7 @@
                 list.add( object );
             }
         }
-        
+
         return list;
     }
 
@@ -239,38 +243,38 @@
                 list.add( object );
             }
         }
-        
+
         return list;
     }
-    
+
     private static List<OptionSet> getOptionSetsFromCsv( CsvReader reader, InputStream input )
         throws IOException
     {
         ListMap<OptionSet, String> listMap = new ListMap<OptionSet, String>();
-        
+
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
-            
+
             if ( values != null && values.length > 0 )
             {
                 OptionSet object = new OptionSet();
                 setIdentifiableObject( object, values );
                 String option = getSafe( values, 3, null, 2000000 );
-                
+
                 listMap.putValue( object, option );
             }
         }
-        
+
         List<OptionSet> optionSets = new ArrayList<OptionSet>();
-        
+
         for ( OptionSet optionSet : listMap.keySet() )
         {
             List<String> options = new ArrayList<String>( listMap.get( optionSet ) );
             optionSet.setOptions( options );
             optionSets.add( optionSet );
         }
-        
+
         return optionSets;
     }
 
@@ -284,7 +288,7 @@
         object.setUid( getSafe( values, 1, CodeGenerator.generateCode(), 11 ) );
         object.setCode( getSafe( values, 2, null, 50 ) );
     }
-    
+
     /**
      * Returns a string from the given array avoiding exceptions.
      * 
@@ -296,23 +300,23 @@
     private static String getSafe( String[] values, int index, String defaultValue, Integer max )
     {
         String string = null;
-        
+
         if ( values == null || index < 0 || index >= values.length )
         {
             string = defaultValue;
         }
         else
-        {        
+        {
             string = values[index];
         }
-        
+
         string = StringUtils.trimToNull( string );
-        
+
         if ( string != null )
         {
             return max != null ? StringUtils.substring( string, 0, max ) : string;
         }
-        
+
         return null;
     }
 }

=== modified file '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/CaseAggregationConditionServiceTest.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java	2014-06-15 13:20:39 +0000
@@ -46,6 +46,7 @@
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -194,17 +195,17 @@
 
         dataElementA = createDataElement( 'A' );
         dataElementA.setType( DataElement.VALUE_TYPE_STRING );
-        dataElementA.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementA.setDomainType( DataElementDomain.tracker );
 
         dataElementB = createDataElement( 'B' );
         dataElementB.setType( DataElement.VALUE_TYPE_STRING );
-        dataElementB.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementB.setDomainType( DataElementDomain.tracker );
 
         dataElementC = createDataElement( 'C' );
-        dataElementC.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementC.setDomainType( DataElementDomain.aggregate );
 
         dataElementD = createDataElement( 'D' );
-        dataElementD.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementD.setDomainType( DataElementDomain.aggregate );
 
         int deAId = dataElementService.addDataElement( dataElementA );
         int deBId = dataElementService.addDataElement( dataElementB );

=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java	2014-06-15 13:20:39 +0000
@@ -44,6 +44,7 @@
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -191,17 +192,17 @@
 
         dataElementA = createDataElement( 'A' );
         dataElementA.setType( DataElement.VALUE_TYPE_STRING );
-        dataElementA.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementA.setDomainType( DataElementDomain.tracker );
 
         dataElementB = createDataElement( 'B' );
         dataElementB.setType( DataElement.VALUE_TYPE_STRING );
-        dataElementB.setDomainType( DataElement.DOMAIN_TYPE_PATIENT );
+        dataElementB.setDomainType( DataElementDomain.tracker );
 
         dataElementC = createDataElement( 'C' );
-        dataElementC.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementC.setDomainType( DataElementDomain.aggregate );
 
         dataElementD = createDataElement( 'D' );
-        dataElementD.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElementD.setDomainType( DataElementDomain.aggregate );
 
         int deAId = dataElementService.addDataElement( dataElementA );
         int deBId = dataElementService.addDataElement( dataElementB );

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/DataElementRowHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/DataElementRowHandler.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/DataElementRowHandler.java	2014-06-15 13:20:39 +0000
@@ -31,6 +31,7 @@
 import org.amplecode.quick.BatchHandler;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.importexport.ImportObjectService;
 import org.hisp.dhis.importexport.ImportParams;
@@ -78,7 +79,7 @@
         final DataElement dataElement = (DataElement) object;
         
         dataElement.setActive( true );
-        dataElement.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement.setDomainType( DataElementDomain.aggregate );
         dataElement.setZeroIsSignificant( false );
                     
         if ( dataElement.getCode() != null && dataElement.getCode().trim().length() == 0 )

=== modified file '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-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java	2014-06-15 13:20:39 +0000
@@ -33,6 +33,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ImportObjectService;
@@ -275,7 +276,7 @@
         element.setShortName( values.get( FIELD_SHORT_NAME ) );
         element.setDescription( Dhis14ParsingUtils.removeNewLine( values.get( FIELD_DESCRIPTION ) ) );
         element.setActive( true );
-        element.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        element.setDomainType( DataElementDomain.aggregate );
         element.setZeroIsSignificant( false );
         element.setType( Dhis14ObjectMappingUtil.getDataElementTypeMap().get(
             Integer.parseInt( values.get( FIELD_DATA_TYPE ) ) ) );

=== 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	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java	2014-06-15 13:20:39 +0000
@@ -36,6 +36,7 @@
 import org.amplecode.staxwax.writer.XMLWriter;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ImportObjectService;
@@ -131,7 +132,7 @@
                 writer.writeElement( FIELD_DESCRIPTION, element.getDescription() );
                 writer.writeElement( FIELD_ACTIVE, String.valueOf( element.isActive() ) );
                 writer.writeElement( FIELD_TYPE, element.getType() );
-                writer.writeElement( FIELD_DOMAIN_TYPE, element.getDomainType() );
+                writer.writeElement( FIELD_DOMAIN_TYPE, element.getDomainType().getValue() );
                 writer.writeElement( FIELD_AGGREGATION_OPERATOR, element.getAggregationOperator() );
                 writer.writeElement( FIELD_CATEGORY_COMBO, String.valueOf( element.getCategoryCombo().getId() ) );
                 writer.writeElement( FIELD_LAST_UPDATED, DateUtils.getMediumDateString( element.getLastUpdated(), EMPTY ) );
@@ -171,7 +172,8 @@
             element.setDescription( values.get( FIELD_DESCRIPTION ) );
             element.setActive( Boolean.parseBoolean( values.get( FIELD_ACTIVE ) ) );
             element.setType( values.get( FIELD_TYPE ) );
-            element.setDomainType( values.get( FIELD_DOMAIN_TYPE ) );
+            
+            element.setDomainType( DataElementDomain.fromValue(values.get( FIELD_DOMAIN_TYPE ) ) );
             element.setAggregationOperator( values.get( FIELD_AGGREGATION_OPERATOR ) );
             element.getCategoryCombo().setId( categoryComboMapping.get( Integer.parseInt( values.get( FIELD_CATEGORY_COMBO ) ) ) );
             element.setLastUpdated( DateUtils.getMediumDate( values.get( FIELD_LAST_UPDATED ) ) );            

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java	2014-04-04 14:47:05 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java	2014-06-15 13:20:39 +0000
@@ -31,6 +31,7 @@
 import java.util.Iterator;
 
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 
 /**
@@ -77,7 +78,7 @@
     @Override
     public void deleteDataElement( DataElement dataElement )
     {
-        if ( DataElement.DOMAIN_TYPE_PATIENT.equals( dataElement.getDomainType() ) )
+        if ( DataElementDomain.tracker.equals( dataElement.getDomainType() ) )
         {
             Iterator<ProgramStageDataElement> iterator = programStageDEService.getAllProgramStageDataElements().iterator();
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java	2014-06-15 13:20:39 +0000
@@ -114,7 +114,7 @@
         statementBuilder.setValue( dataElement.getDescription() );
         statementBuilder.setValue( dataElement.isActive() );
         statementBuilder.setValue( dataElement.getType() );
-        statementBuilder.setValue( dataElement.getDomainType() );
+        statementBuilder.setValue( dataElement.getDomainType().name() );
         statementBuilder.setValue( dataElement.getAggregationOperator() );
         statementBuilder.setValue( dataElement.getCategoryCombo().getId() );
         statementBuilder.setValue( dataElement.getSortOrder() );

=== modified file '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/AggregatableDataElementFilter.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java	2014-06-15 13:20:39 +0000
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.dataelement.DataElement.DOMAIN_TYPE_AGGREGATE;
 
 import java.util.HashSet;
 import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.system.util.Filter;
 
 /**
@@ -53,6 +53,6 @@
 
     public boolean retain( DataElement object )
     {
-        return object != null && types.contains( object.getType() ) && DOMAIN_TYPE_AGGREGATE.equals( object.getDomainType() );
+        return object != null && types.contains( object.getType() ) && DataElementDomain.aggregate.equals( object.getDomainType() );
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2014-05-13 08:13:16 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2014-06-15 13:20:39 +0000
@@ -69,6 +69,7 @@
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
@@ -421,7 +422,7 @@
         dataElement.setDescription( "DataElementDescription" + uniqueCharacter );
         dataElement.setActive( true );
         dataElement.setType( DataElement.VALUE_TYPE_INT );
-        dataElement.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement.setDomainType( DataElementDomain.aggregate );
         dataElement.setAggregationOperator( DataElement.AGGREGATION_OPERATOR_SUM );
 
         return dataElement;
@@ -436,7 +437,7 @@
         DataElement dataElement = createDataElement( uniqueCharacter );
 
         dataElement.setCategoryCombo( categoryCombo );
-        dataElement.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement.setDomainType( DataElementDomain.aggregate );
 
         return dataElement;
     }
@@ -450,7 +451,7 @@
     {
         DataElement dataElement = createDataElement( uniqueCharacter );
         dataElement.setType( type );
-        dataElement.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement.setDomainType( DataElementDomain.aggregate );
         dataElement.setAggregationOperator( aggregationOperator );
 
         return dataElement;
@@ -467,7 +468,7 @@
     {
         DataElement dataElement = createDataElement( uniqueCharacter );
         dataElement.setType( type );
-        dataElement.setDomainType( DataElement.DOMAIN_TYPE_AGGREGATE );
+        dataElement.setDomainType( DataElementDomain.aggregate );
         dataElement.setAggregationOperator( aggregationOperator );
         dataElement.setCategoryCombo( categoryCombo );
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementController.java	2014-06-11 20:27:54 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementController.java	2014-06-15 13:20:39 +0000
@@ -29,9 +29,11 @@
  */
 
 import com.google.common.collect.Lists;
+
 import org.hisp.dhis.common.Pager;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.schema.descriptors.DataElementSchemaDescriptor;
 import org.hisp.dhis.webapi.controller.AbstractCrudController;
@@ -66,23 +68,23 @@
         {
             entityList = Lists.newArrayList( manager.filter( getEntityClass(), options.getOptions().get( "query" ) ) );
         }
-        else if ( DataElement.DOMAIN_TYPE_AGGREGATE.equals( options.getOptions().get( KEY_DOMAIN_TYPE ) )
-            || DataElement.DOMAIN_TYPE_PATIENT.equals( options.getOptions().get( KEY_DOMAIN_TYPE ) ) )
+        else if ( DataElementDomain.aggregate.equals( options.getOptions().get( KEY_DOMAIN_TYPE ) )
+            || DataElementDomain.tracker.equals( options.getOptions().get( KEY_DOMAIN_TYPE ) ) )
         {
             String domainType = options.getOptions().get( KEY_DOMAIN_TYPE );
 
             if ( options.hasPaging() )
             {
-                int count = dataElementService.getDataElementCountByDomainType( domainType );
+                int count = dataElementService.getDataElementCountByDomainType( DataElementDomain.fromValue( domainType ) );
 
                 Pager pager = new Pager( options.getPage(), count, options.getPageSize() );
                 metaData.setPager( pager );
 
-                entityList = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( domainType, pager.getOffset(), pager.getPageSize() ) );
+                entityList = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( DataElementDomain.fromValue( domainType ), pager.getOffset(), pager.getPageSize() ) );
             }
             else
             {
-                entityList = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( domainType ) );
+                entityList = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( DataElementDomain.fromValue( domainType ) ) );
                 Collections.sort( entityList, IdentifiableObjectNameComparator.INSTANCE );
             }
         }

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addCaseAggregation.vm	2014-02-10 10:37:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addCaseAggregation.vm	1970-01-01 00:00:00 +0000
@@ -1,116 +0,0 @@
-<script>
-	var i18n_run_success = '$encoder.jsEscape( $i18n.getString( "run_success" ) , "'" )';
-	var i18n_run_fail = '$encoder.jsEscape( $i18n.getString( "run_fail" ) , "'" )';
-	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_item" ) , "'" )';
-	var i18n_all = '[' + '$encoder.jsEscape( $i18n.getString( "all" ) , "'" )' + ']';
-</script>
-
-<script type="text/javascript" src="javascript/addCaseAggregationForm.js"></script>
-															
-<h3>$i18n.getString( "create_new_aggregation_query_builder" )</h3>
-
-<form id="addCaseAggregationForm" action="addCaseAggregation.action" method="post" >
-
-<table> 
-	<thead>
-      <tr>
-        <th colspan="2">$i18n.getString( "case_aggregation_query_builder_detail" )</th>
-      </tr>
-    </thead>
-	
-    <tbody>
-	
-    <tr>
-        <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-        <td>
-			<input type="text" id="name" name="name" class="{validate:{required:true,minlength:2}}">
-		</td>
-    </tr>
-    
-    <tr>
-		<td><label for="dataSets">$i18n.getString( "dataset" )</label></td>
-		<td>
-			<select id="dataSets" name="dataSets" onChange="getDataElementsByDataset();">
-				<option value="">[$i18n.getString('please_select')]</option>
-				#foreach( $dataSet in $dataSets)
-					<option value="$dataSet.id" #if( $dataSetId=="$dataSet.id") selected #end>$dataSet.displayName</option>
-				#end
-			</select>
-		</td>				
-	</tr>
-    
-    <tr>
-		<td><label for="dataElement">$i18n.getString( "dataelement" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>			
-			<input id="aggregationDataElementInput" name="aggregationDataElementInput" style='width:300px;'>
-			<a style='width:20px; margin-bottom:-5px;height:20px;' id='dataElementsButton' name='dataElementsButton'></a>
-			<input type='hidden' id="aggregationDataElementId" name="aggregationDataElementId" class="{validate:{required:true}}" >
-		</td>
-	</tr>
-	
-	<tr>
-		<td><label for="operator">$i18n.getString( "operator" )</label></td>
-		<td>
-			<input type="radio" id="operator" name="operator" value="COUNT" checked onchange='operatorOnchange(this.value)'> $i18n.getString('number_of_patients')<br>
-			<input type="radio" id="operator" name="operator" value="times" onchange='operatorOnchange(this.value)'> $i18n.getString('number_of_visits')<br>
-			<input type="radio" id="operator" name="operator" value="sum" onchange='operatorOnchange(this.value)'> $i18n.getString('sum_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="avg" onchange='operatorOnchange(this.value)'> $i18n.getString('avg_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="min" onchange='operatorOnchange(this.value)'> $i18n.getString('min_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="max" onchange='operatorOnchange(this.value)'> $i18n.getString('max_dataelement_value')
-		</td>
-	</tr>
-	
-	<tr>
-		<td>
-			<label for="programId">$i18n.getString( "program" )</label>
-		</td>
-		<td>
-			<select id="programId" name="programId" onChange="getParams();">
-				<option value="">[$i18n.getString('please_select')]</option>
-				#foreach( $program in $programs )
-					<option value="$program.id" title='$program.displayName' programType='$program.type'>$encoder.htmlEncode( $program.displayName )</option>
-				#end
-			</select>
-		</td>
-	</tr>
-	
-	<tr>
-		<td>
-			<label for="programStage">$i18n.getString( "program_stage" )</label>
-		</td>
-		<td>
-			<select id="programStageId" name="programStageId" onChange="getEntityInstanceDataElements();"></select>
-		</td>
-	</tr>
-	
-	<tr>
-		<td>
-			<label for="deSumId">$i18n.getString( "data_element_for_sum_avg_min_max" ) <em title="$i18n.getString( "required" )" class="required">*</em></label>
-		</td>
-		<td>
-			<select id="deSumId" name="deSumId" disabled class="{validate:{required:true}}"></select>
-		</td>
-	</tr>
-	
-	<tr>
-        <td colspan="2"><p></p></td>
-    </tr>
-	
-    </tbody>
-</table>
-
-#parse( "/dhis-web-maintenance-program/caseAggregationForm.vm" )
-
-<p>	
-	<input type="submit" value="$i18n.getString( 'add' )" />
-	<input type="button" value="$i18n.getString( 'test_condition' )" onclick='testCaseAggregationCondition();'/>
-	<input type="button" value="$i18n.getString( 'cancel' )" onClick="window.location.href='caseAggregation.action?dataSetId=$!dataSetId'" />
-</p>
-
-</form>
-
-<script>
-	#if( $dataSetId )
-		getDataElementsByDataset();
-	#end
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-06-12 06:06:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-06-15 13:20:39 +0000
@@ -70,7 +70,7 @@
 	</tr>
 	<tr id='searchByIdTR' class='hidden'>
 		<td colspan='2'>
-			<input type='text' id='searchPatientByAttributes' name='searchPatientByAttributes' onchange='searchByIdsOnclick();' style='width:350px;' placeholder='$i18n.getString("search_by_attribute_value")' />
+			<input type='text' id='searchTeiByAttributes' name='searchTeiByAttributes' onchange='searchByIdsOnclick();' style='width:350px;' placeholder='$i18n.getString("search_by_attribute_value")' />
 		</td>
 		<td>
 			<input type='button' value='$i18n.getString("search")' onclick='searchByIdsOnclick();'>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java	2014-06-15 13:20:39 +0000
@@ -34,6 +34,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
@@ -195,15 +196,15 @@
         }
         else if ( domain != null )
         {
-            if ( domain.equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
+            if ( domain.equals( DataElementDomain.aggregate.getValue() ) )
             {
                 dataElements = new ArrayList<DataElement>(
-                    dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_AGGREGATE ) );
+                    dataElementService.getDataElementsByDomainType( DataElementDomain.aggregate ) );
             }
             else
             {
                 dataElements = new ArrayList<DataElement>(
-                    dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
+                    dataElementService.getDataElementsByDomainType( DataElementDomain.tracker ) );
             }
         }
         else

=== 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	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java	2014-06-15 13:20:39 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.mapping.MapLegendSet;
@@ -281,7 +282,7 @@
         dataElement.setDescription( description );
         dataElement.setFormName( formName );
         dataElement.setActive( true );
-        dataElement.setDomainType( domainType );
+        dataElement.setDomainType( DataElementDomain.fromValue( domainType )  );
         dataElement.setType( valueType );
         
         if ( DataElement.VALUE_TYPE_STRING.equalsIgnoreCase( valueType ) )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java	2014-06-15 13:20:39 +0000
@@ -37,6 +37,7 @@
 
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.user.UserSettingService;
@@ -137,9 +138,11 @@
         }
         else if ( domainType != null )
         {
-            this.paging = createPaging( dataElementService.getDataElementCountByDomainType( domainType ) );
+            DataElementDomain deDomainType = DataElementDomain.fromValue( domainType );
+            
+            this.paging = createPaging( dataElementService.getDataElementCountByDomainType( deDomainType ) );
 
-            dataElements = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( domainType, paging.getStartPos(), paging.getPageSize() ) );
+            dataElements = new ArrayList<DataElement>( dataElementService.getDataElementsByDomainType( deDomainType, paging.getStartPos(), paging.getPageSize() ) );
         }
         else
         {

=== 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	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2014-06-15 13:20:39 +0000
@@ -28,9 +28,19 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
 import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.dataelement.*;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
+import org.hisp.dhis.dataelement.DataElementGroup;
+import org.hisp.dhis.dataelement.DataElementGroupSet;
+import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.mapping.MapLegendSet;
@@ -40,10 +50,7 @@
 import org.hisp.dhis.system.util.AttributeUtils;
 import org.hisp.dhis.system.util.ConversionUtils;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -311,7 +318,7 @@
         dataElement.setDescription( description );
         dataElement.setFormName( formName );
         dataElement.setActive( active );
-        dataElement.setDomainType( domainType );
+        dataElement.setDomainType( DataElementDomain.fromValue( domainType )  );
         dataElement.setType( valueType );
         
         if ( DataElement.VALUE_TYPE_STRING.equalsIgnoreCase( valueType ) )

=== modified file '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/resources/org/hisp/dhis/dd/i18n_module.properties	2014-06-13 07:55:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2014-06-15 13:20:39 +0000
@@ -1,5 +1,5 @@
 aggregate=Aggregate
-patient=Patient
+tracker=Tracker
 no_option_assigned=Use of category with an empty option is not allowed!
 number_of_category_options=Number of category options
 number_of_categories=Number of categories

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2014-06-12 16:08:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2014-06-15 13:20:39 +0000
@@ -24,7 +24,7 @@
 	var i18n_sum = '$encoder.jsEscape( $i18n.getString( "sum" ) , "'")';
 	var i18n_average = '$encoder.jsEscape( $i18n.getString( "average" ) , "'")';
 	var i18n_aggregate = '$encoder.jsEscape( $i18n.getString( "aggregate" ) , "'")';
-	var i18n_patient = '$encoder.jsEscape( $i18n.getString( "patient" ) , "'")';
+	var i18n_tracker = '$encoder.jsEscape( $i18n.getString( "tracker" ) , "'")';
 	var i18n_translation_translate = '$encoder.jsEscape( $i18n.getString( "translation_translate" ) , "'")';
 	var i18n_edit = '$encoder.jsEscape( $i18n.getString( "edit" ) , "'")';
 	var i18n_remove = '$encoder.jsEscape( $i18n.getString( "remove" ) , "'")';
@@ -56,7 +56,7 @@
                <select id="domainTypeList" name="domainTypeList" onchange="criteriaChanged()" style="width:160px">
                  <option value="all">[ $i18n.getString( "select_domain_type" ) ]</option>
                  <option value="aggregate" #if ( $!domainType && $domainType == "aggregate" ) selected="selected" #end>$i18n.getString("aggregate")</option>
-                 <option value="patient" #if ( $!domainType && $domainType == "patient" ) selected="selected" #end>$i18n.getString("patient")</option>
+                 <option value="tracker" #if ( $!domainType && $domainType == "tracker" ) selected="selected" #end>$i18n.getString("tracker")</option>
               </select>
 						</div>
 					</td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm	2014-04-22 21:14:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm	2014-06-15 13:20:39 +0000
@@ -91,7 +91,7 @@
 		<td>
 			<select id="domainType" name="domainType" onchange='domainTypeChange(this.value)'>
 				<option value="aggregate" #if( $!dataElement.getDomainTypeNullSafe() == 'aggregate' ) selected="selected" #end>$i18n.getString( "aggregate" )</option>
-				<option value="patient" #if( $!dataElement.getDomainTypeNullSafe() == 'patient' ) selected="selected" #end>$i18n.getString( "patient" )</option>				
+				<option value="tracker" #if( $!dataElement.getDomainTypeNullSafe() == 'tracker' ) selected="selected" #end>$i18n.getString( "tracker" )</option>				
 			</select>
 		</td>
 	</tr>
@@ -171,7 +171,7 @@
 	<tr>	
 		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td>
-			<select id="selectedCategoryComboId" #if( $!dataElement.getDomainTypeNullSafe()=='patient') disabled #end>>
+			<select id="selectedCategoryComboId" #if( $!dataElement.getDomainTypeNullSafe()=='tracker') disabled #end>>
             #if( $update )
                 #foreach( $dataElementCategoryCombo in $!dataElementCategoryCombos )
                     <option value="$!dataElementCategoryCombo.id" #if( $!dataElementCategoryCombo.id == $!dataElement.categoryCombo.id ) selected="selected" #end>$!encoder.htmlEncode( $!dataElementCategoryCombo.displayName )</option>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js	2014-06-12 16:08:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js	2014-06-15 13:20:39 +0000
@@ -98,7 +98,7 @@
 
       var domainTypeMap = {
         'aggregate': i18n_aggregate,
-        'patient': i18n_patient
+        'tracker': i18n_tracker
       };
       var domainType = json.dataElement.domainType;
       setInnerHTML('domainTypeField', domainTypeMap[domainType]);