dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29843
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15151: [mobile] finished feedback server side
------------------------------------------------------------
revno: 15151
committer: Hong Em <em.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-05 17:16:05 +0700
message:
[mobile] finished feedback server side
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/Message.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/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
--
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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java 2014-05-05 10:16:05 +0000
@@ -33,6 +33,7 @@
import org.hisp.dhis.api.mobile.model.ActivityPlan;
import org.hisp.dhis.api.mobile.model.ActivityValue;
+import org.hisp.dhis.api.mobile.model.Message;
import org.hisp.dhis.api.mobile.model.PatientAttribute;
import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
@@ -98,8 +99,11 @@
public Patient generateRepeatableEvent( int orgUnitId, String eventInfo )
throws NotAllowedException;
-
+
public String saveSingleEventWithoutRegistration( ProgramStage programStage, int orgUnitId )
throws NotAllowedException;
+ public String sendFeedback( Message message )
+ throws NotAllowedException;
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java 2014-04-24 09:55:26 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java 2014-05-05 10:16:05 +0000
@@ -109,7 +109,8 @@
public void serializeVersion2_8( DataOutputStream dataOutputStream )
throws IOException
{
- // TODO Auto-generated method stub
+ dataOutputStream.writeUTF( this.subject );
+ dataOutputStream.writeUTF( this.text );
}
@@ -117,7 +118,8 @@
public void serializeVersion2_9( DataOutputStream dataOutputStream )
throws IOException
{
- // TODO Auto-generated method stub
+ dataOutputStream.writeUTF( this.subject );
+ dataOutputStream.writeUTF( this.text );
}
@@ -125,7 +127,8 @@
public void serializeVersion2_10( DataOutputStream dataOutputStream )
throws IOException
{
- // TODO Auto-generated method stub
+ dataOutputStream.writeUTF( this.subject );
+ dataOutputStream.writeUTF( this.text );
}
=== 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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2014-05-05 10:16:05 +0000
@@ -65,6 +65,8 @@
private String updateNewVersionUrl;
+ private String sendFeedbackUrl;
+
private String updateContactUrl;
private String findPatientUrl;
@@ -90,7 +92,7 @@
private String handleLostToFollowUpUrl;
private String generateRepeatableEventUrl;
-
+
private String uploadSingleEventWithoutRegistration;
@XmlAttribute
@@ -215,6 +217,16 @@
this.updateNewVersionUrl = updateNewVersionUrl;
}
+ public String getSendFeedbackUrl()
+ {
+ return sendFeedbackUrl;
+ }
+
+ public void setSendFeedbackUrl( String sendFeedbackUrl )
+ {
+ this.sendFeedbackUrl = sendFeedbackUrl;
+ }
+
public String getUpdateContactUrl()
{
return updateContactUrl;
@@ -344,7 +356,7 @@
{
this.generateRepeatableEventUrl = generateRepeatableEventUrl;
}
-
+
public String getUploadSingleEventWithoutRegistration()
{
return uploadSingleEventWithoutRegistration;
@@ -369,6 +381,7 @@
dataOutputStream.writeUTF( changeUpdateDataSetLangUrl );
dataOutputStream.writeUTF( searchUrl );
dataOutputStream.writeUTF( updateNewVersionUrl );
+ dataOutputStream.writeUTF( sendFeedbackUrl );
dataOutputStream.writeUTF( updateContactUrl );
dataOutputStream.writeUTF( findPatientUrl );
dataOutputStream.writeUTF( registerPersonUrl );
@@ -382,7 +395,9 @@
dataOutputStream.writeUTF( findLostToFollowUpUrl );
dataOutputStream.writeUTF( handleLostToFollowUpUrl );
dataOutputStream.writeUTF( generateRepeatableEventUrl );
- dataOutputStream.writeUTF( uploadSingleEventWithoutRegistration);
+ dataOutputStream.writeUTF( uploadSingleEventWithoutRegistration );
+
+
}
public void deSerialize( DataInputStream dataInputStream )
@@ -399,6 +414,7 @@
changeUpdateDataSetLangUrl = dataInputStream.readUTF();
searchUrl = dataInputStream.readUTF();
updateNewVersionUrl = dataInputStream.readUTF();
+ sendFeedbackUrl = dataInputStream.readUTF();
updateContactUrl = dataInputStream.readUTF();
findPatientUrl = dataInputStream.readUTF();
registerPersonUrl = dataInputStream.readUTF();
@@ -413,6 +429,7 @@
handleLostToFollowUpUrl = dataInputStream.readUTF();
generateRepeatableEventUrl = dataInputStream.readUTF();
uploadSingleEventWithoutRegistration = dataInputStream.readUTF();
+
}
@Override
@@ -446,6 +463,7 @@
dataOutputStream.writeUTF( this.changeUpdateDataSetLangUrl );
dataOutputStream.writeUTF( this.searchUrl );
dataOutputStream.writeUTF( this.updateNewVersionUrl );
+ dataOutputStream.writeUTF( this.sendFeedbackUrl );
// dataOutputStream.writeUTF( this.updateContactUrl );
}
@@ -464,6 +482,7 @@
dataOutputStream.writeUTF( changeUpdateDataSetLangUrl );
dataOutputStream.writeUTF( searchUrl );
dataOutputStream.writeUTF( updateNewVersionUrl );
+ dataOutputStream.writeUTF( sendFeedbackUrl );
dataOutputStream.writeUTF( updateContactUrl );
dataOutputStream.writeUTF( findPatientUrl );
dataOutputStream.writeUTF( registerPersonUrl );
@@ -478,5 +497,6 @@
dataOutputStream.writeUTF( handleLostToFollowUpUrl );
dataOutputStream.writeUTF( generateRepeatableEventUrl );
dataOutputStream.writeUTF( uploadSingleEventWithoutRegistration );
+
}
}
=== 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 2014-05-05 07:45:18 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2014-05-05 10:16:05 +0000
@@ -110,6 +110,8 @@
private static final String SINGLE_EVENT_WITHOUT_REGISTRATION_UPLOADED = "single_event_without_registration_uploaded";
+ private static final String FEEDBACK_SENT = "feedback_sent";
+
private ActivityComparator activityComparator = new ActivityComparator();
// -------------------------------------------------------------------------
@@ -1851,4 +1853,18 @@
}
return SINGLE_EVENT_WITHOUT_REGISTRATION_UPLOADED;
}
+
+ @Override
+ public String sendFeedback( org.hisp.dhis.api.mobile.model.Message message )
+ throws NotAllowedException
+ {
+
+ String subject = message.getSubject();
+ String text = message.getText();
+ String metaData = MessageService.META_USER_AGENT;
+
+ messageService.sendFeedback( subject, text, metaData );
+
+ return FEEDBACK_SENT;
+ }
}
\ No newline at end of file
=== 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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java 2014-05-05 10:16:05 +0000
@@ -59,6 +59,7 @@
unit.setChangeUpdateDataSetLangUrl( "changeUpdateDataSetLangUrl" );
unit.setSearchUrl( "search" );
unit.setUpdateNewVersionUrl( "" );
+ unit.setSendFeedbackUrl( "sendFeedbackUrl" );
unit.setUpdateContactUrl( "updateContactUrl" );
unit.setFindPatientUrl( "findPatientUrl" );
unit.setUploadProgramStageUrl( "uploadProgramStageUrl" );
=== 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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java 2014-05-05 10:16:05 +0000
@@ -76,7 +76,6 @@
orgUnit.setId( 1 );
orgUnit.setName( "name" );
-
orgUnit.setDownloadAllUrl( "all" );
orgUnit.setUpdateActivityPlanUrl( "activitiyplan" );
orgUnit.setUploadFacilityReportUrl( "dataSets" );
@@ -86,6 +85,7 @@
orgUnit.setChangeUpdateDataSetLangUrl( "changeLanguageDataSet" );
orgUnit.setSearchUrl( "search" );
orgUnit.setUpdateNewVersionUrl( "updateNewVersionUrl" );
+ orgUnit.setSendFeedbackUrl( "sendFeedback" );
orgUnit.setUpdateContactUrl( "updateContactForMobile" );
orgUnit.setFindPatientUrl( "findPatient" );
orgUnit.setRegisterPersonUrl( "registerPerson" );
@@ -100,30 +100,7 @@
orgUnit.setHandleLostToFollowUpUrl( "handleLostToFollowUp" );
orgUnit.setGenerateRepeatableEventUrl( "generateRepeatableEvent" );
orgUnit.setUploadSingleEventWithoutRegistration( "uploadSingleEventWithoutRegistration" );
- // unit.setDownloadAllUrl( "downloadAllUrl" );
- // unit.setDownloadFacilityReportUrl( "downloadFacilityReportUrl" );
- // unit.setUpdateActivityPlanUrl( "updateActivityPlanUrl" );
- // unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
- // unit.setUploadActivityReportUrl( "uploadActivityReportUrl" );
- // unit.setUpdateDataSetUrl( "updateDataSetUrl" );
- // unit.setChangeUpdateDataSetLangUrl( "changeUpdateDataSetLangUrl" );
- // unit.setSearchUrl( "search" );
- // unit.setUpdateNewVersionUrl( "" );
- // unit.setUpdateContactUrl( "updateContactUrl" );
- // unit.setFindPatientUrl( "findPatientUrl" );
- // unit.setUploadProgramStageUrl( "uploadProgramStageUrl" );
- // unit.setEnrollProgramUrl( "enrollProgramUrl" );
- // unit.setRegisterPersonUrl( "registerPersonUrl" );
- // unit.setGetVariesInfoUrl( "getVariesInfoUrl" );
- // unit.setAddRelationshipUrl( "addRelationshipUrl" );
- // unit.setDownloadAnonymousProgramUrl( "downloadAnonymousProgramUrl" );
- // unit.setFindProgramUrl( "findProgramUrl" );
- // unit.setFindPatientInAdvancedUrl( "findPatientInAdvancedUrl" );
- // unit.setFindLostToFollowUpUrl( "findLostToFollowUpUrl" );
- // unit.setHandleLostToFollowUpUrl( "handleLostToFollowUpUrl" );
- // unit.setGenerateRepeatableEventUrl( "generateRepeatableEventUrl" );
- // unit.setUploadSingleEventWithoutRegistration(
- // "uploadSingleEventWithoutRegistration" );
+
return orgUnit;
}
}
=== 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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java 2014-05-05 10:16:05 +0000
@@ -147,6 +147,7 @@
orgUnit.setChangeUpdateDataSetLangUrl( getUrl( request, unit.getId(), "changeLanguageDataSet" ) );
orgUnit.setSearchUrl( getUrl( request, unit.getId(), "search" ) );
orgUnit.setUpdateNewVersionUrl( getUrl( request, unit.getId(), "updateNewVersionUrl" ) );
+ orgUnit.setSendFeedbackUrl( getUrl(request, unit.getId(), "sendFeedback") );
orgUnit.setUpdateContactUrl( getUrl( request, unit.getId(), "updateContactForMobile" ) );
orgUnit.setFindPatientUrl( getUrl( request, unit.getId(), "findPatient" ) );
orgUnit.setRegisterPersonUrl( getUrl( request, unit.getId(), "registerPerson" ) );
=== 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 2014-04-24 07:21:13 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2014-05-05 10:16:05 +0000
@@ -48,6 +48,7 @@
import org.hisp.dhis.api.mobile.model.ModelList;
import org.hisp.dhis.api.mobile.model.SMSCode;
import org.hisp.dhis.api.mobile.model.SMSCommand;
+import org.hisp.dhis.api.mobile.model.Message;
import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient;
@@ -110,7 +111,9 @@
// For client version 2.8 and lower
@RequestMapping( method = RequestMethod.GET, value = "orgUnits/{id}/all" )
@ResponseBody
- public MobileModel getAllDataForOrgUnit2_8( @PathVariable int id, @RequestHeader( "accept-language" ) String locale )
+ public MobileModel getAllDataForOrgUnit2_8( @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale )
{
MobileModel mobileModel = new MobileModel();
mobileModel.setClientVersion( DataStreamSerializable.TWO_POINT_EIGHT );
@@ -125,8 +128,10 @@
@RequestMapping( method = RequestMethod.POST, value = "orgUnits/{id}/updateDataSets" )
@ResponseBody
- public DataSetList checkUpdatedDataSet2_8( @PathVariable int id, @RequestBody DataSetList dataSetList,
- @RequestHeader( "accept-language" ) String locale )
+ public DataSetList checkUpdatedDataSet2_8( @PathVariable
+ int id, @RequestBody
+ DataSetList dataSetList, @RequestHeader( "accept-language" )
+ String locale )
{
DataSetList returnList = facilityReportingService.getUpdatedDataSet( dataSetList, getUnit( id ), locale );
returnList.setClientVersion( DataStreamSerializable.TWO_POINT_EIGHT );
@@ -141,7 +146,9 @@
*/
@RequestMapping( method = RequestMethod.POST, value = "orgUnits/{id}/dataSets" )
@ResponseBody
- public String saveDataSetValues2_8( @PathVariable int id, @RequestBody DataSetValue dataSetValue )
+ public String saveDataSetValues2_8( @PathVariable
+ int id, @RequestBody
+ DataSetValue dataSetValue )
throws NotAllowedException
{
facilityReportingService.saveDataSetValues( getUnit( id ), dataSetValue );
@@ -157,7 +164,9 @@
*/
@RequestMapping( method = RequestMethod.POST, value = "orgUnits/{id}/activities" )
@ResponseBody
- public String saveActivityReport2_8( @PathVariable int id, @RequestBody ActivityValue activityValue )
+ public String saveActivityReport2_8( @PathVariable
+ int id, @RequestBody
+ ActivityValue activityValue )
throws NotAllowedException
{
// FIXME set the last argument to 0 to fix compilation error
@@ -167,8 +176,10 @@
@RequestMapping( method = RequestMethod.POST, value = "orgUnits/{id}/activitiyplan" )
@ResponseBody
- public MobileModel updatePrograms2_8( @PathVariable int id, @RequestHeader( "accept-language" ) String locale,
- @RequestBody ModelList programsFromClient )
+ public MobileModel updatePrograms2_8( @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale, @RequestBody
+ ModelList programsFromClient )
{
MobileModel model = new MobileModel();
model.setClientVersion( DataStreamSerializable.TWO_POINT_EIGHT );
@@ -180,7 +191,9 @@
@RequestMapping( method = RequestMethod.GET, value = "orgUnits/{id}/changeLanguageDataSet" )
@ResponseBody
- public DataSetList changeLanguageDataSet2_8( @PathVariable int id, @RequestHeader( "accept-language" ) String locale )
+ public DataSetList changeLanguageDataSet2_8( @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale )
{
return facilityReportingService.getDataSetsForLocale( getUnit( id ), locale );
}
@@ -189,8 +202,10 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/orgUnits/{id}/all" )
@ResponseBody
- public MobileModel getAllDataForOrgUnit( @PathVariable String clientVersion, @PathVariable int id,
- @RequestHeader( "accept-language" ) String locale )
+ public MobileModel getAllDataForOrgUnit( @PathVariable
+ String clientVersion, @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale )
{
MobileModel mobileModel = new MobileModel();
mobileModel.setClientVersion( clientVersion );
@@ -208,8 +223,11 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/updateDataSets" )
@ResponseBody
- public DataSetList checkUpdatedDataSet( @PathVariable String clientVersion, @PathVariable int id,
- @RequestBody DataSetList dataSetList, @RequestHeader( "accept-language" ) String locale )
+ public DataSetList checkUpdatedDataSet( @PathVariable
+ String clientVersion, @PathVariable
+ int id, @RequestBody
+ DataSetList dataSetList, @RequestHeader( "accept-language" )
+ String locale )
{
DataSetList returnList = facilityReportingService.getUpdatedDataSet( dataSetList, getUnit( id ), locale );
returnList.setClientVersion( clientVersion );
@@ -225,16 +243,20 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/dataSets" )
@ResponseBody
- public String saveDataSetValues( @PathVariable int id, @RequestBody DataSetValue dataSetValue )
+ public String saveDataSetValues( @PathVariable
+ int id, @RequestBody
+ DataSetValue dataSetValue )
throws NotAllowedException
{
facilityReportingService.saveDataSetValues( getUnit( id ), dataSetValue );
return DATASET_REPORT_UPLOADED;
}
-
- @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/dataSetValue")
+
+ @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/dataSetValue" )
@ResponseBody
- public DataSetValueList getDataSetValues( @PathVariable int id, @RequestBody DataSetList dataSetList )
+ public DataSetValueList getDataSetValues( @PathVariable
+ int id, @RequestBody
+ DataSetList dataSetList )
throws NotAllowedException
{
return facilityReportingService.getDataSetValues( getUnit( id ), dataSetList );
@@ -242,8 +264,11 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/activitiyplan" )
@ResponseBody
- public MobileModel updatePrograms( @PathVariable String clientVersion, @PathVariable int id,
- @RequestHeader( "accept-language" ) String locale, @RequestBody ModelList programsFromClient )
+ public MobileModel updatePrograms( @PathVariable
+ String clientVersion, @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale, @RequestBody
+ ModelList programsFromClient )
{
MobileModel model = new MobileModel();
model.setClientVersion( clientVersion );
@@ -281,7 +306,9 @@
*/
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/activities" )
@ResponseBody
- public String saveActivityReport( @PathVariable int id, @RequestBody ActivityValue activityValue )
+ public String saveActivityReport( @PathVariable
+ int id, @RequestBody
+ ActivityValue activityValue )
throws NotAllowedException
{
// FIXME set the last argument to 0 to fix compilation error
@@ -291,7 +318,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/orgUnits/{id}/changeLanguageDataSet" )
@ResponseBody
- public DataSetList changeLanguageDataSet( @PathVariable int id, @RequestHeader( "accept-language" ) String locale )
+ public DataSetList changeLanguageDataSet( @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale )
{
return facilityReportingService.getDataSetsForLocale( getUnit( id ), locale );
}
@@ -305,8 +334,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/all" )
@ResponseBody
- public org.hisp.dhis.api.mobile.model.LWUITmodel.MobileModel getAllDataForOrgUnitLWUIT(
- @PathVariable String clientVersion, @PathVariable int id )
+ public org.hisp.dhis.api.mobile.model.LWUITmodel.MobileModel getAllDataForOrgUnitLWUIT( @PathVariable
+ String clientVersion, @PathVariable
+ int id )
{
org.hisp.dhis.api.mobile.model.LWUITmodel.MobileModel mobileModel = new org.hisp.dhis.api.mobile.model.LWUITmodel.MobileModel();
mobileModel.setClientVersion( clientVersion );
@@ -325,7 +355,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatient" )
@ResponseBody
- public Patient findPatientByName( @PathVariable int id, @RequestHeader( "patientId" ) String patientId )
+ public Patient findPatientByName( @PathVariable
+ int id, @RequestHeader( "patientId" )
+ String patientId )
throws NotAllowedException
{
return activityReportingService.findPatient( Integer.parseInt( patientId ) );
@@ -333,8 +365,10 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatientInAdvanced/{programId}" )
@ResponseBody
- public String findPatientInAdvanced( @PathVariable int programId, @PathVariable int id,
- @RequestHeader( "name" ) String keyword )
+ public String findPatientInAdvanced( @PathVariable
+ int programId, @PathVariable
+ int id, @RequestHeader( "name" )
+ String keyword )
throws NotAllowedException
{
return activityReportingService.findPatientInAdvanced( keyword, id, programId );
@@ -342,17 +376,20 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/uploadProgramStage/{patientId}" )
@ResponseBody
- public String saveProgramStage( @PathVariable int patientId, @PathVariable int id,
- @RequestBody ProgramStage programStage )
+ public String saveProgramStage( @PathVariable
+ int patientId, @PathVariable
+ int id, @RequestBody
+ ProgramStage programStage )
throws NotAllowedException
{
return activityReportingService.saveProgramStage( programStage, patientId, id );
}
-
+
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/uploadSingleEventWithoutRegistration" )
@ResponseBody
- public String saveSingleEventWithoutRegistration( @PathVariable int id,
- @RequestBody ProgramStage programStage )
+ public String saveSingleEventWithoutRegistration( @PathVariable
+ int id, @RequestBody
+ ProgramStage programStage )
throws NotAllowedException
{
return activityReportingService.saveSingleEventWithoutRegistration( programStage, id );
@@ -360,7 +397,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/enrollProgram" )
@ResponseBody
- public Patient enrollProgram( @PathVariable int id, @RequestHeader( "enrollInfo" ) String enrollInfo )
+ public Patient enrollProgram( @PathVariable
+ int id, @RequestHeader( "enrollInfo" )
+ String enrollInfo )
throws NotAllowedException
{
return activityReportingService.enrollProgram( enrollInfo, new Date() );
@@ -368,7 +407,9 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/addRelationship" )
@ResponseBody
- public Patient addRelationship( @PathVariable int id, @RequestBody Relationship enrollmentRelationship )
+ public Patient addRelationship( @PathVariable
+ int id, @RequestBody
+ Relationship enrollmentRelationship )
throws NotAllowedException
{
return activityReportingService.addRelationship( enrollmentRelationship, id );
@@ -376,7 +417,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/downloadAnonymousProgram" )
@ResponseBody
- public Program getAnonymousProgram( @PathVariable int id, @RequestHeader( "programType" ) String programType )
+ public Program getAnonymousProgram( @PathVariable
+ int id, @RequestHeader( "programType" )
+ String programType )
throws NotAllowedException
{
return activityReportingService.getAllProgramByOrgUnit( id, programType );
@@ -384,7 +427,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findProgram" )
@ResponseBody
- public Program findProgram( @PathVariable int id, @RequestHeader( "info" ) String programInfo )
+ public Program findProgram( @PathVariable
+ int id, @RequestHeader( "info" )
+ String programInfo )
throws NotAllowedException
{
return activityReportingService.findProgram( programInfo );
@@ -392,7 +437,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findLostToFollowUp" )
@ResponseBody
- public String findLostToFollowUp( @PathVariable int id, @RequestHeader( "searchEventInfos" ) String searchEventInfos )
+ public String findLostToFollowUp( @PathVariable
+ int id, @RequestHeader( "searchEventInfos" )
+ String searchEventInfos )
throws NotAllowedException
{
return activityReportingService.findLostToFollowUp( id, searchEventInfos );
@@ -400,7 +447,9 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/handleLostToFollowUp" )
@ResponseBody
- public Notification handleLostToFollowUp( @PathVariable int id, @RequestBody LostEvent lostEvent )
+ public Notification handleLostToFollowUp( @PathVariable
+ int id, @RequestBody
+ LostEvent lostEvent )
throws NotAllowedException
{
return activityReportingService.handleLostToFollowUp( lostEvent );
@@ -408,7 +457,9 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/generateRepeatableEvent" )
@ResponseBody
- public Patient generateRepeatableEvent( @PathVariable int id, @RequestHeader( "eventInfo" ) String eventInfo )
+ public Patient generateRepeatableEvent( @PathVariable
+ int id, @RequestHeader( "eventInfo" )
+ String eventInfo )
throws NotAllowedException
{
return activityReportingService.generateRepeatableEvent( id, eventInfo );
@@ -466,8 +517,10 @@
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/registerPerson" )
@ResponseBody
- public Patient savePatient( @PathVariable int id, @RequestBody Patient patient,
- @RequestHeader( "programid" ) String programId )
+ public Patient savePatient( @PathVariable
+ int id, @RequestBody
+ Patient patient, @RequestHeader( "programid" )
+ String programId )
throws NotAllowedException
{
if ( activityReportingService.savePatient( patient, id, programId ) != null )
@@ -482,8 +535,11 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/getVariesInfo" )
@ResponseBody
- public PatientIdentifierAndAttribute getVariesInfo( @PathVariable String clientVersion, @PathVariable int id,
- @RequestHeader( "accept-language" ) String locale, @RequestHeader( "programid" ) String programId )
+ public PatientIdentifierAndAttribute getVariesInfo( @PathVariable
+ String clientVersion, @PathVariable
+ int id, @RequestHeader( "accept-language" )
+ String locale, @RequestHeader( "programid" )
+ String programId )
{
PatientIdentifierAndAttribute patientIdentifierAndAttribute = new PatientIdentifierAndAttribute();
patientIdentifierAndAttribute.setClientVersion( clientVersion );
@@ -493,4 +549,15 @@
return patientIdentifierAndAttribute;
}
+ @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/sendFeedback" )
+ @ResponseBody
+ public String sendFeedback( @PathVariable
+ int id, @RequestBody
+ Message message )
+ throws NotAllowedException
+ {
+ return activityReportingService.sendFeedback( message );
+
+ }
+
}