dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31108
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15820: Complete data set registrations, impl support for attribute option combo in web api
------------------------------------------------------------
revno: 15820
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-06-23 23:31:31 +0200
message:
Complete data set registrations, impl support for attribute option combo in web api
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateCompleteDataSetRegistrationStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/J2MEDataValueSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStoreTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java
dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CompleteDataSetRegistrationController.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.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-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java 2014-06-23 19:53:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java 2014-06-23 21:31:31 +0000
@@ -30,6 +30,7 @@
import java.util.Collection;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
@@ -70,9 +71,11 @@
* @param dataSet the DataSet.
* @param period the Period.
* @param source the Source.
+ * @param attributeOptionCombo the attribute option combo.
* @return the CompleteDataSetRegistration.
*/
- CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period, OrganisationUnit source );
+ CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period,
+ OrganisationUnit source, DataElementCategoryOptionCombo attributeOptionCombo );
/**
* Deletes a CompleteDataSetRegistration.
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStore.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStore.java 2014-06-23 21:31:31 +0000
@@ -31,6 +31,7 @@
import java.util.Collection;
import java.util.Date;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
@@ -63,9 +64,11 @@
* @param dataSet the DataSet.
* @param period the Period.
* @param source the Source.
+ * @param attributeOptionCombo the attribute option combo.
* @return the CompleteDataSetRegistration.
*/
- CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period, OrganisationUnit source );
+ CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period,
+ OrganisationUnit source, DataElementCategoryOptionCombo attributeOptionCombo );
/**
* Deletes a CompleteDataSetRegistration.
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java 2014-06-23 19:53:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java 2014-06-23 21:31:31 +0000
@@ -30,6 +30,7 @@
import java.util.Collection;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.message.MessageService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -103,9 +104,10 @@
completeDataSetRegistrationStore.deleteCompleteDataSetRegistration( registration );
}
- public CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period, OrganisationUnit source )
+ public CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period,
+ OrganisationUnit source, DataElementCategoryOptionCombo attributeOptionCombo )
{
- return completeDataSetRegistrationStore.getCompleteDataSetRegistration( dataSet, period, source );
+ return completeDataSetRegistrationStore.getCompleteDataSetRegistration( dataSet, period, source, attributeOptionCombo );
}
public Collection<CompleteDataSetRegistration> getAllCompleteDataSetRegistrations()
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateCompleteDataSetRegistrationStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateCompleteDataSetRegistrationStore.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateCompleteDataSetRegistrationStore.java 2014-06-23 21:31:31 +0000
@@ -35,6 +35,7 @@
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationStore;
import org.hisp.dhis.dataset.DataSet;
@@ -104,7 +105,8 @@
sessionFactory.getCurrentSession().update( registration );
}
- public CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period, OrganisationUnit source )
+ public CompleteDataSetRegistration getCompleteDataSetRegistration( DataSet dataSet, Period period,
+ OrganisationUnit source, DataElementCategoryOptionCombo attributeOptionCombo )
{
period = reloadPeriod( period );
@@ -113,6 +115,7 @@
criteria.add( Restrictions.eq( "dataSet", dataSet ) );
criteria.add( Restrictions.eq( "period", period ) );
criteria.add( Restrictions.eq( "source", source ) );
+ criteria.add( Restrictions.eq( "attributeOptionCombo", attributeOptionCombo ) );
return (CompleteDataSetRegistration) criteria.uniqueResult();
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java 2014-03-21 04:09:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java 2014-06-23 21:31:31 +0000
@@ -595,7 +595,9 @@
{
CompleteDataSetRegistration registration = new CompleteDataSetRegistration();
- if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit ) == null )
+ DataElementCategoryOptionCombo optionCombo = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
+ if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, optionCombo ) == null )
{
registration.setDataSet( dataSet );
registration.setPeriod( period );
@@ -609,8 +611,10 @@
private void deregisterCompleteDataSet( DataSet dataSet, Period period, OrganisationUnit organisationUnit )
{
+ DataElementCategoryOptionCombo optionCombo = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
- organisationUnit );
+ organisationUnit, optionCombo );
if ( registration != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/J2MEDataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/J2MEDataValueSMSListener.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/J2MEDataValueSMSListener.java 2014-06-23 21:31:31 +0000
@@ -345,7 +345,9 @@
{
CompleteDataSetRegistration registration = new CompleteDataSetRegistration();
- if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit ) == null )
+ DataElementCategoryOptionCombo optionCombo = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
+ if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, optionCombo ) == null )
{
registration.setDataSet( dataSet );
registration.setPeriod( period );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java 2014-06-23 19:53:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java 2014-06-23 21:31:31 +0000
@@ -142,8 +142,8 @@
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationA );
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationB );
- assertEquals( registrationA, completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertEquals( registrationB, completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertEquals( registrationA, completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertEquals( registrationB, completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
@Test
@@ -155,18 +155,18 @@
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationA );
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationB );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
completeDataSetRegistrationService.deleteCompleteDataSetRegistration( registrationA );
- assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
completeDataSetRegistrationService.deleteCompleteDataSetRegistration( registrationB );
- assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
@Test
@@ -241,16 +241,16 @@
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationC );
completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationD );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
completeDataSetRegistrationService.deleteCompleteDataSetRegistrations( dataSetA );
- assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, sourceA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStoreTest.java 2014-06-23 19:13:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationStoreTest.java 2014-06-23 21:31:31 +0000
@@ -139,8 +139,8 @@
registrationStore.saveCompleteDataSetRegistration( registrationA );
registrationStore.saveCompleteDataSetRegistration( registrationB );
- assertEquals( registrationA, registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertEquals( registrationB, registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertEquals( registrationA, registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertEquals( registrationB, registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
@Test
@@ -152,18 +152,18 @@
registrationStore.saveCompleteDataSetRegistration( registrationA );
registrationStore.saveCompleteDataSetRegistration( registrationB );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
registrationStore.deleteCompleteDataSetRegistration( registrationA );
- assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
registrationStore.deleteCompleteDataSetRegistration( registrationB );
- assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
@Test
@@ -307,16 +307,16 @@
registrationStore.saveCompleteDataSetRegistration( registrationC );
registrationStore.saveCompleteDataSetRegistration( registrationD );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodB, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodA, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
registrationStore.deleteCompleteDataSetRegistrations( dataSetA );
- assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA ) );
- assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodB, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodA, sourceA ) );
- assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA ) );
+ assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo ) );
+ assertNull( registrationStore.getCompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo ) );
+ assertNotNull( registrationStore.getCompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo ) );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-06-23 19:13:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-06-23 21:31:31 +0000
@@ -162,7 +162,9 @@
throw new IllegalArgumentException( ERROR_INVALID_ORG_UNIT + orgUnit );
}
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet_, period_, orgUnit_ );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet_, period_, orgUnit_, optionCombo );
Date completeDate = registration != null ? registration.getDate() : null;
@@ -193,7 +195,9 @@
throw new IllegalArgumentException( ERROR_INVALID_ORG_UNIT + orgUnit );
}
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet_, period_, orgUnit_ );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet_, period_, orgUnit_, optionCombo );
Date completeDate = registration != null ? registration.getDate() : null;
@@ -608,7 +612,7 @@
period = periodService.reloadPeriod( period );
- CompleteDataSetRegistration completeAlready = registrationService.getCompleteDataSetRegistration( dataSet, period, orgUnit );
+ CompleteDataSetRegistration completeAlready = registrationService.getCompleteDataSetRegistration( dataSet, period, orgUnit, attributeOptionCombo );
String username = currentUserService.getCurrentUsername();
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2014-06-23 21:31:31 +0000
@@ -157,7 +157,7 @@
assertTrue( dataValues.contains( new DataValue( deB, peA, ouA, optionComboA, optionComboA ) ) );
assertTrue( dataValues.contains( new DataValue( deC, peA, ouA, optionComboA, optionComboA ) ) );
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dsA, peA, ouA );
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dsA, peA, ouA, optionComboA );
assertNotNull( registration );
assertEquals( dsA, registration.getDataSet() );
=== 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-05-20 15:35:16 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2014-06-23 21:31:31 +0000
@@ -378,8 +378,10 @@
}
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
- unit );
+ unit, optionCombo );
if ( registration != null )
{
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java 2014-06-23 19:13:26 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java 2014-06-23 21:31:31 +0000
@@ -172,10 +172,10 @@
batchHandler.insertObject( registrationC, false );
batchHandler.insertObject( registrationD, false );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, unitA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, unitA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, unitA ) );
- assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, unitA ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, unitA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodB, unitA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodA, unitA, optionCombo ) );
+ assertNotNull( completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetB, periodB, unitA, optionCombo ) );
}
@Test
@@ -187,7 +187,7 @@
batchHandler.updateObject( registrationA );
- registrationA = completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, unitA );
+ registrationA = completeDataSetRegistrationService.getCompleteDataSetRegistration( dataSetA, periodA, unitA, optionCombo );
assertEquals( dateB, registrationA.getDate() );
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CompleteDataSetRegistrationController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CompleteDataSetRegistrationController.java 2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CompleteDataSetRegistrationController.java 2014-06-23 21:31:31 +0000
@@ -224,7 +224,7 @@
if ( !multiOu )
{
- registerCompleteDataSet( dataSet, period, organisationUnit, storedBy );
+ registerCompleteDataSet( dataSet, period, organisationUnit, attributeOptionCombo, storedBy );
}
else
{
@@ -232,7 +232,7 @@
{
if ( unit.getDataSets().contains( dataSet ) )
{
- registerCompleteDataSet( dataSet, period, unit, storedBy );
+ registerCompleteDataSet( dataSet, period, unit, attributeOptionCombo, storedBy );
}
}
}
@@ -296,7 +296,7 @@
if ( !multiOu )
{
- unRegisterCompleteDataSet( dataSet, period, organisationUnit );
+ unRegisterCompleteDataSet( dataSet, period, organisationUnit, attributeOptionCombo );
}
else
{
@@ -304,7 +304,7 @@
{
if ( unit.getDataSets().contains( dataSet ) )
{
- unRegisterCompleteDataSet( dataSet, period, unit );
+ unRegisterCompleteDataSet( dataSet, period, unit, attributeOptionCombo );
}
}
}
@@ -314,13 +314,14 @@
// Supportive methods
// -------------------------------------------------------------------------
- private void registerCompleteDataSet( DataSet dataSet, Period period, OrganisationUnit organisationUnit, String storedBy )
+ private void registerCompleteDataSet( DataSet dataSet, Period period,
+ OrganisationUnit organisationUnit, DataElementCategoryOptionCombo attributeOptionCombo, String storedBy )
{
I18nFormat format = i18nManager.getI18nFormat();
CompleteDataSetRegistration registration = new CompleteDataSetRegistration();
- if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit ) == null )
+ if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, attributeOptionCombo ) == null )
{
registration.setDataSet( dataSet );
registration.setPeriod( period );
@@ -334,9 +335,10 @@
}
}
- private void unRegisterCompleteDataSet( DataSet dataSet, Period period, OrganisationUnit organisationUnit )
+ private void unRegisterCompleteDataSet( DataSet dataSet, Period period,
+ OrganisationUnit organisationUnit, DataElementCategoryOptionCombo attributeOptionCombo )
{
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit );
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, attributeOptionCombo );
if ( registration != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java 2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java 2014-06-23 21:31:31 +0000
@@ -261,7 +261,7 @@
if ( !multiOrganisationUnit )
{
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet,
- period, organisationUnit );
+ period, organisationUnit, attributeOptionCombo );
if ( registration != null )
{
@@ -292,7 +292,7 @@
}
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration(
- dataSet, period, ou );
+ dataSet, period, ou, attributeOptionCombo );
if ( complete && registration == null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetDataSetOverviewAction.java 2014-06-23 21:31:31 +0000
@@ -28,8 +28,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.commons.lang.Validate;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
@@ -41,8 +45,7 @@
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
-import java.util.ArrayList;
-import java.util.List;
+import com.opensymphony.xwork2.Action;
/**
* @author mortenoh
@@ -100,7 +103,14 @@
{
this.registrationService = registrationService;
}
+
+ private DataElementCategoryService categoryService;
+ public void setCategoryService( DataElementCategoryService categoryService )
+ {
+ this.categoryService = categoryService;
+ }
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -226,7 +236,9 @@
dataSet = dataSetService.getDataSet( dataSetId );
- if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit ) == null )
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+
+ if ( registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, optionCombo ) == null )
{
completed = false;
}
@@ -235,7 +247,6 @@
completed = true;
}
-
if ( sectionId != null )
{
for ( Section section : dataSet.getSections() )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java 2014-06-23 21:31:31 +0000
@@ -28,8 +28,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.lang.Validate;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -40,10 +46,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.opensymphony.xwork2.Action;
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -76,6 +79,13 @@
this.registrationService = registrationService;
}
+ private DataElementCategoryService categoryService;
+
+ public void setCategoryService( DataElementCategoryService categoryService )
+ {
+ this.categoryService = categoryService;
+ }
+
private FormUtils formUtils;
public void setFormUtils( FormUtils formUtils )
@@ -205,12 +215,14 @@
markLockedDataSets( organisationUnit, dataSet, periods );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
for ( Period period : periods )
{
period.setName( format.formatPeriod( period ) );
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet,
- period, organisationUnit );
+ period, organisationUnit, optionCombo );
periodCompletedMap.put( period, registration != null ? true : false );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/MarkComplete.java 2014-06-23 21:31:31 +0000
@@ -28,8 +28,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
+import java.util.Date;
+
import org.apache.commons.lang.Validate;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -40,7 +43,7 @@
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.user.CurrentUserService;
-import java.util.Date;
+import com.opensymphony.xwork2.Action;
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -87,6 +90,13 @@
this.periodService = periodService;
}
+ private DataElementCategoryService categoryService;
+
+ public void setCategoryService( DataElementCategoryService categoryService )
+ {
+ this.categoryService = categoryService;
+ }
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -144,8 +154,10 @@
DataSet dataSet = dataSetService.getDataSet( dataSetId );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
- organisationUnit );
+ organisationUnit, optionCombo );
if ( registration == null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2014-06-23 21:31:31 +0000
@@ -426,8 +426,10 @@
}
}
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
+
CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
- organisationUnit );
+ organisationUnit, optionCombo );
if ( registration == null && complete )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/UndoCompleteAction.java 2014-06-23 21:31:31 +0000
@@ -28,6 +28,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -36,6 +38,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
+
import com.opensymphony.xwork2.Action;
public class UndoCompleteAction implements Action
@@ -71,6 +74,13 @@
{
this.periodService = periodService;
}
+
+ private DataElementCategoryService categoryService;
+
+ public void setCategoryService( DataElementCategoryService categoryService )
+ {
+ this.categoryService = categoryService;
+ }
// -------------------------------------------------------------------------
// Input & Output
@@ -121,8 +131,10 @@
Period period = periodService.getPeriod( isoPeriod );
DataSet dataSet = dataSetService.getDataSet( dataSetId );
+
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); //TODO
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit );
+ CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, optionCombo );
if ( registration != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-05-26 10:22:07 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-06-23 21:31:31 +0000
@@ -67,6 +67,7 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="registrationService"
ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+ <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
<bean id="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction"
@@ -79,6 +80,7 @@
<property name="formUtils" ref="org.hisp.dhis.light.utils.FormUtils" />
<property name="registrationService"
ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+ <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
<bean id="org.hisp.dhis.light.dataentry.action.MarkComplete"
@@ -90,6 +92,7 @@
<property name="registrationService"
ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+ <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
<bean id="org.hisp.dhis.light.dataentry.action.UndoCompleteAction"
@@ -100,6 +103,7 @@
<property name="registrationService"
ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+ <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
<bean id="org.hisp.dhis.light.dataentry.action.GetSectionFormAction"
@@ -119,8 +123,7 @@
<property name="organisationUnitService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="categoryService"
- ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+ <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="registrationService"
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2014-06-23 21:31:31 +0000
@@ -41,9 +41,11 @@
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.webapi.utils.ContextUtils;
+import org.hisp.dhis.webapi.utils.InputUtils;
import org.hisp.dhis.webapi.utils.ContextUtils.CacheStrategy;
import org.hisp.dhis.common.DimensionalObjectUtils;
import org.hisp.dhis.common.Grid;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -123,6 +125,9 @@
@Autowired
private ContextUtils contextUtils;
+ @Autowired
+ private InputUtils inputUtils;
+
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
@@ -148,6 +153,20 @@
this.ou = ou;
}
+ private String cc;
+
+ public void setCc( String cc )
+ {
+ this.cc = cc;
+ }
+
+ private String cp;
+
+ public void setCp( String cp )
+ {
+ this.cp = cp;
+ }
+
private Set<String> dimension;
public void setDimension( Set<String> dimension )
@@ -267,7 +286,9 @@
String dataSetType = selectedDataSet.getDataSetType();
- registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, selectedPeriod, selectedOrgunit );
+ DataElementCategoryOptionCombo attributeOptionCombo = inputUtils.getAttributeOptionCombo( response, cc, cp );
+
+ registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, selectedPeriod, selectedOrgunit, attributeOptionCombo );
if ( TYPE_CUSTOM.equals( dataSetType ) )
{