← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14281: Renamed method Program.getEntityAttributes to getTrackedEntityAttributes

 

------------------------------------------------------------
revno: 14281
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-03-18 15:54:13 +0100
message:
  Renamed method Program.getEntityAttributes to getTrackedEntityAttributes
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodStore.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/TrackedEntityAttributeController.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.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-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaAction.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/QueryItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2014-03-18 14:54:13 +0000
@@ -28,7 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -130,7 +133,23 @@
     {
         return isNumeric() ? Double.class.getName() : String.class.getName();
     }
+
+    public static List<QueryItem> getQueryItems( Collection<? extends IdentifiableObject> objects )
+    {
+        List<QueryItem> queryItems = new ArrayList<QueryItem>();
+        
+        for ( IdentifiableObject object : objects )
+        {
+            queryItems.add( new QueryItem( object, null, null, false ) );
+        }
+        
+        return queryItems;
+    }
     
+    // -------------------------------------------------------------------------
+    // toString
+    // -------------------------------------------------------------------------
+
     @Override
     public String toString()
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-03-18 14:54:13 +0000
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.view.DetailedView;
@@ -45,16 +45,16 @@
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.trackedentity.TrackedEntity;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminder;
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.validation.ValidationCriteria;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 
 /**
  * @author Abyot Asalefew
@@ -181,7 +181,7 @@
     /**
      * Returns TrackedEntityAttributes from ProgramTrackedEntityAttributes.
      */
-    public List<TrackedEntityAttribute> getEntityAttributes()
+    public List<TrackedEntityAttribute> getTrackedEntityAttributes()
     {
         List<TrackedEntityAttribute> entityAttributes = new ArrayList<TrackedEntityAttribute>();
 
@@ -357,15 +357,6 @@
         this.displayIncidentDate = displayIncidentDate;
     }
 
-    //@JsonProperty
-    //@JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
-    //@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    private Object getValueFromTrackedEntityInstance( String property, TrackedEntityInstance entityInstance )
-        throws Exception
-    {
-        return TrackedEntityInstance.class.getMethod( "get" + property ).invoke( entityInstance );
-    }
-
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java	2014-03-18 11:26:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java	2014-03-18 14:54:13 +0000
@@ -94,6 +94,12 @@
         return setMap;
     }
     
