← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12944: minor eventStore fix

 

------------------------------------------------------------
revno: 12944
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-11-14 12:01:50 +0100
message:
  minor eventStore fix
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.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/DefaultEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java	2013-11-14 10:45:28 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java	2013-11-14 11:01:50 +0000
@@ -118,7 +118,7 @@
                 event = new Event();
 
                 event.setEvent( rowSet.getString( "psi_uid" ) );
-                event.setPerson( rowSet.getString( "ps_person" ) );
+                event.setPerson( rowSet.getString( "pa_uid" ) );
                 event.setStatus( EventStatus.fromInt( rowSet.getInt( "psi_status" ) ) );
                 event.setProgram( rowSet.getString( "p_uid" ) );
                 event.setProgramStage( rowSet.getString( "ps_uid" ) );
@@ -143,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, ps.patientid as ps_person, psi.uid as psi_uid, psi.status as psi_status, ou.uid as ou_uid, psi.executiondate as psi_executiondate," +
+        String sql = "select p.uid as p_uid, ps.uid as ps_uid, pa.uid as pa_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," +
             " pdv.value as pdv_value, pdv.storedby as pdv_storedby, pdv.providedelsewhere as pdv_providedelsewhere, de.uid as de_uid" +
             " from program p" +
@@ -151,7 +151,8 @@
             " left join programstageinstance psi on ps.programstageid=psi.programstageid" +
             " left join organisationunit ou on (psi.organisationunitid=ou.organisationunitid)" +
             " left join patientdatavalue pdv on psi.programstageinstanceid=pdv.programstageinstanceid" +
-            " left join dataelement de on pdv.dataelementid=de.dataelementid ";
+            " left join dataelement de on pdv.dataelementid=de.dataelementid " +
+            " left join patient pa on pa.patientid=ps.patientid ";
 
         boolean startedWhere = false;