------------------------------------------------------------
revno: 3481
committer: Long <thanhlongngo1988>
branch nick: dhis2
timestamp: Thu 2011-04-28 14:10:33 +0700
message:
  [DHISMobile] Support mobile client to search for activity by beneficiary's 
identifier
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/MobileOrgUnitLinks.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingService.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml
  
dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java
  
dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.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/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2011-01-21 18:28:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2011-04-28 07:10:33 +0000
@@ -32,6 +32,7 @@
 import java.util.Map;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
 
 /**
  * @author Abyot Asalefew
@@ -40,40 +41,46 @@
 public interface ProgramStageInstanceService
 {
     String ID = ProgramStageInstanceService.class.getName();
-    
-    int addProgramStageInstance( ProgramStageInstance programStageInstance );    
-    
+
+    int addProgramStageInstance( ProgramStageInstance programStageInstance );
+
     void deleteProgramStageInstance( ProgramStageInstance programStageInstance );
-    
+
     void updateProgramStageInstance( ProgramStageInstance programStageInstance );
-    
+
     ProgramStageInstance getProgramStageInstance( int id );
-    
-    ProgramStageInstance getProgramStageInstance( ProgramInstance programInstance, ProgramStage programStage );      
-    
+
+    ProgramStageInstance getProgramStageInstance( ProgramInstance programInstance, ProgramStage programStage );
+
     Collection<ProgramStageInstance> getProgramStageInstances( ProgramStage programStage );
-    
+
     Collection<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances );
-    
+
     Collection<ProgramStageInstance> getProgramStageInstances( Date dueDate );
-    
+
     Collection<ProgramStageInstance> getProgramStageInstances( Date dueDate, Boolean completed );
-    
+
     Collection<ProgramStageInstance> getProgramStageInstances( Date startDate, Date endDate );
-    
+
     Collection<ProgramStageInstance> getProgramStageInstances( Date startDate, Date endDate, Boolean completed );
-    
-    Collection<ProgramStageInstance> getAllProgramStageInstances();     
-    
+
+    Collection<ProgramStageInstance> getAllProgramStageInstances();
+
     Map<Integer, String> colorProgramStageInstances( Collection<ProgramStageInstance> programStageInstances );
 
-    /** Get all {@link ProgramStageInstance program stage instances} for unit, optionally filtering by date or completed.
+    /**
+     * Get all {@link ProgramStageInstance program stage instances} for unit,
+     * optionally filtering by date or completed.
+     * 
      * @param unit - the unit to get instances for.
      * @param after - optional date the instance should be on or after.
      * @param before - optional date the instance should be on or before.
-     * @param completed - optional flag to only get completed (<code>true</code>) or uncompleted (<code>false</code>) instances. 
+     * @param completed - optional flag to only get completed (<code>true</code>
+     *        ) or uncompleted (<code>false</code>) instances.
      * @return
      */
-    public List<ProgramStageInstance> get(OrganisationUnit unit, Date after, Date before, Boolean completed);
+    public List<ProgramStageInstance> get( OrganisationUnit unit, Date after, Date before, Boolean completed );
+
+    List<ProgramStageInstance> getProgramStageInstances( Patient patient, Boolean completed );
 
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2011-01-21 18:28:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2011-04-28 07:10:33 +0000
@@ -32,6 +32,7 @@
 
 import org.hisp.dhis.common.GenericStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
 
 /**
  * @author Abyot Asalefew
@@ -65,4 +66,5 @@
      */
     public List<ProgramStageInstance> get(OrganisationUnit unit, Date after, Date before, Boolean completed);
 
