dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21904
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10484: Minor fix in Program validation rule.
------------------------------------------------------------
revno: 10484
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-04-05 11:40:39 +0700
message:
Minor fix in Program validation rule.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.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/java/org/hisp/dhis/program/DefaultProgramValidationService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java 2013-02-08 13:07:21 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java 2013-04-05 04:40:39 +0000
@@ -27,7 +27,6 @@
package org.hisp.dhis.program;
-import static org.hisp.dhis.program.ProgramExpression.NOT_NULL_VALUE_IN_EXPRESSION;
import static org.hisp.dhis.program.ProgramExpression.OBJECT_PROGRAM_STAGE_DATAELEMENT;
import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_ID;
import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_OBJECT;
@@ -147,7 +146,8 @@
}
else
{
- patientDataValues = patientDataValueService.getPatientDataValues( programStageInstance.getProgramInstance().getProgramStageInstances() );
+ patientDataValues = patientDataValueService.getPatientDataValues( programStageInstance.getProgramInstance()
+ .getProgramStageInstances() );
}
Map<String, String> patientDataValueMap = new HashMap<String, String>( patientDataValues.size() );
@@ -171,14 +171,13 @@
programStageInstance, patientDataValueMap );
String operator = validate.getOperator().getMathematicalOperator();
- if ( (leftSideValue != null && rightSideValue.equals( NOT_NULL_VALUE_IN_EXPRESSION ) && rightSideValue == null)
- || ((leftSideValue != null && rightSideValue != null && !((operator.equals( "==" ) && leftSideValue
- .compareTo( rightSideValue ) == 0)
- || (operator.equals( "<" ) && leftSideValue.compareTo( rightSideValue ) < 0)
- || (operator.equals( "<=" ) && (leftSideValue.compareTo( rightSideValue ) <= 0))
- || (operator.equals( ">" ) && leftSideValue.compareTo( rightSideValue ) > 0)
- || (operator.equals( ">=" ) && leftSideValue.compareTo( rightSideValue ) >= 0) || (operator
- .equals( "!=" ) && leftSideValue.compareTo( rightSideValue ) == 0)))) )
+ if ( (leftSideValue != null && rightSideValue != null && !((operator.equals( "==" ) && leftSideValue
+ .compareTo( rightSideValue ) == 0)
+ || (operator.equals( "<" ) && leftSideValue.compareTo( rightSideValue ) < 0)
+ || (operator.equals( "<=" ) && (leftSideValue.compareTo( rightSideValue ) <= 0))
+ || (operator.equals( ">" ) && leftSideValue.compareTo( rightSideValue ) > 0)
+ || (operator.equals( ">=" ) && leftSideValue.compareTo( rightSideValue ) >= 0) || (operator
+ .equals( "!=" ) && leftSideValue.compareTo( rightSideValue ) == 0))) )
{
ProgramValidationResult validationResult = new ProgramValidationResult( programStageInstance, validate,
leftSideValue, rightSideValue );