dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15919
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5883: Don't save values of multi-demenstion dataelement in data entry form.
------------------------------------------------------------
revno: 5883
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-08 15:57:23 +0700
message:
Don't save values of multi-demenstion dataelement in data entry form.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientdatavalue/hibernate/PatientDataValue.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.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-patient/src/main/resources/org/hisp/dhis/patientdatavalue/hibernate/PatientDataValue.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientdatavalue/hibernate/PatientDataValue.hbm.xml 2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientdatavalue/hibernate/PatientDataValue.hbm.xml 2012-02-08 08:57:23 +0000
@@ -11,13 +11,12 @@
column="programstageinstanceid" foreign-key="fk_patientdatavalue_programstageinstanceid" />
<key-many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid"
foreign-key="fk_patientdatavalue_dataelementid" />
+ <key-many-to-one name="optionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid"
+ foreign-key="fk_patientdatavalue_categoryoptioncomboid" />
<key-many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit"
column="organisationunitid" foreign-key="fk_patientdatavalue_organisationunitid" />
</composite-id>
-
- <many-to-one name="optionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid"
- foreign-key="fk_patientdatavalue_categoryoptioncomboid" />
-
+
<property name="value" />
<property name="providedByAnotherFacility" column="providedbyanotherfacility" not-null="true" />
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2011-12-14 11:15:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2012-02-08 08:57:23 +0000
@@ -28,7 +28,6 @@
package org.hisp.dhis.caseentry.action.caseentry;
import java.util.Date;
-import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -164,51 +163,13 @@
DataElement dataElement = dataElementService.getDataElement( dataElementId );
- if ( value != null && value.trim().length() == 0 )
- {
- value = null;
- }
-
- if ( value != null )
- {
- value = value.trim();
- }
-
DataElementCategoryOptionCombo optionCombo = null;
- if ( optionComboId == 0 )
- {
- optionCombo = dataElement.getCategoryCombo().getOptionCombos().iterator().next();
- }
- else
- {
- Set<DataElementCategoryOptionCombo> options = dataElement.getCategoryCombo().getOptionCombos();
-
- if ( options != null )
- {
- for ( DataElementCategoryOptionCombo tmpOption : options )
- {
- if ( tmpOption.getId() == optionComboId )
- {
- optionCombo = tmpOption;
- break;
- }
- }
- }
- }
+ optionCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( optionComboId );
PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( programStageInstance,
- dataElement, organisationUnit );
-
- if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_STRING )
- && dataElement.isMultiDimensional() )
- {
- if ( value != null )
- {
- optionCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( value ) );
- }
- }
-
+ dataElement, optionCombo, organisationUnit );
+
if ( programStageInstance.getExecutionDate() == null )
{
programStageInstance.setExecutionDate( new Date() );