dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24677
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12139: add dateOfEnrollment, dateOfIncident to Enrollment
------------------------------------------------------------
revno: 12139
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-09-18 13:28:35 +0200
message:
add dateOfEnrollment, dateOfIncident to Enrollment
modified:
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/Enrollment.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/EnrollmentService.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-09-18 09:59:56 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2013-09-18 11:28:35 +0000
@@ -156,6 +156,8 @@
enrollment.setEnrollment( programInstance.getUid() );
enrollment.setPerson( programInstance.getPatient().getUid() );
enrollment.setProgram( programInstance.getProgram().getUid() );
+ enrollment.setDateOfEnrollment( programInstance.getEnrollmentDate() );
+ enrollment.setDateOfIncident( programInstance.getDateOfIncident() );
return enrollment;
}
@@ -169,7 +171,7 @@
List<Program> programs = new ArrayList<Program>();
programs.addAll( programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION ) );
programs.addAll( programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION ) );
-
+
return programs;
}
-}
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java 2013-09-17 14:42:57 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java 2013-09-18 11:28:35 +0000
@@ -33,6 +33,8 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.hisp.dhis.common.DxfNamespaces;
+import java.util.Date;
+
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
@@ -45,6 +47,10 @@
private String program;
+ private Date dateOfEnrollment;
+
+ private Date dateOfIncident;
+
public Enrollment()
{
}
@@ -84,4 +90,28 @@
{
this.program = program;
}
+
+ @JsonProperty( required = true )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Date getDateOfEnrollment()
+ {
+ return dateOfEnrollment;
+ }
+
+ public void setDateOfEnrollment( Date dateOfEnrollment )
+ {
+ this.dateOfEnrollment = dateOfEnrollment;
+ }
+
+ @JsonProperty( required = true )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Date getDateOfIncident()
+ {
+ return dateOfIncident;
+ }
+
+ public void setDateOfIncident( Date dateOfIncident )
+ {
+ this.dateOfIncident = dateOfIncident;
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/EnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/EnrollmentService.java 2013-09-18 09:50:42 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/EnrollmentService.java 2013-09-18 11:28:35 +0000
@@ -74,7 +74,6 @@
// UPDATE
// -------------------------------------------------------------------------
-
// -------------------------------------------------------------------------
// DELETE
// -------------------------------------------------------------------------