+    List<ProgramStageInstance> getProgramStageInstances( Patient patient, Boolean completed);
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2011-04-22 18:37:49 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2011-04-28 07:10:33 +0000
@@ -34,6 +34,8 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
@@ -101,27 +103,73 @@
 
     public Collection<Activity> getCurrentActivitiesByProvider( OrganisationUnit organisationUnit )
     {
+        // long time = PeriodType.createCalendarInstance().getTime().getTime();
+        //
+        // List<Activity> items = new ArrayList<Activity>();
+        //
+        // Calendar expiredDate = Calendar.getInstance();
+        //
+        // Collection<ProgramStageInstance> programStageInstances =
+        // programStageInstanceService.get( organisationUnit,
+        // null, null, false );
+        //
+        // for ( ProgramStageInstance programStageInstance :
+        // programStageInstances )
+        // {
+        // expiredDate.setTime( DateUtils.getDateAfterAddition(
+        // programStageInstance.getDueDate(),
+        // programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData()
+        // ) );
+        // // TODO compare with date.before
+        // if ( programStageInstance.getDueDate().getTime() <= time &&
+        // expiredDate.getTimeInMillis() > time )
+        // {
+        // Activity activity = new Activity();
+        // activity.setBeneficiary(
+        // programStageInstance.getProgramInstance().getPatient() );
+        // activity.setTask( programStageInstance );
+        // activity.setDueDate( programStageInstance.getDueDate() );
+        // items.add( activity );
+        // }
+        // }
+        // return items;
+
         long time = PeriodType.createCalendarInstance().getTime().getTime();
 
         List<Activity> items = new ArrayList<Activity>();
 
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
+
+        Collection<Program> programs = programService.getPrograms( organisationUnit );
+
+        for ( Program program : programs )
+        {
+            programInstances.addAll( programInstanceService.getProgramInstances( program, organisationUnit ) );
+        }
+
         Calendar expiredDate = Calendar.getInstance();
 
-        Collection<ProgramStageInstance> programStageInstances = programStageInstanceService.get( organisationUnit,
-            null, null, false );
-        
-        for ( ProgramStageInstance programStageInstance : programStageInstances )
+        for ( ProgramInstance programInstance : programInstances )
         {
-            expiredDate.setTime( DateUtils.getDateAfterAddition( programStageInstance.getDueDate(),
-                programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData() ) );
-            // TODO compare with date.before
-            if ( programStageInstance.getDueDate().getTime() <= time && expiredDate.getTimeInMillis() > time )
+            Set<ProgramStageInstance> programStageInstances = programInstance.getProgramStageInstances();
+            for ( ProgramStageInstance programStageInstance : programStageInstances )
             {
-                Activity activity = new Activity();
-                activity.setBeneficiary( programStageInstance.getProgramInstance().getPatient() );
-                activity.setTask( programStageInstance );
-                activity.setDueDate( programStageInstance.getDueDate() );
-                items.add( activity );
+                if ( !programStageInstance.isCompleted() )
+                {
+                    expiredDate.setTime( DateUtils.getDateAfterAddition( programStageInstance.getDueDate(),
+                        programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData() ) );
+
+                    // TODO compare with date.before
+
+                    if ( programStageInstance.getDueDate().getTime() <= time && expiredDate.getTimeInMillis() > time )
+                    {
+                        Activity activity = new Activity();
+                        activity.setBeneficiary( programInstance.getPatient() );
+                        activity.setTask( programStageInstance );
+                        activity.setDueDate( programStageInstance.getDueDate() );
+                        items.add( activity );
+                    }
+                }
             }
         }
         return items;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2011-03-31 01:55:06 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2011-04-28 07:10:33 +0000
@@ -34,6 +34,7 @@
 import java.util.Map;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -163,4 +164,9 @@
     {
         return programStageInstanceStore.get( unit, after, before, completed );
     }
+
+    public List<ProgramStageInstance> getProgramStageInstances( Patient patient, Boolean completed )
+    {
+        return programStageInstanceStore.getProgramStageInstances( patient, completed );
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2011-03-31 01:55:06 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2011-04-28 07:10:33 +0000
@@ -34,6 +34,7 @@
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageInstance;
@@ -114,4 +115,14 @@
         return q.list();
     }
 
+    @SuppressWarnings( "unchecked" )
+    public List<ProgramStageInstance> getProgramStageInstances( Patient patient, Boolean completed )
+    {
+        String hql = "from ProgramStageInstance where programInstance.patient = :patient and completed = :completed";
+        Query q = getQuery( hql );
+        q.setEntity( "patient", patient );
+        q.setBoolean( "completed", completed );
+        return q.list();
+    }
+
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/MobileOrgUnitLinks.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/MobileOrgUnitLinks.java	2011-04-14 03:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/MobileOrgUnitLinks.java	2011-04-28 07:10:33 +0000
@@ -53,6 +53,8 @@
     private String updateDataSetUrl;
     
     private String changeUpdateDataSetLangUrl;
+    
+    private String searchUrl;
 
     @XmlAttribute
     public int getId()
@@ -126,6 +128,16 @@
         this.changeUpdateDataSetLangUrl = changeUpdateDataSetLangUrl;
     }
 
+    public String getSearchUrl()
+    {
+        return searchUrl;
+    }
+
+    public void setSearchUrl( String searchUrl )
+    {
+        this.searchUrl = searchUrl;
+    }
+
     public String getUpdateActivityPlanUrl() {
 		return updateActivityPlanUrl;
 	}
@@ -145,6 +157,7 @@
         dataOutputStream.writeUTF( this.uploadActivityReportUrl );
         dataOutputStream.writeUTF( this.updateDataSetUrl );
         dataOutputStream.writeUTF( this.changeUpdateDataSetLangUrl );
