dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28656
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14326: Implementation: Synchronized Submission Status
------------------------------------------------------------
revno: 14326
committer: sherylyn.marie
branch nick: trunk
timestamp: Fri 2014-03-21 14:05:07 +0800
message:
Implementation: Synchronized Submission Status
https://blueprints.launchpad.net/dhis-mobile/+spec/synchronized-submission-status
added:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValueList.java
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/FacilityReportingService.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.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/FacilityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.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/FacilityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/FacilityReportingService.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/FacilityReportingService.java 2014-03-21 06:05:07 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.api.mobile.model.DataSet;
import org.hisp.dhis.api.mobile.model.DataSetList;
import org.hisp.dhis.api.mobile.model.DataSetValue;
+import org.hisp.dhis.api.mobile.model.DataSetValueList;
import org.hisp.dhis.organisationunit.OrganisationUnit;
/**
@@ -59,6 +60,9 @@
public void saveDataSetValues( OrganisationUnit unit, DataSetValue dataSetValue )
throws NotAllowedException;
+ public DataSetValueList getDataSetValues( OrganisationUnit unit, DataSetList dataSetList )
+ throws NotAllowedException;
+
public DataSetList getUpdatedDataSet( DataSetList dataSetList, OrganisationUnit unit, String locale );
public DataSetList getDataSetsForLocale( OrganisationUnit unit, String locale );
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java 2014-03-21 06:05:07 +0000
@@ -43,7 +43,7 @@
extends Model
{
private String clientVersion;
-
+
private String periodName;
private boolean completed;
@@ -82,7 +82,7 @@
{
return dataValues;
}
-
+
public String getClientVersion()
{
return clientVersion;
@@ -97,7 +97,20 @@
public void serialize( DataOutputStream dataOutputStream )
throws IOException
{
- // FIXME: Implement..
+ dataOutputStream.writeInt( this.getId() );
+ dataOutputStream.writeUTF( this.getName() );
+ dataOutputStream.writeUTF( this.getPeriodName() );
+ dataOutputStream.writeBoolean( this.isCompleted() );
+
+ dataOutputStream.writeInt( dataValues.size() );
+
+ for ( DataValue datavalue : dataValues )
+ {
+ dataOutputStream.writeInt( datavalue.getId() );
+ dataOutputStream.writeInt( datavalue.getCategoryOptComboID() );
+ dataOutputStream.writeUTF( datavalue.getValue() );
+ }
+
}
@Override
=== added file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValueList.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValueList.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValueList.java 2014-03-21 06:05:07 +0000
@@ -0,0 +1,68 @@
+package org.hisp.dhis.api.mobile.model;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DataSetValueList
+ extends Model
+{
+ private String clientVersion;
+
+ private List<DataSetValue> dataSetValues = new ArrayList<DataSetValue>();
+
+ public DataSetValueList()
+ {
+ }
+
+ public List<DataSetValue> getDataSetValues()
+ {
+ return dataSetValues;
+ }
+
+ public void setDataSetValues( List<DataSetValue> dataSetValues )
+ {
+ this.dataSetValues = dataSetValues;
+ }
+
+ public String getClientVersion()
+ {
+ return clientVersion;
+ }
+
+ public void setClientVersion( String clientVersion )
+ {
+ this.clientVersion = clientVersion;
+ }
+
+ @Override
+ public void serialize( DataOutputStream dout )
+ throws IOException
+ {
+ dout.writeInt( dataSetValues.size() );
+ for ( DataSetValue dataSetValue : dataSetValues )
+ {
+ dataSetValue.serialize( dout );
+ }
+ }
+
+ @Override
+ public void deSerialize( DataInputStream dataInputStream )
+ throws IOException
+ {
+ int size = 0;
+ size = dataInputStream.readInt();
+ if ( size > 0 )
+ {
+ dataSetValues = new ArrayList<DataSetValue>();
+ for ( int i = 0; i < size; i++ )
+ {
+ DataSetValue dataSetValue = new DataSetValue();
+ dataSetValue.deSerialize( dataInputStream );
+ dataSetValues.add( dataSetValue );
+ }
+ }
+ }
+}
=== 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-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2014-03-21 06:05:07 +0000
@@ -53,6 +53,8 @@
private String uploadFacilityReportUrl;
+ private String downloadFacilityReportUrl;
+
private String uploadActivityReportUrl;
private String updateDataSetUrl;
@@ -131,6 +133,16 @@
this.uploadFacilityReportUrl = uploadFacilityReportUrl;
}
+ public String getDownloadFacilityReportUrl()
+ {
+ return downloadFacilityReportUrl;
+ }
+
+ public void setDownloadFacilityReportUrl( String downloadFacilityReportUrl )
+ {
+ this.downloadFacilityReportUrl = downloadFacilityReportUrl;
+ }
+
public String getUploadActivityReportUrl()
{
return uploadActivityReportUrl;
@@ -340,6 +352,7 @@
dataOutputStream.writeUTF( downloadAllUrl );
dataOutputStream.writeUTF( updateActivityPlanUrl );
dataOutputStream.writeUTF( uploadFacilityReportUrl );
+ dataOutputStream.writeUTF( downloadFacilityReportUrl );
dataOutputStream.writeUTF( uploadActivityReportUrl );
dataOutputStream.writeUTF( updateDataSetUrl );
dataOutputStream.writeUTF( changeUpdateDataSetLangUrl );
@@ -368,6 +381,7 @@
downloadAllUrl = dataInputStream.readUTF();
updateActivityPlanUrl = dataInputStream.readUTF();
uploadFacilityReportUrl = dataInputStream.readUTF();
+ downloadFacilityReportUrl = dataInputStream.readUTF();
uploadActivityReportUrl = dataInputStream.readUTF();
updateDataSetUrl = dataInputStream.readUTF();
changeUpdateDataSetLangUrl = dataInputStream.readUTF();
@@ -397,6 +411,7 @@
dataOutputStream.writeUTF( this.downloadAllUrl );
dataOutputStream.writeUTF( this.updateActivityPlanUrl );
dataOutputStream.writeUTF( this.uploadFacilityReportUrl );
+ dataOutputStream.writeUTF( this.downloadFacilityReportUrl );
dataOutputStream.writeUTF( this.uploadActivityReportUrl );
dataOutputStream.writeUTF( this.updateDataSetUrl );
dataOutputStream.writeUTF( this.changeUpdateDataSetLangUrl );
@@ -412,6 +427,7 @@
dataOutputStream.writeUTF( this.downloadAllUrl );
dataOutputStream.writeUTF( this.updateActivityPlanUrl );
dataOutputStream.writeUTF( this.uploadFacilityReportUrl );
+ dataOutputStream.writeUTF( this.downloadFacilityReportUrl );
dataOutputStream.writeUTF( this.uploadActivityReportUrl );
dataOutputStream.writeUTF( this.updateDataSetUrl );
dataOutputStream.writeUTF( this.changeUpdateDataSetLangUrl );
@@ -429,6 +445,7 @@
dataOutputStream.writeUTF( downloadAllUrl );
dataOutputStream.writeUTF( updateActivityPlanUrl );
dataOutputStream.writeUTF( uploadFacilityReportUrl );
+ dataOutputStream.writeUTF( downloadFacilityReportUrl );
dataOutputStream.writeUTF( uploadActivityReportUrl );
dataOutputStream.writeUTF( updateDataSetUrl );
dataOutputStream.writeUTF( changeUpdateDataSetLangUrl );
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2014-03-21 06:05:07 +0000
@@ -31,6 +31,7 @@
import static org.hisp.dhis.i18n.I18nUtils.i18n;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -38,6 +39,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.Vector;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@@ -49,6 +51,7 @@
import org.hisp.dhis.api.mobile.model.DataSet;
import org.hisp.dhis.api.mobile.model.DataSetList;
import org.hisp.dhis.api.mobile.model.DataSetValue;
+import org.hisp.dhis.api.mobile.model.DataSetValueList;
import org.hisp.dhis.api.mobile.model.DataValue;
import org.hisp.dhis.api.mobile.model.Section;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
@@ -236,9 +239,9 @@
ds.setName( name );
ds.setVersion( 1 );
-
+
Integer version = dataSet.getVersion();
-
+
if ( version != null )
{
ds.setVersion( version );
@@ -259,7 +262,7 @@
Collections.sort( dataElements, dataElementComparator );
// Fake section to store data elements
-
+
Section section = new Section();
section.setId( 0 );
section.setName( "" );
@@ -274,16 +277,17 @@
section.setId( sec.getId() );
section.setName( sec.getName() );
- List<org.hisp.dhis.dataelement.DataElement> des = new ArrayList<org.hisp.dhis.dataelement.DataElement>( sec.getDataElements() );
-
+ List<org.hisp.dhis.dataelement.DataElement> des = new ArrayList<org.hisp.dhis.dataelement.DataElement>(
+ sec.getDataElements() );
+
// Remove grey fields in order to not display them on mobile
-
+
List<DataElement> dataElementList = getDataElements( locale, des );
List<DataElement> dataElementListFinal = new ArrayList<DataElement>( dataElementList );
int tempI = 0;
-
+
for ( int i = 0; i < dataElementList.size(); i++ )
{
if ( isGreyField( sec, dataElementList.get( i ).getId() ) )
@@ -292,7 +296,7 @@
tempI++;
}
}
-
+
section.setDataElements( dataElementListFinal );
sectionList.add( section );
}
@@ -312,12 +316,12 @@
DataElement de = ModelMapping.getDataElement( dataElement );
// For facility Reporting, no data elements are mandatory
-
+
de.setCompulsory( false );
dataElementList.add( de );
}
-
+
return dataElementList;
}
@@ -369,7 +373,8 @@
}
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, unit );
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
+ unit );
if ( registration != null )
{
@@ -389,6 +394,63 @@
+ ", " + period.getIsoDate() );
}
+ @Override
+ public DataSetValueList getDataSetValues( OrganisationUnit unit, DataSetList dataSetList )
+ throws NotAllowedException
+ {
+ DataSetValueList dataSetValueList = new DataSetValueList();
+ List<DataSet> dataSets = dataSetList.getCurrentDataSets();
+
+ for ( DataSet dataSet : dataSets )
+ {
+ log.info( "Getting DataSetValue for: " + dataSet.getName() );
+
+ org.hisp.dhis.dataset.DataSet apiDataSet = dataSetService.getDataSet( dataSet.getId() );
+
+ Vector<String> periods = PeriodUtil.generatePeriods( dataSet.getPeriodType() );
+
+ if ( periods != null )
+ {
+ for ( int i = 0; i < periods.size(); i++ )
+ {
+ Period period = getPeriod( periods.elementAt( i ), apiDataSet.getPeriodType() );
+
+ if ( period != null )
+ {
+ Collection<org.hisp.dhis.dataelement.DataElement> dataElements = apiDataSet.getDataElements();
+ Collection<org.hisp.dhis.datavalue.DataValue> dataValues = dataValueService.getDataValues(
+ unit, period, dataElements );
+
+ if ( dataValues != null && !dataValues.isEmpty() )
+ {
+ DataSetValue dataSetValue = new DataSetValue();
+ dataSetValue.setId( dataSet.getId() );
+ dataSetValue.setName( dataSet.getName() );
+ dataSetValue.setPeriodName( periods.elementAt( i ) );
+ dataSetValue.setCompleted( true );
+
+ for ( org.hisp.dhis.datavalue.DataValue dataValue : dataValues )
+ {
+ DataValue dv = new DataValue();
+ dv.setCategoryOptComboID( dataValue.getCategoryOptionCombo().getId() );
+ dv.setClientVersion( dataSet.getClientVersion() );
+ dv.setId( dataValue.getDataElement().getId() );
+ dv.setValue( dataValue.getValue() );
+ dataSetValue.getDataValues().add( dv );
+
+ }
+ dataSetValueList.getDataSetValues().add( dataSetValue );
+ }
+ }
+ }
+ }
+ }
+
+ log.info( "Retrieved Data value set: " + unit.getName() + ", " + dataSetList.getName() );
+
+ return dataSetValueList;
+ }
+
private Map<Integer, org.hisp.dhis.dataelement.DataElement> getDataElementIdMapping(
org.hisp.dhis.dataset.DataSet dataSet )
{
@@ -398,7 +460,7 @@
{
dataElementMap.put( dataElement.getId(), dataElement );
}
-
+
return dataElementMap;
}
@@ -407,19 +469,21 @@
return unit.getDataSets().contains( dataSet );
}
- private void saveValue( OrganisationUnit unit, Period period, org.hisp.dhis.dataelement.DataElement dataElement, DataValue dv )
+ private void saveValue( OrganisationUnit unit, Period period, org.hisp.dhis.dataelement.DataElement dataElement,
+ DataValue dv )
{
String value = dv.getValue().trim();
DataElementCategoryOptionCombo catOptCombo = categoryService.getDataElementCategoryOptionCombo( dv
.getCategoryOptComboID() );
- org.hisp.dhis.datavalue.DataValue dataValue = dataValueService.getDataValue( dataElement, period,
- unit, catOptCombo );
+ org.hisp.dhis.datavalue.DataValue dataValue = dataValueService.getDataValue( dataElement, period, unit,
+ catOptCombo );
if ( dataValue == null )
{
- dataValue = new org.hisp.dhis.datavalue.DataValue( dataElement, period, unit, catOptCombo, catOptCombo, value, "", new Date(), "" );
+ dataValue = new org.hisp.dhis.datavalue.DataValue( dataElement, period, unit, catOptCombo, catOptCombo,
+ value, "", new Date(), "" );
dataValueService.addDataValue( dataValue );
}
else
@@ -463,7 +527,7 @@
return true;
}
}
-
+
return false;
}
@@ -521,7 +585,8 @@
@Override
public Contact updateContactForMobile()
- { Contact contact = new Contact();
+ {
+ Contact contact = new Contact();
List<String> listOfContacts = new ArrayList<String>();
=== 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 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/PeriodUtil.java 2014-03-21 06:05:07 +0000
@@ -33,6 +33,7 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
+import java.util.Vector;
import org.hisp.dhis.period.DailyPeriodType;
import org.hisp.dhis.period.MonthlyPeriodType;
@@ -180,7 +181,7 @@
{
return null;
}
-
+
return date;
}
@@ -197,4 +198,92 @@
}
}
+ public static Vector<String> generatePeriods( String periodType )
+ {
+ Vector<String> periods = null;
+ if ( periodType.equals( "Monthly" ) )
+ {
+ periods = PeriodUtil.generateMonthlyPeriods();
+ }
+ else if ( periodType.equals( "Yearly" ) )
+ {
+ periods = PeriodUtil.generateYearlyPeriods();
+ }
+ else if ( periodType.equals( "Quarterly" ) )
+ {
+ periods = PeriodUtil.generateQuaterlyPeriods();
+ }
+ return periods;
+ }
+
+ public static Vector<String> generateMonthlyPeriods()
+ {
+ Vector<String> months = new Vector<String>();
+ Calendar cal = Calendar.getInstance();
+
+ // Display only 12 previous periods including the current one
+ cal.set( Calendar.MONTH, cal.get( Calendar.MONTH ) );
+
+ for ( int i = 0; i < 11; i++ )
+ {
+ if ( cal.get( Calendar.MONTH ) < 0 )
+ {
+ cal.set( Calendar.MONTH, 11 );
+ cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) - 1 );
+ }
+ months.addElement( cal.get( Calendar.MONTH ) + "-" + cal.get( Calendar.YEAR ) );
+ cal.set( Calendar.MONTH, cal.get( Calendar.MONTH ) - 1 );
+ }
+
+ return months;
+ }
+
+ public static Vector<String> generateYearlyPeriods()
+ {
+ Vector<String> years = new Vector<String>();
+ Calendar cal = Calendar.getInstance();
+
+ // Display only 12 previous periods including the current one
+ cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) );
+
+ for ( int i = 0; i < 2; i++ )
+ {
+ years.addElement( Integer.toString( cal.get( Calendar.YEAR ) ) );
+ cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) - 1 );
+ }
+
+ return years;
+ }
+
+ public static Vector<String> generateQuaterlyPeriods()
+ {
+ Vector<String> quarters = new Vector<String>();
+ Calendar cal = Calendar.getInstance();
+ String[] quatersStr = { "Jan to Mar", "Apr to Jun", "Jul to Sep", "Oct to Dec" };
+
+ if ( cal.get( Calendar.MONTH ) >= 0 && cal.get( Calendar.MONTH ) <= 2 )
+ {
+ quarters.addElement( quatersStr[0] + " " + cal.get( Calendar.YEAR ) );
+ }
+ else if ( cal.get( Calendar.MONTH ) >= 3 && cal.get( Calendar.MONTH ) <= 5 )
+ {
+ quarters.addElement( quatersStr[1] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[0] + " " + cal.get( Calendar.YEAR ) );
+ }
+ else if ( cal.get( Calendar.MONTH ) >= 6 && cal.get( Calendar.MONTH ) <= 8 )
+ {
+ quarters.addElement( quatersStr[2] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[1] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[0] + " " + cal.get( Calendar.YEAR ) );
+ }
+ else if ( cal.get( Calendar.MONTH ) >= 9 && cal.get( Calendar.MONTH ) <= 11 )
+ {
+ quarters.addElement( quatersStr[3] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[2] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[1] + " " + cal.get( Calendar.YEAR ) );
+ quarters.addElement( quatersStr[0] + " " + cal.get( Calendar.YEAR ) );
+ }
+ return quarters;
+ }
+
}
=== 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-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java 2014-03-21 06:05:07 +0000
@@ -141,6 +141,7 @@
orgUnit.setDownloadAllUrl( getUrl( request, unit.getId(), "all" ) );
orgUnit.setUpdateActivityPlanUrl( getUrl( request, unit.getId(), "activitiyplan" ) );
orgUnit.setUploadFacilityReportUrl( getUrl( request, unit.getId(), "dataSets" ) );
+ orgUnit.setDownloadFacilityReportUrl( getUrl( request, unit.getId(), "dataSetValue" ) );
orgUnit.setUploadActivityReportUrl( getUrl( request, unit.getId(), "activities" ) );
orgUnit.setUpdateDataSetUrl( getUrl( request, unit.getId(), "updateDataSets" ) );
orgUnit.setChangeUpdateDataSetLangUrl( getUrl( request, unit.getId(), "changeLanguageDataSet" ) );
=== 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-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2014-03-21 06:05:07 +0000
@@ -42,6 +42,7 @@
import org.hisp.dhis.api.mobile.model.Contact;
import org.hisp.dhis.api.mobile.model.DataSetList;
import org.hisp.dhis.api.mobile.model.DataSetValue;
+import org.hisp.dhis.api.mobile.model.DataSetValueList;
import org.hisp.dhis.api.mobile.model.DataStreamSerializable;
import org.hisp.dhis.api.mobile.model.MobileModel;
import org.hisp.dhis.api.mobile.model.ModelList;
@@ -230,6 +231,14 @@
facilityReportingService.saveDataSetValues( getUnit( id ), dataSetValue );
return DATASET_REPORT_UPLOADED;
}
+
+ @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/dataSetValue")
+ @ResponseBody
+ public DataSetValueList getDataSetValues( @PathVariable int id, @RequestBody DataSetList dataSetList )
+ throws NotAllowedException
+ {
+ return facilityReportingService.getDataSetValues( getUnit( id ), dataSetList );
+ }
@RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/orgUnits/{id}/activitiyplan" )
@ResponseBody