← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12324: minor changes

 

------------------------------------------------------------
revno: 12324
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-09-30 14:11:16 +0200
message:
  minor changes
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java	2013-09-23 07:29:58 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java	2013-09-30 12:11:16 +0000
@@ -72,9 +72,6 @@
     private ProgramStageDataElementService programStageDataElementService;
 
     @Autowired
-    private EnrollmentService enrollmentService;
-
-    @Autowired
     private ProgramInstanceService programInstanceService;
 
     @Autowired
@@ -83,9 +80,6 @@
     @Autowired
     private IdentifiableObjectManager manager;
 
-    @Autowired
-    private UserService userService;
-
     private OrganisationUnit organisationUnitA;
     private DataElement dataElementA;
     private Program programA;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java	2013-09-25 11:22:43 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java	2013-09-30 12:11:16 +0000
@@ -45,12 +45,9 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstanceService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageDataElementService;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.user.UserService;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -82,17 +79,8 @@
     private EnrollmentService enrollmentService;
 
     @Autowired
-    private ProgramInstanceService programInstanceService;
-
-    @Autowired
-    private ProgramStageInstanceService programStageInstanceService;
-
-    @Autowired
     private IdentifiableObjectManager manager;
 
-    @Autowired
-    private UserService userService;
-
     private Patient maleA;
     private Patient maleB;
     private Patient femaleA;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java	2013-09-25 11:22:43 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java	2013-09-30 12:11:16 +0000
@@ -82,17 +82,8 @@
     private EnrollmentService enrollmentService;
 
     @Autowired
-    private ProgramInstanceService programInstanceService;
-
-    @Autowired
-    private ProgramStageInstanceService programStageInstanceService;
-
-    @Autowired
     private IdentifiableObjectManager manager;
 
-    @Autowired
-    private UserService userService;
-
     private Patient maleA;
     private Patient maleB;
     private Patient femaleA;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-09-27 11:13:20 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-09-30 12:11:16 +0000
@@ -810,7 +810,8 @@
         ProgramStageInstance programStageInstance = null;
 
         Date currentDate = new Date();
-        Date dateCreatedEvent = null;
+        Date dateCreatedEvent;
+
         if ( programStage.getGeneratedByEnrollmentDate() )
         {
             dateCreatedEvent = enrollmentDate;
@@ -822,8 +823,7 @@
 
         Date dueDate = DateUtils.getDateAfterAddition( dateCreatedEvent, programStage.getMinDaysFromStart() );
 
-        if ( !programInstance.getProgram().getIgnoreOverdueEvents()
-            || !(programInstance.getProgram().getIgnoreOverdueEvents() && dueDate.before( currentDate )) )
+        if ( !programInstance.getProgram().getIgnoreOverdueEvents() || dueDate.before( currentDate ) )
         {
             programStageInstance = new ProgramStageInstance();
             programStageInstance.setProgramInstance( programInstance );