+        dataOutputStream.writeUTF( this.searchUrl );
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -158,6 +171,7 @@
         this.uploadActivityReportUrl = dataInputStream.readUTF();
         this.updateDataSetUrl = dataInputStream.readUTF();
         this.changeUpdateDataSetLangUrl = dataInputStream.readUTF();
+        this.searchUrl = dataInputStream.readUTF();
     }
 
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2011-04-14 03:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2011-04-28 07:10:33 +0000
@@ -49,6 +49,7 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.web.api.UrlResourceListener;
+import org.hisp.dhis.web.api.model.ActivityPlan;
 import org.hisp.dhis.web.api.model.ActivityValue;
 import org.hisp.dhis.web.api.model.DataSetList;
 import org.hisp.dhis.web.api.model.DataSetValue;
@@ -190,6 +191,13 @@
         return model;
     }
 
+    @GET
+    @Path( "search" )
+    public ActivityPlan search( @HeaderParam( "identifier" ) String identifier )
+    {
+        return activityReportingService.getActivitiesByIdentifier( identifier );
+    }
+
     public static MobileOrgUnitLinks getOrgUnit( OrganisationUnit unit, UriInfo uriInfo )
     {
         MobileOrgUnitLinks orgUnit = new MobileOrgUnitLinks();
@@ -208,6 +216,8 @@
             .toString() );
         orgUnit.setChangeUpdateDataSetLangUrl( getOrgUnitUrlBuilder( uriInfo ).path( "changeLanguageDataSet" )
             .build( unit.getId() ).toString() );
+        orgUnit.setSearchUrl( getOrgUnitUrlBuilder( uriInfo ).path( "search" )
+            .build( unit.getId() ).toString() );
         return orgUnit;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingService.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingService.java	2011-01-12 09:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingService.java	2011-04-28 07:10:33 +0000
@@ -36,6 +36,8 @@
 
     public ActivityPlan getCurrentActivityPlan( OrganisationUnit unit, String localeString );
 
+    public ActivityPlan getActivitiesByIdentifier( String keyword );
+
     public void saveActivityReport( OrganisationUnit unit, ActivityValue activityValue )
         throws NotAllowedException;
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2011-04-22 18:37:49 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2011-04-28 07:10:33 +0000
@@ -28,30 +28,38 @@
  */
 
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.activityplan.ActivityPlanService;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientIdentifierService;
 import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientMobileSetting;
 import org.hisp.dhis.patient.PatientMobileSettingService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
+import org.hisp.dhis.patientdatavalue.PatientDataValueService;
+import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
 import org.hisp.dhis.system.util.DateUtils;
 import org.hisp.dhis.web.api.model.Activity;
 import org.hisp.dhis.web.api.model.ActivityPlan;
@@ -79,26 +87,28 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private org.hisp.dhis.program.ProgramStageInstanceService programStageInstanceService;
+    private ProgramStageInstanceService programStageInstanceService;
 
-    private org.hisp.dhis.activityplan.ActivityPlanService activityPlanService;
+    private ActivityPlanService activityPlanService;
 
     private PatientAttributeValueService patientAttValueService;
 
     private PatientAttributeService patientAttService;
 
-    private org.hisp.dhis.dataelement.DataElementCategoryService categoryService;
+    private DataElementCategoryService categoryService;
 
-    private org.hisp.dhis.patientdatavalue.PatientDataValueService dataValueService;
+    private PatientDataValueService dataValueService;
 
     private PatientMobileSettingService patientMobileSettingService;
 
+    private PatientIdentifierService patientIdentifierService;
+
     // -------------------------------------------------------------------------
     // MobileDataSetService
     // -------------------------------------------------------------------------
-    
+
     private PatientMobileSetting setting;
-    
+
     private org.hisp.dhis.patient.PatientAttribute groupByAttribute;
 
     public ActivityPlan getCurrentActivityPlan( OrganisationUnit unit, String localeString )
@@ -106,13 +116,14 @@
         long time = System.currentTimeMillis();
 
         List<Activity> items = new ArrayList<Activity>();
-        
+
         this.setSetting( getSettings() );
-        
+
         this.setGroupByAttribute( patientAttService.getPatientAttributeByGroupBy( true ) );
-        
-        Collection<org.hisp.dhis.activityplan.Activity> activities = activityPlanService.getCurrentActivitiesByProvider( unit );
-        
+
+        Collection<org.hisp.dhis.activityplan.Activity> activities = activityPlanService
+            .getCurrentActivitiesByProvider( unit );
+
         for ( org.hisp.dhis.activityplan.Activity activity : activities )
         {
             items.add( getActivity( activity.getTask(), activity.getDueDate().getTime() < time ) );
@@ -131,6 +142,47 @@
 
         return new ActivityPlan( items );
     }