+    /**
+     * Indicates whether this is a logical OR query, meaning that a query string
+     * is specified and instances which matches this query on one or more attributes
+     * should be included in the response. The opposite is an item-specific query,
+     * where the instances which matches the specific attributes should be included.
+     */
     public boolean isOrQuery()
     {
         return hasQuery();
@@ -114,6 +120,14 @@
     {
         return items != null && !items.isEmpty();
     }
+
+    /**
+     * Indicates whether this params specifies any organisation units.
+     */
+    public boolean hasOrganisationUnits()
+    {
+        return organisationUnits != null && !organisationUnits.isEmpty();
+    }
     
     /**
      * Indicates whether this params specifies a program.

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodService.java	2014-03-18 14:54:13 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 
 /**
  * @author Lars Helge Overland

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodStore.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodStore.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportDataDailyPeriodStore.java	2014-03-18 14:54:13 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 
 /**
  * @author Lars Helge Overland

=== modified file '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/ActivityReportingServiceImpl.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2014-03-18 14:54:13 +0000
@@ -1384,7 +1384,7 @@
         if ( programId != null && !programId.trim().equals( "" ) )
         {
             Program program = programService.getProgram( Integer.parseInt( programId ) );
-            patientAttributes = program.getEntityAttributes();
+            patientAttributes = program.getTrackedEntityAttributes();
         }
         else
         {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2014-03-18 14:54:13 +0000
@@ -282,7 +282,7 @@
 
         for ( Program program : programs )
         {
-            List<TrackedEntityAttribute> atttributes = program.getEntityAttributes();
+            List<TrackedEntityAttribute> atttributes = program.getTrackedEntityAttributes();
             while ( iterAttribute.hasNext() )
             {
                 TrackedEntityAttributeValue attributeValue = iterAttribute.next();
@@ -360,7 +360,7 @@
 
         TrackedEntityInstance instance = programInstance.getEntityInstance();
 
-        Collection<TrackedEntityAttribute> atttributes = programInstance.getProgram().getEntityAttributes();
+        Collection<TrackedEntityAttribute> atttributes = programInstance.getProgram().getTrackedEntityAttributes();
 
         for ( TrackedEntityAttribute attrtibute : atttributes )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-03-18 11:26:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-03-18 14:54:13 +0000
@@ -145,6 +145,12 @@
     {
         validate( params );
         
+        if ( params.isOrQuery() )
+        {
+            params.getItems().clear();
+            params.getItems().addAll( getItemsForOrQuery( params ) );
+        }
+        
         Grid grid = new ListGrid();
         
         grid.addHeader( new GridHeader( TRACKED_ENTITY_INSTANCE_ID, "Instance" ) );
@@ -178,6 +184,23 @@
         return grid;
     }
     
+    /**
+     * Returns the appropriate items for a OR query with no items specified. If 
+     * the params specifies a program, the program attributes will be returned. 
+     * If not, all attributes will be returned.
+     */
+    private List<QueryItem> getItemsForOrQuery( TrackedEntityInstanceQueryParams params )
+    {
+        if ( params.hasProgram() )
+        {
+            return QueryItem.getQueryItems( params.getProgram().getTrackedEntityAttributes() );
+        }
+        else
+        {
+            return QueryItem.getQueryItems( attributeService.getAllTrackedEntityAttributes() );
+        }
+    }
+    
     public void validate( TrackedEntityInstanceQueryParams params )
         throws IllegalQueryException
     {
@@ -190,7 +213,17 @@
         
         if ( params.hasQuery() && params.hasItems() )
         {
-            violation = "Query and items cannot be specified simultaneously";
+            violation = "Query and item cannot be specified simultaneously";
+        }
+        
+        if ( !params.hasQuery() && !params.hasItems() )
+        {
+            violation = "At least one of query and item must be specified";
+        }
+
+        if ( !params.hasOrganisationUnits() )
+        {
+            violation = "At least one organisation unit must be specified";
         }
         
         if ( params.hasProgram() && params.hasTrackedEntity() )
@@ -212,25 +245,31 @@
     {
         TrackedEntityInstanceQueryParams params = new TrackedEntityInstanceQueryParams();
 
-        for ( String item : items )
+        if ( items != null )
         {
-            QueryItem it = getQueryItem( item );
-            
-            params.getItems().add( it );
+            for ( String item : items )
+            {
+                QueryItem it = getQueryItem( item );
+                
+                params.getItems().add( it );
+            }
         }
 
-        for ( String orgUnit : ou )
+        if ( ou != null )
         {
-            OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnit );
-            
-            if ( organisationUnit == null )
+            for ( String orgUnit : ou )
             {
-                throw new IllegalQueryException( "Organisation unit does not exist: " + orgUnit );
+                OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnit );
+                
+                if ( organisationUnit == null )
+                {
+                    throw new IllegalQueryException( "Organisation unit does not exist: " + orgUnit );
+                }
+                
+                organisationUnit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) );
+                
+                params.getOrganisationUnits().add( organisationUnit );
             }
-            
-            organisationUnit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) );
-            
-            params.getOrganisationUnits().add( organisationUnit );
         }
         
         Program pr = program != null ? programService.getProgram( program ) : null;
@@ -709,7 +748,7 @@
         grid.addHeader( new GridHeader( i18n.getString( "gender" ), true, true ) );
         grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) );
 
