dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19986
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8959: Don't save empty data values in single event entry form.
------------------------------------------------------------
revno: 8959
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-11-09 14:22:44 +0700
message:
Don't save empty data values in single event entry form.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java 2012-08-16 15:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java 2012-11-09 07:22:44 +0000
@@ -197,11 +197,11 @@
String providedElsewhereId = programStage.getId() + "_" + psDataElement.getDataElement().getId()
+ "_facility";
String value = request.getParameter( dataElementFieldId );
- if ( value != null )
+ if ( value != null && value.trim().length()>0)
{
boolean providedElsewhere = (request.getParameter( providedElsewhereId ) == null) ? false : true;
- PatientDataValue patientDataValue = new PatientDataValue( programStageInstance, psDataElement.getDataElement(), new Date(), value );
+ PatientDataValue patientDataValue = new PatientDataValue( programStageInstance, psDataElement.getDataElement(), new Date(), value.trim() );
patientDataValue.setStoredBy( storedBy );
patientDataValue.setProvidedElsewhere( providedElsewhere );
patientDataValueService.savePatientDataValue( patientDataValue );