dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24870
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12236: removed use of PSI.completed from Events + service/test fixes
------------------------------------------------------------
revno: 12236
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-09-25 13:22:43 +0200
message:
removed use of PSI.completed from Events + service/test fixes
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.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
--
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/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2013-09-25 08:02:58 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2013-09-25 11:22:43 +0000
@@ -461,7 +461,6 @@
Event event = new Event();
- event.setCompleted( programStageInstance.isCompleted() );
event.setEvent( programStageInstance.getUid() );
event.setStatus( EventStatus.fromInt( programStageInstance.getStatus() ) );
event.setEventDate( programStageInstance.getExecutionDate().toString() );
@@ -648,12 +647,12 @@
if ( programStageInstance == null )
{
programStageInstance = createProgramStageInstance( programStage, programInstance, organisationUnit, eventDate,
- event.getCompleted(), event.getCoordinate(), storedBy );
+ EventStatus.COMPLETED.equals( event.getStatus() ), event.getCoordinate(), storedBy );
}
else
{
updateProgramStageInstance( programStage, programInstance, organisationUnit, eventDate,
- event.getCompleted(), event.getCoordinate(), storedBy, programStageInstance );
+ EventStatus.COMPLETED.equals( event.getStatus() ), event.getCoordinate(), storedBy, programStageInstance );
}
importSummary.setReference( programStageInstance.getUid() );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java 2013-09-23 08:37:56 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java 2013-09-25 11:22:43 +0000
@@ -117,7 +117,6 @@
{
event = new Event();
- event.setCompleted( rowSet.getBoolean( "psi_completed" ) );
event.setEvent( rowSet.getString( "psi_uid" ) );
event.setStatus( EventStatus.fromInt( rowSet.getInt( "psi_status" ) ) );
event.setProgram( rowSet.getString( "p_uid" ) );
@@ -144,7 +143,7 @@
private String buildSql( List<Integer> programIds, List<Integer> programStageIds, List<Integer> orgUnitIds, Date startDate, Date endDate )
{
String sql = "select p.uid as p_uid, ps.uid as ps_uid, psi.uid as psi_uid, psi.status as psi_status, ou.uid as ou_uid, psi.executiondate as psi_executiondate," +
- " psi.completeduser as psi_completeduser, psi.completed as psi_completed," +
+ " psi.completeduser as psi_completeduser," +
" pdv.value as pdv_value, pdv.storedby as pdv_storedby, pdv.providedelsewhere as pdv_providedelsewhere, de.uid as de_uid" +
" from program p" +
" left join programstage ps on ps.programid=p.programid" +
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java 2013-09-23 08:37:56 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java 2013-09-25 11:22:43 +0000
@@ -58,8 +58,6 @@
private String eventDate;
- private Boolean completed = false;
-
private String storedBy;
private Coordinate coordinate;
@@ -156,18 +154,6 @@
@JsonProperty
@JacksonXmlProperty( isAttribute = true )
- public Boolean getCompleted()
- {
- return completed;
- }
-
- public void setCompleted( Boolean completed )
- {
- this.completed = completed;
- }
-
- @JsonProperty
- @JacksonXmlProperty( isAttribute = true )
public String getStoredBy()
{
return storedBy;
@@ -211,7 +197,6 @@
Event event1 = (Event) o;
- if ( completed != null ? !completed.equals( event1.completed ) : event1.completed != null ) return false;
if ( coordinate != null ? !coordinate.equals( event1.coordinate ) : event1.coordinate != null ) return false;
if ( dataValues != null ? !dataValues.equals( event1.dataValues ) : event1.dataValues != null ) return false;
if ( event != null ? !event.equals( event1.event ) : event1.event != null ) return false;
@@ -236,7 +221,6 @@
result = 31 * result + (orgUnit != null ? orgUnit.hashCode() : 0);
result = 31 * result + (person != null ? person.hashCode() : 0);
result = 31 * result + (eventDate != null ? eventDate.hashCode() : 0);
- result = 31 * result + (completed != null ? completed.hashCode() : 0);
result = 31 * result + (storedBy != null ? storedBy.hashCode() : 0);
result = 31 * result + (coordinate != null ? coordinate.hashCode() : 0);
result = 31 * result + (dataValues != null ? dataValues.hashCode() : 0);
@@ -254,7 +238,6 @@
", orgUnit='" + orgUnit + '\'' +
", person='" + person + '\'' +
", eventDate='" + eventDate + '\'' +
- ", completed=" + completed +
", storedBy='" + storedBy + '\'' +
", coordinate=" + coordinate +
", dataValues=" + dataValues +
=== 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 08:02:58 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java 2013-09-25 11:22:43 +0000
@@ -232,7 +232,7 @@
}
@Test
- public void testSaveWithoutEventIdShouldCreateNewRepeatableEvent()
+ public void testSaveRepeatableStageWithoutEventIdShouldCreateNewEvent()
{
Enrollment enrollment = createEnrollment( programA.getUid(), personMaleA.getPerson() );
ImportSummary importSummary = enrollmentService.saveEnrollment( enrollment );
@@ -256,7 +256,7 @@
}
@Test
- public void testSaveWithEventIdShouldNotCreateAdditionalRepeatableEvents()
+ public void testSaveRepeatableStageWithEventIdShouldNotCreateAdditionalEvents()
{
Enrollment enrollment = createEnrollment( programA.getUid(), personMaleA.getPerson() );
ImportSummary importSummary = enrollmentService.saveEnrollment( enrollment );
=== 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-23 12:07:14 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java 2013-09-25 11:22:43 +0000
@@ -37,6 +37,7 @@
import org.hisp.dhis.dxf2.events.event.DataValue;
import org.hisp.dhis.dxf2.events.event.Event;
import org.hisp.dhis.dxf2.events.event.EventService;
+import org.hisp.dhis.dxf2.events.event.EventStatus;
import org.hisp.dhis.dxf2.events.person.Person;
import org.hisp.dhis.dxf2.events.person.PersonService;
import org.hisp.dhis.dxf2.importsummary.ImportStatus;
@@ -222,7 +223,7 @@
enrollmentService.saveEnrollment( enrollment );
Event event = createEvent( programA.getUid(), organisationUnitA.getUid(), personMaleA.getPerson() );
- event.setCompleted( true );
+ event.setStatus( EventStatus.COMPLETED );
ImportSummary importSummary1 = eventService.saveEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary1.getStatus() );
enrollment = enrollmentService.getEnrollments( personMaleA ).getEnrollments().get( 0 );
@@ -232,7 +233,7 @@
enrollmentService.saveEnrollment( enrollment );
event = createEvent( programA.getUid(), organisationUnitA.getUid(), personMaleA.getPerson() );
- event.setCompleted( true );
+ event.setStatus( EventStatus.COMPLETED );
ImportSummary importSummary2 = eventService.saveEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary2.getStatus() );
enrollment = enrollmentService.getEnrollments( personMaleA ).getEnrollments().get( 0 );