+    
+    @Override
+    public ActivityPlan getActivitiesByIdentifier( String keyword )
+    {
+        
+       long time = PeriodType.createCalendarInstance().getTime().getTime();
+
+        Calendar expiredDate = Calendar.getInstance();
+
+        List<Activity> items = new ArrayList<Activity>();
+        
+        Collection<Patient> patients = patientIdentifierService.getPatientsByIdentifier( keyword, 0, patientIdentifierService.countGetPatientsByIdentifier( keyword ) );
+        
+        if ( patients != null )
+        {
+            Iterator<Patient> iterator = patients.iterator();
+
+            while ( iterator.hasNext() )
+            {
+                Patient patient = iterator.next();
+                
+                List<ProgramStageInstance> programStageInstances = programStageInstanceService
+                    .getProgramStageInstances( patient, false );
+
+                for ( int i = 0; i < programStageInstances.size(); i++ )
+                {
+                    ProgramStageInstance programStageInstance = programStageInstances.get( i );
+
+                    expiredDate.setTime( DateUtils.getDateAfterAddition( programStageInstance.getDueDate(),
+                        programStageInstance.getProgramInstance().getProgram().getMaxDaysAllowedInputData() ) );
+
+                    if ( programStageInstance.getDueDate().getTime() <= time && expiredDate.getTimeInMillis() > time )
+                    {
+                        items.add( getActivity( programStageInstance,
+                            programStageInstance.getDueDate().getTime() < time ) );
+                    }
+                }
+            }
+        }
+        return new ActivityPlan( items );
+    }
 
     // -------------------------------------------------------------------------
     // DataValueService
@@ -197,7 +249,7 @@
     {
         Activity activity = new Activity();
         Patient patient = instance.getProgramInstance().getPatient();
-                
+
         activity.setBeneficiary( getBeneficiaryModel( patient ) );
         activity.setDueDate( instance.getDueDate() );
         activity.setTask( getTask( instance ) );
@@ -257,8 +309,7 @@
             {
                 beneficiary.setRegistrationDate( patient.getRegistrationDate() );
             }
-            
-            
+
             atts = setting.getPatientAttributes();
             for ( org.hisp.dhis.patient.PatientAttribute each : atts )
             {
@@ -268,13 +319,13 @@
                     patientAtts.add( new PatientAttribute( each.getName(), value.getValue() ) );
                 }
             }
-            
+
         }
 
         // Set attribute which is used to group beneficiary on mobile (only if
         // there is attribute which is set to be group factor)
         PatientAttribute beneficiaryAttribute = null;
-       
+
         if ( groupByAttribute != null )
         {
             beneficiaryAttribute = new PatientAttribute();
@@ -446,6 +497,17 @@
     {
         this.groupByAttribute = groupByAttribute;
     }
+
+    public PatientIdentifierService getPatientIdentifierService()
+    {
+        return patientIdentifierService;
+    }
+    
+    @Required
+    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
+    {
+        this.patientIdentifierService = patientIdentifierService;
+    }
     
     
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml	2011-04-14 03:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml	2011-04-28 07:10:33 +0000
@@ -61,6 +61,7 @@
     <property name="dataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
     <property name="patientMobileSettingService" ref="org.hisp.dhis.patient.PatientMobileSettingService" />
     <property name="activityPlanService" ref="org.hisp.dhis.activityplan.ActivityPlanService" />
+	<property name="patientIdentifierService" ref="org.hisp.dhis.patient.PatientIdentifierService" />
   </bean>
 
   <bean id="org.hisp.dhis.web.api.service.IProgramService" class="org.hisp.dhis.web.api.service.DefaultProgramService">

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java'
--- dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java	2011-04-14 08:39:44 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java	2011-04-28 07:10:33 +0000
@@ -53,6 +53,7 @@
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
         unit.setUpdateDataSetUrl( "updateDataSetUrl" );
         unit.setChangeUpdateDataSetLangUrl( "changeUpdateDataSetLangUrl" );
+        unit.setSearchUrl( "search" );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream dos = new DataOutputStream( baos );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java'
--- dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java	2011-04-14 08:39:44 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java	2011-04-28 07:10:33 +0000
@@ -79,6 +79,7 @@
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
         unit.setUpdateDataSetUrl( "updateDataSetUrl" );
         unit.setChangeUpdateDataSetLangUrl( "changeUpdateDataSetLangUrl" );
+        unit.setSearchUrl( "search" );
         return unit;
     }
 }

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

Reply via email to