← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14936: Minor fix.

 

------------------------------------------------------------
revno: 14936
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-04-22 08:23:35 +0800
message:
  Minor fix.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.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-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.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/trackedentity/TrackedEntityInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-04-21 23:47:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-04-22 00:23:35 +0000
@@ -37,7 +37,6 @@
 import org.hisp.dhis.common.IllegalQueryException;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
 import org.hisp.dhis.event.EventStatus;
-import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
@@ -318,26 +317,6 @@
     List<Integer> getProgramStageInstances( List<String> searchKeys, Collection<OrganisationUnit> orgunit,
         Boolean followup, Integer statusEnrollment, Integer min, Integer max );
 
-//    /**
-//     * Get visit schedule of person who meet the criteria for searching
-//     * 
-//     * @param searchKeys The key for searching entityInstances by attribute
-//     *        values and/or a program
-//     * @param orgunit Organisation unit where entityInstances registered
-//     * @param followup Only getting entityInstances with program risked if this
-//     *        property is true. And getting entityInstances without program
-//     *        risked if its value is false
-//     * @param statusEnrollment The status of program of entityInstances. There
-//     *        are three status, includes Active enrollments only, Completed
-//     *        enrollments only and Active and completed enrollments
-//     * @parma min
-//     * @param max
-//     * 
-//     * @return Grid
-//     */
-//    Grid getScheduledEventsReport( List<String> searchKeys, Collection<OrganisationUnit> orgunits, Boolean followup,
-//        Integer statusEnrollment, Integer min, Integer max, I18n i18n );
-
     /**
      * Search entityInstances by phone number (performs partial search)
      * 
@@ -349,28 +328,6 @@
      */
     Collection<TrackedEntityInstance> getTrackedEntityInstancesByPhone( String phoneNumber, Integer min, Integer max );
 
-//    /**
-//     * Get events of entityInstances who meet the criteria for searching
-//     * 
-//     * @param program Program. It's is used for getting attributes of this
-//     *        program and put attribute values of entityInstances into the
-//     *        result
-//     * @param searchKeys The key for searching entityInstances by attribute
-//     *        values and/or a program
-//     * @param orgunit Organisation unit where entityInstances registered
-//     * @param followup Only getting entityInstances with program risked if this
-//     *        property is true. And getting entityInstances without program
-//     *        risked if its value is false
-//     * @param statusEnrollment The status of program of entityInstances. There
-//     *        are three status, includes Active enrollments only, Completed
-//     *        enrollments only and Active and completed enrollments
-//     * @param i18n I18n
-//     * 
-//     * @return Grid
-//     */
-//    Grid getTrackingEventsReport( Program program, List<String> searchKeys, Collection<OrganisationUnit> orgunits,
-//        Boolean followup, Integer statusEnrollment, I18n i18n );
-
     /**
      * Validate entityInstance attributes and validation criteria by program
      * before registering or updating information

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-04-21 23:47:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-04-22 00:23:35 +0000
@@ -33,7 +33,6 @@
 import java.util.Map;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
-import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
@@ -115,24 +114,6 @@
      * @return The number of entityInstances
      */
     int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
-//
-//    /**
-//     * Get number of entityInstances who meet the criteria for searching
-//     * 
-//     * @param searchKeys The key for searching entityInstances by attribute
-//     *        values and/or a program
-//     * @param orgunit Organisation unit where entityInstances registered
-//     * @param followup Only getting entityInstances with program risked if this
-//     *        property is true. And getting entityInstances without program
-//     *        risked if its value is false
-//     * @param statusEnrollment The status of program of entityInstances. There
-//     *        are three status, includes Active enrollments only, Completed
-//     *        enrollments only and Active and completed enrollments
-//     * 
-//     * @return The number of entityInstances
-//     */
-//    int countSearch( List<String> searchKeys, Collection<OrganisationUnit> orgunit, Boolean followup,
-//        Integer statusEnrollment );
 
     /**
      * Search entityInstances by phone number (performs partial search)
@@ -179,30 +160,6 @@
      */
     Collection<TrackedEntityInstance> getByProgram( Program program, Integer min, Integer max );
 