-        Collection<TrackedEntityAttribute> attributes = program.getEntityAttributes();
+        Collection<TrackedEntityAttribute> attributes = program.getTrackedEntityAttributes();
 
         for ( TrackedEntityAttribute attribute : attributes )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-03-18 13:40:38 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-03-18 14:54:13 +0000
@@ -157,14 +157,16 @@
         {
             String col = statementBuilder.columnQuote( item.getItemId() );
             
+            String joinClause = params.isOrQuery() ? "full outer join" : "inner join";
+            
             sql += 
-                "inner join trackedentityattributevalue as " + col + " " +
+                joinClause + " trackedentityattributevalue as " + col + " " +
                 "on " + col + ".trackedentityinstanceid = tei.trackedentityinstanceid " +
                 "and " + col + ".trackedentityattributeid = " + item.getItem().getId() + " ";
             
             String filter = statementBuilder.encode( item.getFilter(), false );
             
-            if ( item.hasFilter() )
+            if ( !params.isOrQuery() && item.hasFilter() )
             {
                 sql += "and " + col + ".value " + item.getSqlOperator() + " " + item.getSqlFilter( filter ) + " ";
             }
@@ -203,6 +205,21 @@
                 "where pi.trackedentityinstanceid=tei.trackedentityinstanceid " +
                 "and pi.programid = " + params.getProgram().getId() + ") ";
         }
+        
+        if ( params.isOrQuery() && params.hasItems() )
+        {
+            sql += hlp.whereAnd() + " (";
+            
+            for ( QueryItem item : params.getItems() )
+            {
+                String col = statementBuilder.columnQuote( item.getItemId() );
+                String query = statementBuilder.encode( params.getQuery(), false );
+                
+                sql += col + ".value = '" + query + "' or ";
+            }
+            
+            sql = sql.substring( 0, sql.length() - 3 ) + ") "; // Reomove last or
+        }
 
         // ---------------------------------------------------------------------
         // Paging clause

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java	2014-03-18 14:20:02 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java	2014-03-18 14:54:13 +0000
@@ -206,9 +206,9 @@
             }
         }
         
-        if( options.hasPaging() )
+        if ( options.hasPaging() )
         {      	
-        	Pager pager = new Pager( options.getPage(), eventList.size(), options.getPageSize() );
+            Pager pager = new Pager( options.getPage(), eventList.size(), options.getPageSize() );
             metaData.setPager( pager );
             eventList = PagerUtils.pageCollection( eventList, pager );        	
         }        
@@ -218,8 +218,7 @@
         model.addAttribute( "model", metaData );
         model.addAttribute( "viewClass", options.getViewClass( "detailed" ) );
 
