dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25000
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12311: using PeriodType.getPeriodFromIsoString( isoPeriod ), create new method in ActivityReportingServi...
------------------------------------------------------------
revno: 12311
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-09-30 14:50:50 +0700
message:
using PeriodType.getPeriodFromIsoString( isoPeriod ), create new method in ActivityReportingService to support lost to follow up for J2ME
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.java
dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java
dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java
dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.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-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java 2013-09-23 08:00:15 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java 2013-09-30 07:50:50 +0000
@@ -72,7 +72,7 @@
public Collection<PatientIdentifierType> getIdentifierTypes();
- public Collection<org.hisp.dhis.patient.PatientAttribute> getPatientAtts(String programId);
+ public Collection<org.hisp.dhis.patient.PatientAttribute> getPatientAtts( String programId );
public Collection<PatientIdentifierType> getIdentifiers( String programId );
@@ -97,4 +97,6 @@
public Integer savePatient( Patient patient, int orgUnitId, String programId )
throws NotAllowedException;
+ public String findLostToFollowUp( int orgUnitId, String programId )
+ throws NotAllowedException;
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2013-09-08 08:36:32 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2013-09-30 07:50:50 +0000
@@ -84,6 +84,8 @@
private String findLatestPersonUrl;
private String findPatientInAdvancedUrl;
+
+ private String findLostToFollowUpUrl;
@XmlAttribute
public int getId()
@@ -307,6 +309,16 @@
this.findPatientInAdvancedUrl = findPatientInAdvancedUrl;
}
+ public String getFindLostToFollowUpUrl()
+ {
+ return findLostToFollowUpUrl;
+ }
+
+ public void setFindLostToFollowUpUrl( String findLostToFollowUpUrl )
+ {
+ this.findLostToFollowUpUrl = findLostToFollowUpUrl;
+ }
+
public void serialize( DataOutputStream dataOutputStream )
throws IOException
@@ -332,6 +344,7 @@
dataOutputStream.writeUTF( this.findProgramUrl );
dataOutputStream.writeUTF( this.findLatestPersonUrl );
dataOutputStream.writeUTF( this.findPatientInAdvancedUrl );
+ dataOutputStream.writeUTF( this.findLostToFollowUpUrl );
}
public void deSerialize( DataInputStream dataInputStream )
@@ -358,6 +371,7 @@
this.findProgramUrl = dataInputStream.readUTF();
this.findLatestPersonUrl = dataInputStream.readUTF();
this.findPatientInAdvancedUrl = dataInputStream.readUTF();
+ this.findLostToFollowUpUrl = dataInputStream.readUTF();
}
@Override
@@ -417,5 +431,6 @@
dataOutputStream.writeUTF( this.findProgramUrl );
dataOutputStream.writeUTF( this.findLatestPersonUrl );
dataOutputStream.writeUTF( this.findPatientInAdvancedUrl );
+ dataOutputStream.writeUTF( this.findLostToFollowUpUrl );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-27 11:13:20 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-30 07:50:50 +0000
@@ -36,6 +36,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -1970,4 +1971,11 @@
return patientMobile;
}
}
+
+ @Override
+ public String findLostToFollowUp( int orgUnitId, String programId )
+ throws NotAllowedException
+ {
+ return "";
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.java 2013-09-11 16:13:49 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.java 2013-09-30 07:50:50 +0000
@@ -180,7 +180,7 @@
{
return null;
}
-
+
return date;
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java 2013-09-08 08:36:32 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java 2013-09-30 07:50:50 +0000
@@ -69,6 +69,7 @@
unit.setFindProgramUrl( "findProgramUrl" );
unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
unit.setFindPatientInAdvancedUrl( "findPatientInAdvanced" );
+ unit.setFindLostToFollowUpUrl( "findLostToFollowUpUrl" );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( baos );
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java 2013-09-08 08:36:32 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java 2013-09-30 07:50:50 +0000
@@ -94,6 +94,7 @@
unit.setFindProgramUrl( "findProgramUrl" );
unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
unit.setFindPatientInAdvancedUrl( "findPatientInAdvancedUrl" );
+ unit.setFindLostToFollowUpUrl( "findLostToFollowUpUrl" );
return unit;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java 2013-09-08 08:36:32 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java 2013-09-30 07:50:50 +0000
@@ -157,6 +157,7 @@
orgUnit.setFindProgramUrl( getUrl( request, unit.getId(), "findProgram" ) );
orgUnit.setFindLatestPersonUrl( getUrl( request, unit.getId(), "findLatestPerson" ) );
orgUnit.setFindPatientInAdvancedUrl( getUrl( request, unit.getId(), "findPatientInAdvanced" ) );
+ orgUnit.setFindLostToFollowUpUrl( getUrl( request, unit.getId(), "findLostToFollowUp" ) );
// generate URL for download new version
String full = UrlUtils.buildFullRequestUrl( request );
=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2013-09-23 08:00:15 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2013-09-30 07:50:50 +0000
@@ -393,6 +393,14 @@
{
return activityReportingService.findProgram( programInfo );
}
+
+ @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findLostToFollowUp" )
+ @ResponseBody
+ public String findLostToFollowUp( @PathVariable int id, @RequestHeader( "programId" ) String programId )
+ throws NotAllowedException
+ {
+ return "";
+ }
// Supportive methods
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java 2013-09-11 13:46:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/action/MenuAction.java 2013-09-30 07:50:50 +0000
@@ -98,11 +98,11 @@
return organisationUnit;
}
- private String periodId;
+ private String isoPeriod;
- public void setPeriodId( String periodId )
+ public void setIsoPeriod( String isoPeriod )
{
- this.periodId = periodId;
+ this.isoPeriod = isoPeriod;
}
private Period period;
@@ -149,7 +149,7 @@
{
organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- period = periodService.getPeriodByExternalId( periodId );
+ period = periodService.getPeriod( isoPeriod );
period.setName( format.formatPeriod( period ) );
dataSet = dataSetService.getDataSet( dataSetId );