← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12863: Error when to build.

 

------------------------------------------------------------
revno: 12863
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-11-04 11:13:54 +0700
message:
  Error when to build.
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.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/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2013-10-15 09:06:28 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2013-11-04 04:13:54 +0000
@@ -52,7 +52,8 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public abstract class AbstractEnrollmentService implements EnrollmentService
+public abstract class AbstractEnrollmentService
+    implements EnrollmentService
 {
     @Autowired
     private ProgramInstanceService programInstanceService;
@@ -104,7 +105,8 @@
     {
         List<Program> programs = getProgramsWithRegistration();
 
-        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( programs ) );
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>(
+            programInstanceService.getProgramInstances( programs ) );
         return getEnrollments( programInstances );
     }
 
@@ -136,8 +138,7 @@
     @Override
     public Enrollments getEnrollments( Patient patient )
     {
-        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>(
-            programInstanceService.getProgramInstances( patient ) );
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>( patient.getProgramInstances() );
 
         return getEnrollments( programInstances );
     }
@@ -154,7 +155,8 @@
     @Override
     public Enrollments getEnrollments( Program program )
     {
-        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( program ) );
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>(
+            programInstanceService.getProgramInstances( program ) );
         return getEnrollments( programInstances );
     }
 
@@ -171,7 +173,8 @@
     public Enrollments getEnrollments( OrganisationUnit organisationUnit )
     {
         List<Program> programs = getProgramsWithRegistration();
-        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( programs, organisationUnit ) );
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>(
+            programInstanceService.getProgramInstances( programs, organisationUnit ) );
 
         return getEnrollments( programInstances );
     }
@@ -255,15 +258,16 @@
 
         if ( !enrollments.getEnrollments().isEmpty() )
         {
-            ImportSummary importSummary = new ImportSummary( ImportStatus.ERROR, "Person " + person.getPerson() + " already have an active enrollment in program "
-                + program.getUid() );
+            ImportSummary importSummary = new ImportSummary( ImportStatus.ERROR, "Person " + person.getPerson()
+                + " already have an active enrollment in program " + program.getUid() );
             importSummary.getImportCount().incrementIgnored();
 
             return importSummary;
         }
 
-        ProgramInstance programInstance = programInstanceService.enrollPatient( patient, program, enrollment.getDateOfEnrollment(), enrollment.getDateOfIncident(),
-            patient.getOrganisationUnit(), getFormat() );
+        ProgramInstance programInstance = programInstanceService.enrollPatient( patient, program,
+            enrollment.getDateOfEnrollment(), enrollment.getDateOfIncident(), patient.getOrganisationUnit(),
+            getFormat() );
 
         if ( programInstance == null )
         {
@@ -324,7 +328,8 @@
             }
             else
             {
-                ImportSummary importSummary = new ImportSummary( ImportStatus.ERROR, "Re-enrollment is not allowed, please create a new enrollment." );
+                ImportSummary importSummary = new ImportSummary( ImportStatus.ERROR,
+                    "Re-enrollment is not allowed, please create a new enrollment." );
                 importSummary.getImportCount().incrementIgnored();
 
                 return importSummary;