-        return "events";        
-
+        return "events";
     }
 
     @RequestMapping( value = "/{uid}", method = RequestMethod.GET )

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/TrackedEntityAttributeController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/TrackedEntityAttributeController.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/TrackedEntityAttributeController.java	2014-03-18 14:54:13 +0000
@@ -89,7 +89,7 @@
 
             if ( program != null )
             {
-                entityList = new ArrayList<TrackedEntityAttribute>( program.getEntityAttributes() );
+                entityList = new ArrayList<TrackedEntityAttribute>( program.getTrackedEntityAttributes() );
             }
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-03-18 14:54:13 +0000
@@ -173,7 +173,7 @@
             programs.remove( program );
             for ( Program p : programs )
             {
-                attributesInProgram.addAll( p.getEntityAttributes() );
+                attributesInProgram.addAll( p.getTrackedEntityAttributes() );
             }
 
             attributeGroups = new ArrayList<TrackedEntityAttributeGroup>(

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2014-03-18 14:54:13 +0000
@@ -111,7 +111,7 @@
         if ( id != null )
         {
             Program program = programService.getProgram( id );
-            attributes = program.getEntityAttributes();
+            attributes = program.getTrackedEntityAttributes();
         }
         else
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2014-03-18 14:54:13 +0000
@@ -237,7 +237,7 @@
                 Collection<Program> programs = programService.getAllPrograms();
                 for ( Program p : programs )
                 {
-                    for ( TrackedEntityAttribute attribute : p.getEntityAttributes() )
+                    for ( TrackedEntityAttribute attribute : p.getTrackedEntityAttributes() )
                     {
                         if ( !attribute.getDisplayInListNoProgram() )
                         {
@@ -248,7 +248,7 @@
             }
             else
             {
-                attributes = program.getEntityAttributes();
+                attributes = program.getTrackedEntityAttributes();
             }
 
             for ( TrackedEntityAttribute attribute : attributes )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2014-03-18 14:54:13 +0000
@@ -179,7 +179,7 @@
         // Load attributes of the selected program
         // ---------------------------------------------------------------------
 
-        attributes = new ArrayList<TrackedEntityAttribute>( programInstance.getProgram().getEntityAttributes() );
+        attributes = new ArrayList<TrackedEntityAttribute>( programInstance.getProgram().getTrackedEntityAttributes() );
 
         if ( attributes != null )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2014-03-18 14:54:13 +0000
@@ -359,7 +359,7 @@
             }
             else
             {
-                attributes = program.getEntityAttributes();
+                attributes = program.getTrackedEntityAttributes();
             }
 
             Collection<TrackedEntityAttribute> attributesInList = attributeService.getTrackedEntityAttributesDisplayedInList( true );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2014-03-18 14:54:13 +0000
@@ -217,7 +217,7 @@
 
         for ( Program program : programs )
         {
-            Collection<TrackedEntityAttribute> atttributes = program.getEntityAttributes();
+            Collection<TrackedEntityAttribute> atttributes = program.getTrackedEntityAttributes();
             for ( TrackedEntityAttributeValue attributeValue : _attributeValues )
             {
                 if ( atttributes.contains( attributeValue.getAttribute() ) )

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java	2014-03-18 14:54:13 +0000
@@ -151,7 +151,7 @@
             return REDIRECT;
         }
 
-        patientAttributes = program.getEntityAttributes();
+        patientAttributes = program.getTrackedEntityAttributes();
         now = new SimpleDateFormat( "yyyy-MM-dd" ).format( new Date() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2014-03-18 14:54:13 +0000
@@ -250,7 +250,7 @@
     {
         patient = patientService.getTrackedEntityInstance( patientId );
         program = programService.getProgram( programId );
-        patientAttributes = program.getEntityAttributes();
+        patientAttributes = program.getTrackedEntityAttributes();
 
         List<TrackedEntityAttributeValue> patientAttributeValues = new ArrayList<TrackedEntityAttributeValue>();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java	2014-03-18 14:54:13 +0000
@@ -162,7 +162,7 @@
         else
         {
             program = programService.getProgram( programId );
-            attributes = program.getEntityAttributes();
+            attributes = program.getTrackedEntityAttributes();
             registrationForm = formService.getTrackedEntityForm( program );
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java	2014-03-18 14:54:13 +0000
@@ -134,7 +134,7 @@
 
         userGroups = new ArrayList<UserGroup>( userGroupService.getAllUserGroups() );
 
-        attributes = new ArrayList<TrackedEntityAttribute>( program.getEntityAttributes() );
+        attributes = new ArrayList<TrackedEntityAttribute>( program.getTrackedEntityAttributes() );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java	2014-03-18 14:54:13 +0000
@@ -104,7 +104,7 @@
 
         userGroups = new ArrayList<UserGroup>( userGroupService.getAllUserGroups() );
 
-        attributes = program.getEntityAttributes();
+        attributes = program.getTrackedEntityAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaAction.java	2014-03-18 14:54:13 +0000
@@ -121,7 +121,7 @@
 
         program = programService.getProgram( programId );
 
-        attribute = program.getEntityAttributes();
+        attribute = program.getTrackedEntityAttributes();
 
         Collections.sort( attribute, IdentifiableObjectNameComparator.INSTANCE );