-//    /**
-//     * Search events of entityInstances who meet the criteria for searching
-//     * 
-//     * @param grid Grid with headers
-//     * @param searchKeys The key for searching entityInstances by attribute
-//     *        values and/or a program
-//     * @param orgunit Organisation unit where entityInstances registered
-//     * @param followup Only getting entityInstances with program risked if this
-//     *        property is true. And getting entityInstances without program
-//     *        risked if its value is false
-//     * @param attributes The attribute values of these attribute are displayed
-//     *        into result
-//     * @param statusEnrollment The status of program of entityInstances. There
-//     *        are three status, includes Active enrollments only, Completed
-//     *        enrollments only and Active and completed enrollments
-//     * @param min
-//     * @param max
-//     * 
-//     * @return Grid
-//     */
-//    Grid getTrackedEntityInstanceEventReport( Grid grid, List<String> searchKeys, Collection<OrganisationUnit> orgunit,
-//        Boolean followup, Collection<TrackedEntityAttribute> attributes, Integer statusEnrollment, Integer min,
-//        Integer max );
-
     /**
      * Validate entity-instances attribute values and validation criteria by program
      * before registering / updating information

=== 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-04-21 23:47:56 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-04-22 00:23:35 +0000
@@ -57,7 +57,6 @@
 import org.hisp.dhis.common.Pager;
 import org.hisp.dhis.common.QueryItem;
 import org.hisp.dhis.event.EventStatus;
-import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -751,97 +750,6 @@
         return trackedEntityInstanceStore.getByPhoneNumber( phoneNumber, min, max );
     }
 
-//    @Override
-//    public Grid getScheduledEventsReport( List<String> searchKeys, Collection<OrganisationUnit> orgunits,
-//        Boolean followup, Integer statusEnrollment, Integer min, Integer max, I18n i18n )
-//    {
-//        String startDate = "";
-//        String endDate = "";
-//        for ( String searchKey : searchKeys )
-//        {
-//            String[] keys = searchKey.split( "_" );
-//            if ( keys[0].equals( TrackedEntityInstance.PREFIX_PROGRAM_EVENT_BY_STATUS ) )
-//            {
-//                startDate = keys[2];
-//                endDate = keys[3];
-//            }
-//        }
-//
-//        Grid grid = new ListGrid();
-//        grid.setTitle( i18n.getString( "activity_plan" ) );
-//        if ( !startDate.isEmpty() && !endDate.isEmpty() )
-//        {
-//            grid.setSubtitle( i18n.getString( "from" ) + " " + startDate + " " + i18n.getString( "to" ) + " " + endDate );
-//        }
-//
-//        grid.addHeader( new GridHeader( "entityInstanceid", true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "first_name" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "middle_name" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "last_name" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "gender" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) );
-//
-//        Collection<TrackedEntityAttribute> attributes = attributeService
-//            .getTrackedEntityAttributesByDisplayOnVisitSchedule( true );
-//        for ( TrackedEntityAttribute attribute : attributes )
-//        {
-//            grid.addHeader( new GridHeader( attribute.getDisplayName(), false, true ) );
-//        }
-//
-//        grid.addHeader( new GridHeader( "programstageinstanceid", true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "due_date" ), false, true ) );
-//
-//        return trackedEntityInstanceStore.getTrackedEntityInstanceEventReport( grid, searchKeys, orgunits, followup,
-//            attributes, statusEnrollment, min, max );
-//    }
-
-//    @Override
-//    public Grid getTrackingEventsReport( Program program, List<String> searchKeys,
-//        Collection<OrganisationUnit> orgunits, Boolean followup, Integer statusEnrollment, I18n i18n )
-//    {
-//        String startDate = "";
-//        String endDate = "";
-//        for ( String searchKey : searchKeys )
-//        {
-//            String[] keys = searchKey.split( "_" );
-//            if ( keys[0].equals( TrackedEntityInstance.PREFIX_PROGRAM_EVENT_BY_STATUS ) )
-//            {
-//                startDate = keys[2];
-//                endDate = keys[3];
-//            }
-//        }
-//
-//        Grid grid = new ListGrid();
-//        grid.setTitle( i18n.getString( "program_tracking" ) );
-//        if ( !startDate.isEmpty() && !endDate.isEmpty() )
-//        {
-//            grid.setSubtitle( i18n.getString( "from" ) + " " + startDate + " " + i18n.getString( "to" ) + " " + endDate );
-//        }
-//
-//        grid.addHeader( new GridHeader( "entityInstanceid", true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "first_name" ), true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "middle_name" ), true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "last_name" ), true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "gender" ), true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) );
-//
-//        Collection<TrackedEntityAttribute> attributes = program.getTrackedEntityAttributes();
-//
-//        for ( TrackedEntityAttribute attribute : attributes )
-//        {
-//            grid.addHeader( new GridHeader( attribute.getDisplayName(), false, true ) );
-//        }
-//
-//        grid.addHeader( new GridHeader( "programstageinstanceid", true, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "due_date" ), false, true ) );
-//        grid.addHeader( new GridHeader( i18n.getString( "risk" ), false, true ) );
-//
-//        return trackedEntityInstanceStore.getTrackedEntityInstanceEventReport( grid, searchKeys, orgunits, followup,
-//            attributes, statusEnrollment, null, null );
-//    }
-
     @Override
     public String validateTrackedEntityInstance( TrackedEntityInstance instance, Program program, I18nFormat format )
     {

=== 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-04-21 23:47:56 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-04-22 00:23:35 +0000
@@ -64,7 +64,6 @@
 import org.hibernate.Query;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
 import org.hisp.dhis.common.QueryFilter;
 import org.hisp.dhis.common.QueryItem;
@@ -79,7 +78,6 @@
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.ProgramStatus;
-import org.hisp.dhis.system.grid.GridUtils;
 import org.hisp.dhis.system.util.SqlHelper;
 import org.hisp.dhis.system.util.Timer;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
@@ -662,29 +660,6 @@
         return programStageInstanceIds;
     }
 
-//    public int countSearch( List<String> searchKeys, Collection<OrganisationUnit> orgunits, Boolean followup,
-//        Integer statusEnrollment )
-//    {
-//        String sql = searchTrackedEntityInstanceSql( true, searchKeys, orgunits, followup, null, statusEnrollment,
-//            null, null );
-//        return jdbcTemplate.queryForObject( sql, Integer.class );
-//    }
-//
-//    @Override
-//    public Grid getTrackedEntityInstanceEventReport( Grid grid, List<String> searchKeys,
-//        Collection<OrganisationUnit> orgunits, Boolean followup, Collection<TrackedEntityAttribute> attributes,
-//        Integer statusEnrollment, Integer min, Integer max )
-//    {
-//        String sql = searchTrackedEntityInstanceSql( false, searchKeys, orgunits, followup, attributes,
-//            statusEnrollment, min, max );
-//
-//        SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql );
-//
-//        GridUtils.addRows( grid, rowSet );
-//
-//        return grid;
-//    }
-
     private String searchTrackedEntityInstanceSql( boolean count, List<String> searchKeys,
         Collection<OrganisationUnit> orgunits, Boolean followup, Collection<TrackedEntityAttribute> attributes,
         Integer statusEnrollment, Integer min, Integer max )

=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-04-22 00:23:35 +0000
@@ -139,18 +139,18 @@
                 orgunits.add( organisationUnit );
             }
 
-            total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE );
-            this.paging = createPaging( total );
-            patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE,
-                paging.getStartPos(), paging.getPageSize() );
-
-            if ( !searchBySelectedOrgunit )
-            {
-                for ( TrackedEntityInstance patient : patients )
-                {
-                    mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
-                }
-            }
+//            total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE );
+//            this.paging = createPaging( total );
+//            patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE,
+//                paging.getStartPos(), paging.getPageSize() );
+//
+//            if ( !searchBySelectedOrgunit )
+//            {
+//                for ( TrackedEntityInstance patient : patients )
+//                {
+//                    mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
+//                }
+//            }
         }
 
         return SUCCESS;