=== 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-10-07 02:49:58 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java 2013-10-09 03:02:54 +0000 @@ -33,6 +33,8 @@ import org.hisp.dhis.api.mobile.model.ActivityPlan; import org.hisp.dhis.api.mobile.model.ActivityValue; 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; import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient; import org.hisp.dhis.api.mobile.model.LWUITmodel.Program; import org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage; @@ -100,6 +102,6 @@ public String findLostToFollowUp( int orgUnitId, String programId ) throws NotAllowedException; - public Patient findLostToFollowUpDetail( String programStageIntanceId ) + public Notification handleLostToFollowUp( LostEvent lostEvent ) throws NotAllowedException; } === added file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/LostEvent.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/LostEvent.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/LostEvent.java 2013-10-09 03:02:54 +0000 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2004-2012, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.hisp.dhis.api.mobile.model.LWUITmodel; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import org.hisp.dhis.api.mobile.model.Model; + + /** + * @author Nguyen Kim Lai + * + * @version LostEvent.java 4:11:08 PM Oct 8, 2013 $ + */ +public class LostEvent extends Model +{ + private String dueDate; + + private int status; + + private boolean isRiskCase; + + private String comment; + + private String SMS; + + @Override + public void serialize( DataOutputStream dout ) + throws IOException + { + super.serialize( dout ); + dout.writeUTF( dueDate ); + dout.writeInt( status ); + dout.writeBoolean( isRiskCase ); + dout.writeUTF( comment ); + dout.writeUTF( SMS ); + } + + @Override + public void deSerialize( DataInputStream dint ) + throws IOException + { + super.deSerialize( dint ); + dueDate = dint.readUTF(); + status = dint.readInt(); + isRiskCase = dint.readBoolean(); + comment = dint.readUTF(); + SMS = dint.readUTF(); + } + + @Override + public void serializeVersion2_8( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + @Override + public void serializeVersion2_9( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + @Override + public void serializeVersion2_10( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + public String getDueDate() + { + return dueDate; + } + + public void setDueDate( String dueDate ) + { + this.dueDate = dueDate; + } + + public int getStatus() + { + return status; + } + + public void setStatus( int status ) + { + this.status = status; + } + + public boolean isRiskCase() + { + return isRiskCase; + } + + public void setRiskCase( boolean isRiskCase ) + { + this.isRiskCase = isRiskCase; + } + + public String getComment() + { + return comment; + } + + public void setComment( String comment ) + { + this.comment = comment; + } + + public String getSMS() + { + return SMS; + } + + public void setSMS( String sMS ) + { + SMS = sMS; + } +} === added file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/Notification.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/Notification.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/Notification.java 2013-10-09 03:02:54 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2004-2012, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.hisp.dhis.api.mobile.model.LWUITmodel; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import org.hisp.dhis.api.mobile.model.DataStreamSerializable; + + /** + * @author Nguyen Kim Lai + * + * @version Notification.java 9:41:41 AM Oct 9, 2013 $ + */ +public class Notification implements DataStreamSerializable +{ + private String message; + + @Override + public void serialize( DataOutputStream dataOutputStream ) + throws IOException + { + dataOutputStream.writeUTF( message ); + + } + + @Override + public void deSerialize( DataInputStream dataInputStream ) + throws IOException + { + message = dataInputStream.readUTF(); + + } + + @Override + public void serializeVersion2_8( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + @Override + public void serializeVersion2_9( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + @Override + public void serializeVersion2_10( DataOutputStream dataOutputStream ) + throws IOException + { + // TODO Auto-generated method stub + + } + + public String getMessage() + { + return message; + } + + public void setMessage( String message ) + { + this.message = message; + } + +} === 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-10-07 02:49:58 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2013-10-09 03:02:54 +0000 @@ -87,7 +87,7 @@ private String findLostToFollowUpUrl; - private String findLostToFollowUpDetailUrl; + private String handleLostToFollowUpUrl; @XmlAttribute public int getId() @@ -321,14 +321,14 @@ this.findLostToFollowUpUrl = findLostToFollowUpUrl; } - public String getFindLostToFollowUpDetailUrl() + public String getHandleLostToFollowUpUrl() { - return findLostToFollowUpDetailUrl; + return handleLostToFollowUpUrl; } - public void setFindLostToFollowUpDetailUrl( String findLostToFollowUpDetailUrl ) + public void setHandleLostToFollowUpUrl( String handleLostToFollowUpUrl ) { - this.findLostToFollowUpDetailUrl = findLostToFollowUpDetailUrl; + this.handleLostToFollowUpUrl = handleLostToFollowUpUrl; } public void serialize( DataOutputStream dataOutputStream ) @@ -357,7 +357,7 @@ dataOutputStream.writeUTF( this.findLatestPersonUrl ); dataOutputStream.writeUTF( this.findPatientInAdvancedUrl ); dataOutputStream.writeUTF( this.findLostToFollowUpUrl ); - dataOutputStream.writeUTF( this.findLostToFollowUpDetailUrl ); + dataOutputStream.writeUTF( this.handleLostToFollowUpUrl ); } public void deSerialize( DataInputStream dataInputStream ) @@ -385,7 +385,7 @@ this.findLatestPersonUrl = dataInputStream.readUTF(); this.findPatientInAdvancedUrl = dataInputStream.readUTF(); this.findLostToFollowUpUrl = dataInputStream.readUTF(); - this.findLostToFollowUpDetailUrl = dataInputStream.readUTF(); + this.handleLostToFollowUpUrl = dataInputStream.readUTF(); } @Override @@ -446,6 +446,6 @@ dataOutputStream.writeUTF( this.findLatestPersonUrl ); dataOutputStream.writeUTF( this.findPatientInAdvancedUrl ); dataOutputStream.writeUTF( this.findLostToFollowUpUrl ); - dataOutputStream.writeUTF( this.findLostToFollowUpDetailUrl ); + dataOutputStream.writeUTF( this.handleLostToFollowUpUrl ); } } === 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-10-08 17:16:47 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-10-09 03:02:54 +0000 @@ -54,6 +54,8 @@ import org.hisp.dhis.api.mobile.model.DataValue; import org.hisp.dhis.api.mobile.model.PatientAttribute; import org.hisp.dhis.api.mobile.model.Task; +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.Section; import org.hisp.dhis.api.mobile.model.comparator.ActivityComparator; import org.hisp.dhis.dataelement.DataElement; @@ -2023,11 +2025,11 @@ } @Override - public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient findLostToFollowUpDetail( String programStageIntanceId ) + public Notification handleLostToFollowUp( LostEvent lostEvent ) throws NotAllowedException { - org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientLWUIT = new org.hisp.dhis.api.mobile.model.LWUITmodel.Patient(); + Notification notification = new Notification(); - return patientLWUIT; + return notification; } } === 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-10-07 02:49:58 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java 2013-10-09 03:02:54 +0000 @@ -70,7 +70,7 @@ unit.setFindLatestPersonUrl( "findLatestPersonUrl" ); unit.setFindPatientInAdvancedUrl( "findPatientInAdvanced" ); unit.setFindLostToFollowUpUrl( "findLostToFollowUpUrl" ); - unit.setFindLostToFollowUpDetailUrl( "findLostToFollowUpDetailUrl" ); + unit.setHandleLostToFollowUpUrl( "handleLostToFollowUpUrl" ); 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-10-07 02:49:58 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java 2013-10-09 03:02:54 +0000 @@ -95,7 +95,7 @@ unit.setFindLatestPersonUrl( "findLatestPersonUrl" ); unit.setFindPatientInAdvancedUrl( "findPatientInAdvancedUrl" ); unit.setFindLostToFollowUpUrl( "findLostToFollowUpUrl" ); - unit.setFindLostToFollowUpDetailUrl( "findLostToFollowUpDetailUrl" ); + unit.setHandleLostToFollowUpUrl( "handleLostToFollowUpUrl" ); 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-10-07 02:49:58 +0000 +++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java 2013-10-09 03:02:54 +0000 @@ -158,7 +158,7 @@ orgUnit.setFindLatestPersonUrl( getUrl( request, unit.getId(), "findLatestPerson" ) ); orgUnit.setFindPatientInAdvancedUrl( getUrl( request, unit.getId(), "findPatientInAdvanced" ) ); orgUnit.setFindLostToFollowUpUrl( getUrl( request, unit.getId(), "findLostToFollowUp" ) ); - orgUnit.setFindLostToFollowUpDetailUrl( getUrl( request, unit.getId(), "findLostToFollowUpDetail" ) ); + orgUnit.setHandleLostToFollowUpUrl( getUrl( request, unit.getId(), "handleLostToFollowUpUrl" ) ); // 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-10-07 18:30:46 +0000 +++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2013-10-09 03:02:54 +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.LWUITmodel.LostEvent; import org.hisp.dhis.api.mobile.model.LWUITmodel.Patient; import org.hisp.dhis.api.mobile.model.LWUITmodel.PatientIdentifierAndAttribute; import org.hisp.dhis.api.mobile.model.LWUITmodel.Program; @@ -402,10 +403,11 @@ return activityReportingService.findLostToFollowUp( id, programId ); } - @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findLostToFollowUpDetail" ) + @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/handleLostToFollowUpUrl" ) @ResponseBody - public Patient findLostToFollowUpDetail( @PathVariable int id, @RequestHeader( "programStageInstanceId" ) String programStageInstanceId ) + public Patient handleLostToFollowUp( @PathVariable int id, @RequestBody LostEvent lostEvent ) { + System.out.println(lostEvent); return null; }