dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26914
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13322: DataValue, renamed property optionCombo to categoryOptionCombo for consistency. Kept an alias get...
------------------------------------------------------------
revno: 13322
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-12-19 09:23:37 +0100
message:
DataValue, renamed property optionCombo to categoryOptionCombo for consistency. Kept an alias get method not to break velocity templates around.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportDataValue.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.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/main/resources/org/hisp/dhis/datavalue/hibernate/DataValue.hbm.xml
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/SpringDataValueSetStore.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMetaDataDependencyService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/analysis/DefaultImportAnalyser.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/RoutineDataValueRowHandler.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/SemiPermanentDataValueRowHandler.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataValueImporter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandler.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/EditDataValueAction.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/datavalue/DataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2013-12-14 14:47:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2013-12-19 08:23:37 +0000
@@ -73,7 +73,7 @@
/**
* Part of the DataValue's composite ID
*/
- private DataElementCategoryOptionCombo optionCombo;
+ private DataElementCategoryOptionCombo categoryOptionCombo;
private String value;
@@ -100,12 +100,12 @@
this.source = source;
}
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, DataElementCategoryOptionCombo optionCombo )
+ public DataValue( DataElement dataElement, Period period, OrganisationUnit source, DataElementCategoryOptionCombo categoryOptionCombo )
{
this.dataElement = dataElement;
this.period = period;
this.source = source;
- this.optionCombo = optionCombo;
+ this.categoryOptionCombo = categoryOptionCombo;
}
public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value )
@@ -116,13 +116,13 @@
this.value = value;
}
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, DataElementCategoryOptionCombo optionCombo )
+ public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, DataElementCategoryOptionCombo categoryOptionCombo )
{
this.dataElement = dataElement;
this.period = period;
this.source = source;
this.value = value;
- this.optionCombo = optionCombo;
+ this.categoryOptionCombo = categoryOptionCombo;
}
public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, String storedBy,
@@ -138,7 +138,7 @@
}
public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, String storedBy,
- Date timestamp, String comment, DataElementCategoryOptionCombo optionCombo )
+ Date timestamp, String comment, DataElementCategoryOptionCombo categoryOptionCombo )
{
this.dataElement = dataElement;
this.period = period;
@@ -147,7 +147,7 @@
this.storedBy = storedBy;
this.timestamp = timestamp;
this.comment = comment;
- this.optionCombo = optionCombo;
+ this.categoryOptionCombo = categoryOptionCombo;
}
// -------------------------------------------------------------------------
@@ -168,6 +168,14 @@
// Logic
// -------------------------------------------------------------------------
+ /**
+ * Alias for getCategoryOptionCombo(). TODO remove.
+ */
+ public DataElementCategoryOptionCombo getOptionCombo()
+ {
+ return getCategoryOptionCombo();
+ }
+
public boolean isZero()
{
return dataElement != null && dataElement.getType().equals( DataElement.VALUE_TYPE_INT )
@@ -225,7 +233,7 @@
final DataValue other = (DataValue) o;
- return dataElement.equals( other.getDataElement() ) && optionCombo.equals( other.getOptionCombo() )
+ return dataElement.equals( other.getDataElement() ) && categoryOptionCombo.equals( other.getCategoryOptionCombo() )
&& period.equals( other.getPeriod() ) && source.equals( other.getSource() );
}
@@ -235,7 +243,7 @@
final int prime = 31;
int result = 1;
- result = result * prime + optionCombo.hashCode();
+ result = result * prime + categoryOptionCombo.hashCode();
result = result * prime + period.hashCode();
result = result * prime + dataElement.hashCode();
result = result * prime + source.hashCode();
@@ -277,14 +285,14 @@
this.source = source;
}
- public DataElementCategoryOptionCombo getOptionCombo()
+ public DataElementCategoryOptionCombo getCategoryOptionCombo()
{
- return optionCombo;
+ return categoryOptionCombo;
}
- public void setOptionCombo( DataElementCategoryOptionCombo optionCombo )
+ public void setCategoryOptionCombo( DataElementCategoryOptionCombo categoryOptionCombo )
{
- this.optionCombo = optionCombo;
+ this.categoryOptionCombo = categoryOptionCombo;
}
public String getValue()
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java 2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java 2013-12-19 08:23:37 +0000
@@ -94,7 +94,7 @@
this.dataElementId = dataValue.getDataElement().getId();
this.periodId = dataValue.getPeriod().getId();
this.sourceId = dataValue.getSource().getId();
- this.categoryOptionComboId = dataValue.getOptionCombo().getId();
+ this.categoryOptionComboId = dataValue.getCategoryOptionCombo().getId();
this.value = dataValue.getValue();
this.storedBy = dataValue.getStoredBy();
this.timestamp = dataValue.getTimestamp();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportDataValue.java 2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportDataValue.java 2013-12-19 08:23:37 +0000
@@ -87,7 +87,7 @@
public void setDataValue( DataValue dataValue, ImportObjectStatus status )
{
this.dataElementId = dataValue.getDataElement().getId();
- this.categoryOptionComboId = dataValue.getOptionCombo().getId();
+ this.categoryOptionComboId = dataValue.getCategoryOptionCombo().getId();
this.periodId = dataValue.getPeriod().getId();
this.sourceId = dataValue.getSource().getId();
this.value = dataValue.getValue();
@@ -105,7 +105,7 @@
value.setDataElement( element );
DataElementCategoryOptionCombo optionCombo = new DataElementCategoryOptionCombo();
- value.setOptionCombo( optionCombo );
+ value.setCategoryOptionCombo( optionCombo );
Period period = new Period();
value.setPeriod( period );
@@ -114,7 +114,7 @@
value.setSource( source );
value.getDataElement().setId( this.dataElementId );
- value.getOptionCombo().setId( this.categoryOptionComboId );
+ value.getCategoryOptionCombo().setId( this.categoryOptionComboId );
value.getPeriod().setId( this.periodId );
value.getSource().setId( this.sourceId );
value.setValue( this.value );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java 2013-12-16 11:49:45 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java 2013-12-19 08:23:37 +0000
@@ -28,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.system.deletion.DeletionHandler;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2013-10-11 12:58:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2013-12-19 08:23:37 +0000
@@ -164,7 +164,7 @@
criteria.add( Restrictions.eq( "source", source ) );
criteria.add( Restrictions.eq( "dataElement", dataElement ) );
criteria.add( Restrictions.eq( "period", storedPeriod ) );
- criteria.add( Restrictions.eq( "optionCombo", optionCombo ) );
+ criteria.add( Restrictions.eq( "categoryOptionCombo", optionCombo ) );
return (DataValue) criteria.uniqueResult();
}
@@ -287,7 +287,7 @@
criteria.add( Restrictions.eq( "source", source ) );
criteria.add( Restrictions.eq( "period", storedPeriod ) );
criteria.add( Restrictions.in( "dataElement", dataElements ) );
- criteria.add( Restrictions.in( "optionCombo", optionCombos ) );
+ criteria.add( Restrictions.in( "categoryOptionCombo", optionCombos ) );
return criteria.list();
}
@@ -369,7 +369,7 @@
Criteria criteria = session.createCriteria( DataValue.class );
criteria.add( Restrictions.eq( "dataElement", dataElement ) );
- criteria.add( Restrictions.eq( "optionCombo", optionCombo ) );
+ criteria.add( Restrictions.eq( "categoryOptionCombo", optionCombo ) );
criteria.add( Restrictions.in( "period", storedPeriods ) );
criteria.add( Restrictions.in( "source", sources ) );
@@ -387,7 +387,7 @@
}
Criteria criteria = session.createCriteria( DataValue.class );
- criteria.add( Restrictions.in( "optionCombo", optionCombos ) );
+ criteria.add( Restrictions.in( "categoryOptionCombo", optionCombos ) );
return criteria.list();
}
@@ -493,8 +493,6 @@
"and p.enddate >= '" + DateUtils.getMediumDateString( date ) + "' " +
"and p.periodtypeid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( PeriodType.class, periodTypes ) ) + ") ";
- log.trace( "getDataValueMap sql = " + sql );
-
SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql );
Map<DataElementOperand, Long> checkForDuplicates = new HashMap<DataElementOperand, Long>();
@@ -518,8 +516,7 @@
if ( existingPeriodInterval != null && existingPeriodInterval < periodInterval )
{
- // Don't overwrite the previously-stored value if it was
- // for a shorter interval.
+ // Don't overwrite the previous value if for a shorter interval
continue;
}
=== 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 2013-11-22 09:13:38 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java 2013-12-19 08:23:37 +0000
@@ -355,7 +355,7 @@
if ( dv == null )
{
dv = new DataValue();
- dv.setOptionCombo( optionCombo );
+ dv.setCategoryOptionCombo( optionCombo );
dv.setSource( orgunit );
dv.setDataElement( code.getDataElement() );
dv.setPeriod( period );
=== 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 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/J2MEDataValueSMSListener.java 2013-12-19 08:23:37 +0000
@@ -207,7 +207,7 @@
if ( dv == null )
{
dv = new DataValue();
- dv.setOptionCombo( optionCombo );
+ dv.setCategoryOptionCombo( optionCombo );
dv.setSource( orgUnit );
dv.setDataElement( code.getDataElement() );
dv.setPeriod( period );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datavalue/hibernate/DataValue.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datavalue/hibernate/DataValue.hbm.xml 2013-08-23 12:47:51 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datavalue/hibernate/DataValue.hbm.xml 2013-12-19 08:23:37 +0000
@@ -10,7 +10,7 @@
<key-many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid" foreign-key="fk_datavalue_dataelementid" />
<key-many-to-one name="period" class="org.hisp.dhis.period.Period" column="periodid" foreign-key="fk_datavalue_periodid" />
<key-many-to-one name="source" class="org.hisp.dhis.organisationunit.OrganisationUnit" column="sourceid" foreign-key="fk_datavalue_organisationunitid" />
- <key-many-to-one name="optionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid" foreign-key="fk_datavalue_categoryoptioncomboid" />
+ <key-many-to-one name="categoryOptionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid" foreign-key="fk_datavalue_categoryoptioncomboid" />
</composite-id>
<property name="value" length="255" />
=== 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 2013-12-16 08:58:27 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2013-12-19 08:23:37 +0000
@@ -28,7 +28,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.csvreader.CsvReader;
+import static org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty.UUID;
+import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
+import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
+import static org.hisp.dhis.system.util.ConversionUtils.wrap;
+import static org.hisp.dhis.system.util.DateUtils.getDefaultDate;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.nio.charset.Charset;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
import org.amplecode.quick.BatchHandler;
import org.amplecode.quick.BatchHandlerFactory;
import org.amplecode.staxwax.factory.XMLFactory;
@@ -66,23 +82,7 @@
import org.hisp.dhis.user.CurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import static org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty.UUID;
-import static org.hisp.dhis.importexport.ImportStrategy.*;
-import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
-import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
-import static org.hisp.dhis.system.util.ConversionUtils.wrap;
-import static org.hisp.dhis.system.util.DateUtils.getDefaultDate;
+import com.csvreader.CsvReader;
/**
* @author Lars Helge Overland
@@ -394,7 +394,7 @@
internalValue.setDataElement( dataElement );
internalValue.setPeriod( period );
internalValue.setSource( orgUnit );
- internalValue.setOptionCombo( categoryOptionCombo );
+ internalValue.setCategoryOptionCombo( categoryOptionCombo );
internalValue.setValue( dataValue.getValue() );
if ( dataValue.getStoredBy() == null || dataValue.getStoredBy().trim().isEmpty() )
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java 2013-12-10 18:10:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java 2013-12-19 08:23:37 +0000
@@ -28,7 +28,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.csvreader.CsvWriter;
+import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
+import static org.hisp.dhis.system.util.DateUtils.getMediumDateString;
+import static org.hisp.dhis.system.util.TextUtils.getCommaDelimitedString;
+
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Set;
+
import org.amplecode.staxwax.factory.XMLFactory;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataset.DataSet;
@@ -44,16 +53,7 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
-import static org.hisp.dhis.system.util.DateUtils.getLongDateString;
-import static org.hisp.dhis.system.util.DateUtils.getMediumDateString;
-import static org.hisp.dhis.system.util.TextUtils.getCommaDelimitedString;
+import com.csvreader.CsvWriter;
public class SpringDataValueSetStore
implements DataValueSetStore
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java 2013-12-18 06:05:41 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java 2013-12-19 08:23:37 +0000
@@ -28,6 +28,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.hisp.dhis.common.IdentifiableObjectManager;
import org.hisp.dhis.dxf2.importsummary.ImportConflict;
import org.hisp.dhis.dxf2.importsummary.ImportStatus;
@@ -43,7 +54,6 @@
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientIdentifierTypeService;
import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patient.util.PatientIdentifierGenerator;
import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
import org.hisp.dhis.program.Program;
@@ -53,18 +63,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
-
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
@@ -347,8 +345,7 @@
}
patient.setName( person.getName() );
- String phoneNumber = person.getContact() != null ? person.getContact().getPhoneNumber() : null;
-
+
updateSystemIdentifier( person );
removeRelationships( patient );
removeIdentifiers( patient );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2013-12-16 12:31:45 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2013-12-19 08:23:37 +0000
@@ -28,20 +28,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.google.common.collect.Lists;
+import static org.springframework.util.Assert.notNull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
-import org.hisp.dhis.attribute.Attribute;
import org.hisp.dhis.cache.HibernateCacheManager;
-import org.hisp.dhis.concept.Concept;
-import org.hisp.dhis.constant.Constant;
-import org.hisp.dhis.document.Document;
import org.hisp.dhis.dxf2.timer.SystemNanoTimer;
import org.hisp.dhis.dxf2.timer.Timer;
-import org.hisp.dhis.option.OptionSet;
import org.hisp.dhis.scheduling.TaskId;
-import org.hisp.dhis.sqlview.SqlView;
import org.hisp.dhis.system.notification.NotificationLevel;
import org.hisp.dhis.system.notification.Notifier;
import org.hisp.dhis.system.util.ReflectionUtils;
@@ -51,14 +53,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.springframework.util.Assert.notNull;
+import com.google.common.collect.Lists;
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMetaDataDependencyService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMetaDataDependencyService.java 2013-10-31 09:19:04 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultMetaDataDependencyService.java 2013-12-19 08:23:37 +0000
@@ -27,7 +27,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.fasterxml.jackson.annotation.JsonView;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.proxy.HibernateProxy;
@@ -48,17 +59,7 @@
import org.hisp.dhis.validation.ValidationRule;
import org.springframework.beans.factory.annotation.Autowired;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
+import com.fasterxml.jackson.annotation.JsonView;
/**
* @author Ovidiu Rosu <rosu.ovi@xxxxxxxxx>
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2013-12-16 08:58:27 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2013-12-19 08:23:37 +0000
@@ -28,6 +28,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.system.util.PredicateUtils.idObjectCollectionsWithScanned;
+import static org.hisp.dhis.system.util.PredicateUtils.idObjects;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
@@ -53,7 +64,6 @@
import org.hisp.dhis.dxf2.metadata.handlers.ObjectHandlerUtils;
import org.hisp.dhis.expression.Expression;
import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.importexport.ImportStrategy;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.period.PeriodType;
@@ -64,17 +74,6 @@
import org.hisp.dhis.user.UserCredentials;
import org.springframework.beans.factory.annotation.Autowired;
-import java.lang.reflect.Field;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.PredicateUtils.idObjectCollectionsWithScanned;
-import static org.hisp.dhis.system.util.PredicateUtils.idObjects;
-
/**
* Importer that can handle IdentifiableObject and NameableObject.
*
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java 2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java 2013-12-19 08:23:37 +0000
@@ -28,6 +28,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
import org.hisp.dhis.DhisTest;
import org.hisp.dhis.common.IdentifiableObjectManager;
import org.hisp.dhis.dxf2.events.person.Person;
@@ -42,13 +51,6 @@
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-
-import static org.junit.Assert.*;
-
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/analysis/DefaultImportAnalyser.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/analysis/DefaultImportAnalyser.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/analysis/DefaultImportAnalyser.java 2013-12-19 08:23:37 +0000
@@ -92,7 +92,7 @@
values.add( new EntityPropertyValue( DataValue.class, PROP_PRIMARY_KEY,
value.getDataElement().getId() + SEPARARATOR +
- value.getOptionCombo().getId() + SEPARARATOR +
+ value.getCategoryOptionCombo().getId() + SEPARARATOR +
value.getPeriod().getId() + SEPARARATOR +
value.getSource().getId() ) );
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/RoutineDataValueRowHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/RoutineDataValueRowHandler.java 2013-12-03 15:16:58 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/RoutineDataValueRowHandler.java 2013-12-19 08:23:37 +0000
@@ -129,7 +129,7 @@
source.setId( organisationUnitMapping.get( dhis14Value.getOrganisationUnitId() ) );
value.setDataElement( element );
- value.setOptionCombo( categoryOptionCombo );
+ value.setCategoryOptionCombo( categoryOptionCombo );
value.setPeriod( period );
value.setSource( source );
value.setStoredBy( dhis14Value.getStoredBy() );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/SemiPermanentDataValueRowHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/SemiPermanentDataValueRowHandler.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/SemiPermanentDataValueRowHandler.java 2013-12-19 08:23:37 +0000
@@ -126,7 +126,7 @@
period.setId( periodMapping.get( period ) );
value.setDataElement( element );
- value.setOptionCombo( categoryOptionCombo );
+ value.setCategoryOptionCombo( categoryOptionCombo );
value.setPeriod( period );
value.setSource( source );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2013-09-20 15:13:05 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2013-12-19 08:23:37 +0000
@@ -257,7 +257,7 @@
value.setComment( values[13] );
value.setTimestamp( DateUtils.getDefaultDate( values[15] ) );
- value.setOptionCombo( proxyCategoryOptionCombo );
+ value.setCategoryOptionCombo( proxyCategoryOptionCombo );
value.setStoredBy( owner );
if ( validValue )
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataValueImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataValueImporter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataValueImporter.java 2013-12-19 08:23:37 +0000
@@ -93,7 +93,7 @@
return null;
}
- return dataValueService.getDataValue( object.getDataElement().getId(), object.getOptionCombo().getId(),
+ return dataValueService.getDataValue( object.getDataElement().getId(), object.getCategoryOptionCombo().getId(),
object.getPeriod().getId(), object.getSource().getId() );
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java 2013-10-23 09:12:37 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java 2013-12-19 08:23:37 +0000
@@ -1032,13 +1032,13 @@
if ( dataElementMapping.containsKey( value.getDataElement().getId() )
&& periodMapping.containsKey( value.getPeriod().getId())
&& sourceMapping.containsKey( value.getSource().getId())
- && categoryOptionComboMapping.containsKey(value.getOptionCombo().getId()))
+ && categoryOptionComboMapping.containsKey(value.getCategoryOptionCombo().getId()))
{
value.getDataElement().setId( dataElementMapping.get( value.getDataElement().getId() ) );
value.getPeriod().setId( periodMapping.get( value.getPeriod().getId() ) );
value.getSource().setId( sourceMapping.get( value.getSource().getId() ) );
- value.getOptionCombo().setId( categoryOptionComboMapping.get( value.getOptionCombo().getId() ) );
+ value.getCategoryOptionCombo().setId( categoryOptionComboMapping.get( value.getCategoryOptionCombo().getId() ) );
importer.importObject( value, params );
importedObjects++;
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java 2013-10-23 09:12:37 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java 2013-12-19 08:23:37 +0000
@@ -614,7 +614,7 @@
DataValue dataValue = (DataValue) object;
dataValue = updateDataValue( dataValue, dataValueService.getDataValue( dataValue.getSource(), dataValue
- .getDataElement(), dataValue.getPeriod(), dataValue.getOptionCombo() ) );
+ .getDataElement(), dataValue.getPeriod(), dataValue.getCategoryOptionCombo() ) );
}
// ---------------------------------------------------------------------
@@ -719,7 +719,7 @@
original.setStoredBy( update.getStoredBy() );
original.setTimestamp( update.getTimestamp() );
original.setComment( update.getComment() );
- original.setOptionCombo( update.getOptionCombo() );
+ original.setCategoryOptionCombo( update.getCategoryOptionCombo() );
return original;
}
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandler.java 2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandler.java 2013-12-19 08:23:37 +0000
@@ -74,7 +74,7 @@
statementBuilder.setIdentifierValue( value.getDataElement().getId() );
statementBuilder.setIdentifierValue( value.getPeriod().getId() );
statementBuilder.setIdentifierValue( value.getSource().getId() );
- statementBuilder.setIdentifierValue( value.getOptionCombo().getId() );
+ statementBuilder.setIdentifierValue( value.getCategoryOptionCombo().getId() );
}
protected void setUniqueColumns()
@@ -90,7 +90,7 @@
statementBuilder.setUniqueValue( value.getDataElement().getId() );
statementBuilder.setUniqueValue( value.getPeriod().getId() );
statementBuilder.setUniqueValue( value.getSource().getId() );
- statementBuilder.setUniqueValue( value.getOptionCombo().getId() );
+ statementBuilder.setUniqueValue( value.getCategoryOptionCombo().getId() );
}
protected void setColumns()
@@ -115,7 +115,7 @@
statementBuilder.setValue( value.getStoredBy() );
statementBuilder.setValue( getLongDateString( value.getTimestamp() ) );
statementBuilder.setValue( value.getComment() );
- statementBuilder.setValue( value.getOptionCombo().getId() );
+ statementBuilder.setValue( value.getCategoryOptionCombo().getId() );
statementBuilder.setValue( value.isFollowup() );
}
}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java 2013-12-19 08:23:37 +0000
@@ -51,14 +51,14 @@
final DataValue dataValue = new DataValue();
dataValue.setDataElement( new DataElement() );
- dataValue.setOptionCombo( new DataElementCategoryOptionCombo() );
+ dataValue.setCategoryOptionCombo( new DataElementCategoryOptionCombo() );
dataValue.setSource( new OrganisationUnit() );
dataValue.setPeriod( new Period() );
dataValue.getDataElement().setId( resultSet.getInt( 1 ) );
dataValue.getPeriod().setId( resultSet.getInt( 2 ) );
dataValue.getSource().setId( resultSet.getInt( 3 ) );
- dataValue.getOptionCombo().setId( resultSet.getInt( 4 ) );
+ dataValue.getCategoryOptionCombo().setId( resultSet.getInt( 4 ) );
dataValue.setValue( resultSet.getString( 5 ) );
dataValue.setStoredBy( resultSet.getString( 6 ) );
dataValue.setTimestamp( resultSet.getDate( 7 ) );
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2013-12-18 06:05:41 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2013-12-19 08:23:37 +0000
@@ -744,7 +744,7 @@
dataValue.setComment( "Comment" );
dataValue.setStoredBy( "StoredBy" );
dataValue.setTimestamp( date );
- dataValue.setOptionCombo( categoryOptionCombo );
+ dataValue.setCategoryOptionCombo( categoryOptionCombo );
return dataValue;
}
@@ -769,7 +769,7 @@
dataValue.setComment( "Comment" );
dataValue.setStoredBy( "StoredBy" );
dataValue.setTimestamp( lastupdated );
- dataValue.setOptionCombo( categoryOptionCombo );
+ dataValue.setCategoryOptionCombo( categoryOptionCombo );
return dataValue;
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2013-11-28 18:40:39 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2013-12-19 08:23:37 +0000
@@ -297,7 +297,7 @@
for ( DataValue dataValue : dataValues )
{
DataElement dataElement = dataValue.getDataElement();
- DataElementCategoryOptionCombo categoryOptionCombo = dataValue.getOptionCombo();
+ DataElementCategoryOptionCombo categoryOptionCombo = dataValue.getCategoryOptionCombo();
cacheMap.get( dataElement.getUid() + "-" + categoryOptionCombo.getUid() ).setValue( dataValue.getValue() );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java 2013-12-16 17:34:32 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java 2013-12-19 08:23:37 +0000
@@ -202,7 +202,7 @@
for ( DataValue dataValue : values )
{
DataElement dataElement = dataValue.getDataElement();
- DataElementCategoryOptionCombo optionCombo = dataValue.getOptionCombo();
+ DataElementCategoryOptionCombo optionCombo = dataValue.getCategoryOptionCombo();
String key = String.format( "DE%dOC%d", dataElement.getId(), optionCombo.getId() );
String value = dataValue.getValue();
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/EditDataValueAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/EditDataValueAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/EditDataValueAction.java 2013-12-19 08:23:37 +0000
@@ -178,7 +178,7 @@
dataValue.setDataElement( dataElement );
dataValue.setPeriod( period );
dataValue.setSource( unit );
- dataValue.setOptionCombo( categoryOptionCombo );
+ dataValue.setCategoryOptionCombo( categoryOptionCombo );
dataValue.setValue( value );
dataValue.setStoredBy( storedBy );