dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42547
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21758: Added missing TEI properties in todays events
------------------------------------------------------------
revno: 21758
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-01-15 14:45:46 +0100
message:
Added missing TEI properties in todays events
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/report/EventRow.java
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
--
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/JdbcEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java 2016-01-05 18:15:16 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java 2016-01-15 13:45:46 +0000
@@ -223,7 +223,11 @@
eventRow.setEvent( rowSet.getString( "psi_uid" ) );
eventRow.setTrackedEntityInstance( rowSet.getString( "tei_uid" ) );
-
+ eventRow.setTrackedEntityInstanceOrgUnit( rowSet.getString( "tei_ou" ) );
+ eventRow.setTrackedEntityInstanceOrgUnitName( rowSet.getString( "tei_ou_name" ) );
+ eventRow.setTrackedEntityInstanceCreated( rowSet.getString( "tei_created" ) );
+ eventRow.setTrackedEntityInstanceInactive( rowSet.getBoolean( "tei_inactive" ) );
+
eventRow.setProgram( IdSchemes.getValue( rowSet.getString( "p_uid" ), rowSet.getString( "p_code" ),
idSchemes.getProgramIdScheme() ) );
eventRow.setProgramStage( IdSchemes.getValue( rowSet.getString( "ps_uid" ),
@@ -349,13 +353,15 @@
"psi.storedby as psi_storedby, psi.longitude as psi_longitude, psi.latitude as psi_latitude, psi.created as psi_created, psi.lastupdated as psi_lastupdated, psi.completeddate as psi_completeddate, " +
"pi.uid as pi_uid, pi.status as pi_status, pi.followup as pi_followup, p.uid as p_uid, p.code as p_code, " +
"p.type as p_type, ps.uid as ps_uid, ps.code as ps_code, ps.capturecoordinates as ps_capturecoordinates, " +
- "ou.uid as ou_uid, ou.code as ou_code, ou.name as ou_name, tei.trackedentityinstanceid as tei_id, tei.uid as tei_uid " +
+ "ou.uid as ou_uid, ou.code as ou_code, ou.name as ou_name, " +
+ "tei.trackedentityinstanceid as tei_id, tei.uid as tei_uid, teiou.uid as tei_ou, teiou.name as tei_ou_name, tei.created as tei_created, tei.inactive as tei_inactive " +
"from programstageinstance psi " +
"inner join programinstance pi on pi.programinstanceid=psi.programinstanceid " +
"inner join program p on p.programid=pi.programid " +
"inner join programstage ps on ps.programstageid=psi.programstageid " +
"left join trackedentityinstance tei on tei.trackedentityinstanceid=pi.trackedentityinstanceid " +
- "left join organisationunit ou on (psi.organisationunitid=ou.organisationunitid) ";
+ "left join organisationunit ou on (psi.organisationunitid=ou.organisationunitid) " +
+ "left join organisationunit teiou on (tei.organisationunitid=teiou.organisationunitid) ";
if ( params.getTrackedEntityInstance() != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/report/EventRow.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/report/EventRow.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/report/EventRow.java 2016-01-15 13:45:46 +0000
@@ -53,6 +53,14 @@
{
private String trackedEntityInstance;
+ private String trackedEntityInstanceOrgUnit;
+
+ private String trackedEntityInstanceOrgUnitName;
+
+ private String trackedEntityInstanceCreated;
+
+ private boolean trackedEntityInstanceInactive;
+
private String event;
private String program;
@@ -93,7 +101,55 @@
public void setTrackedEntityInstance( String trackedEntityInstance )
{
this.trackedEntityInstance = trackedEntityInstance;
- }
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( isAttribute = true )
+ public String getTrackedEntityInstanceOrgUnit()
+ {
+ return trackedEntityInstanceOrgUnit;
+ }
+
+ public void setTrackedEntityInstanceOrgUnit( String trackedEntityInstanceOrgUnit )
+ {
+ this.trackedEntityInstanceOrgUnit = trackedEntityInstanceOrgUnit;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( isAttribute = true )
+ public String getTrackedEntityInstanceOrgUnitName()
+ {
+ return trackedEntityInstanceOrgUnitName;
+ }
+
+ public void setTrackedEntityInstanceOrgUnitName( String trackedEntityInstanceOrgUnitName )
+ {
+ this.trackedEntityInstanceOrgUnitName = trackedEntityInstanceOrgUnitName;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( isAttribute = true )
+ public String getTrackedEntityInstanceCreated()
+ {
+ return trackedEntityInstanceCreated;
+ }
+
+ public void setTrackedEntityInstanceCreated( String trackedEntityInstanceCreated )
+ {
+ this.trackedEntityInstanceCreated = trackedEntityInstanceCreated;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( isAttribute = true )
+ public boolean getTrackedEntityInstanceInactive()
+ {
+ return trackedEntityInstanceInactive;
+ }
+
+ public void setTrackedEntityInstanceInactive( boolean trackedEntityInstanceInactive )
+ {
+ this.trackedEntityInstanceInactive = trackedEntityInstanceInactive;
+ }
@JsonProperty
@JacksonXmlProperty( isAttribute = true )
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2016-01-14 13:41:40 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2016-01-15 13:45:46 +0000
@@ -308,7 +308,15 @@
if(result.eventRows){
angular.forEach(result.eventRows, function(eventRow){
if(ids.indexOf(eventRow.trackedEntityInstance) === -1){
- var row = { id: eventRow.trackedEntityInstance};
+
+ var row = {
+ id: eventRow.trackedEntityInstance,
+ created: DateUtils.formatFromApiToUser(eventRow.trackedEntityInstanceCreated),
+ orgUnit: eventRow.trackedEntityInstanceOrgUnit,
+ orgUnitName: eventRow.trackedEntityInstanceOrgUnitName,
+ inactive: eventRow.trackedEntityInstanceInactive
+ };
+
angular.forEach(eventRow.attributes, function(attr){
row[attr.attribute] = attr.value;
});