← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16993: minor fixes, add orgUnit to csv

 

------------------------------------------------------------
revno: 16993
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-10-08 13:15:25 +0700
message:
  minor fixes, add orgUnit to csv
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/CsvEventDataValue.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/DefaultCsvEventService.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/event/csv/CsvEventDataValue.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/CsvEventDataValue.java	2014-10-08 06:12:13 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/CsvEventDataValue.java	2014-10-08 06:15:25 +0000
@@ -43,6 +43,7 @@
     "program",
     "programStage",
     "enrollment",
+    "orgUnit",
     "eventDate",
     "dueDate",
     "latitude",
@@ -62,6 +63,8 @@
 
     private String programStage;
 
+    private String orgUnit;
+
     private String enrollment;
 
     private String eventDate;
@@ -93,6 +96,7 @@
         this.program = dataValue.getProgram();
         this.programStage = dataValue.getProgramStage();
         this.enrollment = dataValue.getEnrollment();
+        this.orgUnit = dataValue.getOrgUnit();
         this.eventDate = dataValue.getEventDate();
         this.dueDate = dataValue.getDueDate();
         this.latitude = dataValue.getLatitude();
@@ -159,6 +163,17 @@
     }
 
     @JsonProperty
+    public String getOrgUnit()
+    {
+        return orgUnit;
+    }
+
+    public void setOrgUnit( String orgUnit )
+    {
+        this.orgUnit = orgUnit;
+    }
+
+    @JsonProperty
     public String getEventDate()
     {
         return eventDate;
@@ -249,11 +264,12 @@
     @Override
     public int hashCode()
     {
-        return Objects.hash( event, status, program, programStage, enrollment, eventDate, dueDate, latitude, longitude, dataElement,
-            value, storedBy, providedElsewhere );
+        return Objects.hash( event, status, program, programStage, orgUnit, enrollment, eventDate, dueDate, latitude, longitude,
+            dataElement, value, storedBy, providedElsewhere );
     }
 
-    @Override public boolean equals( Object obj )
+    @Override
+    public boolean equals( Object obj )
     {
         if ( this == obj )
         {
@@ -267,12 +283,12 @@
         final CsvEventDataValue other = (CsvEventDataValue) obj;
 
         return Objects.equals( this.event, other.event ) && Objects.equals( this.status, other.status ) && Objects.equals( this.program,
-            other.program ) && Objects.equals( this.programStage, other.programStage ) && Objects.equals( this.enrollment,
-            other.enrollment ) && Objects.equals( this.eventDate, other.eventDate ) && Objects.equals( this.dueDate,
-            other.dueDate ) && Objects.equals( this.latitude, other.latitude ) && Objects.equals( this.longitude,
-            other.longitude ) && Objects.equals( this.dataElement, other.dataElement ) && Objects.equals( this.value,
-            other.value ) && Objects.equals( this.storedBy, other.storedBy ) && Objects.equals( this.providedElsewhere,
-            other.providedElsewhere );
+            other.program ) && Objects.equals( this.programStage, other.programStage ) && Objects.equals( this.orgUnit,
+            other.orgUnit ) && Objects.equals( this.enrollment, other.enrollment ) && Objects.equals( this.eventDate,
+            other.eventDate ) && Objects.equals( this.dueDate, other.dueDate ) && Objects.equals( this.latitude,
+            other.latitude ) && Objects.equals( this.longitude, other.longitude ) && Objects.equals( this.dataElement,
+            other.dataElement ) && Objects.equals( this.value, other.value ) && Objects.equals( this.storedBy,
+            other.storedBy ) && Objects.equals( this.providedElsewhere, other.providedElsewhere );
     }
 
     @Override
@@ -284,6 +300,7 @@
             .add( "program", program )
             .add( "programStage", programStage )
             .add( "enrollment", enrollment )
+            .add( "orgUnit", orgUnit )
             .add( "eventDate", eventDate )
             .add( "dueDate", dueDate )
             .add( "latitude", latitude )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/DefaultCsvEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/DefaultCsvEventService.java	2014-10-08 06:12:13 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/csv/DefaultCsvEventService.java	2014-10-08 06:15:25 +0000
@@ -81,6 +81,7 @@
             templateDataValue.setProgram( event.getProgram() );
             templateDataValue.setProgramStage( event.getProgramStage() );
             templateDataValue.setEnrollment( event.getEnrollment() );
+            templateDataValue.setOrgUnit( event.getOrgUnit() );
             templateDataValue.setEventDate( event.getEventDate() );
             templateDataValue.setDueDate( event.getDueDate() );
             templateDataValue.setStoredBy( event.getStoredBy() );
@@ -134,6 +135,7 @@
                 event.setProgram( dataValue.getProgram() );
                 event.setProgramStage( dataValue.getProgramStage() );
                 event.setEnrollment( dataValue.getEnrollment() );
+                event.setOrgUnit( dataValue.getOrgUnit() );
                 event.setEventDate( event.getEventDate() );
                 event.setDueDate( event.getDueDate() );