Skip to content

Commit

Permalink
Merge branch 'master' into 1343-incorrect-result-for-testintersectnull
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival authored Jul 11, 2024
2 parents 1098529 + db3fe10 commit 390275d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static Object popStdDev(Object source, State state) {

Object variance = PopulationVarianceEvaluator.popVariance(source, state);
// The cases in which PopulationVariance returns null are the same as those where PopulationStdDev does.
if(variance == null) {
if (variance == null) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static Object stdDev(Object source, State state) {

Object variance = VarianceEvaluator.variance(source, state);
// The cases in which Variance returns null are the same as those where StdDev does.
if(variance == null) {
if (variance == null) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Value {
* Set to (10<sup>28</sup> - 1) / 10<sup>8</sup>.
*/
public static final BigDecimal MAX_DECIMAL = new BigDecimal("99999999999999999999.99999999");

public static final Integer MIN_INT = Integer.MIN_VALUE;
public static final Long MIN_LONG = Long.MIN_VALUE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import java.math.BigDecimal;
import java.util.Arrays;

import org.hamcrest.core.IsNull;
import org.junit.jupiter.api.Test;
import org.opencds.cqf.cql.engine.elm.executing.AnyTrueEvaluator;
import org.opencds.cqf.cql.engine.elm.executing.AvgEvaluator;
Expand Down Expand Up @@ -79,7 +77,6 @@ void all_aggregate_function_tests() {
value = results.forExpression("AnyTrueIsFalseWhenNull").value();
assertThat(value, is(false));


try {
value = AnyTrueEvaluator.anyTrue(Arrays.asList("this", "is", "error"));
fail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,19 @@ void all_value_literals_and_selectors() {
// define QuantityMax: 99999999999999999999.99999999 'mg'
value = results.forExpression("QuantityMax").value();
assertThat(value, instanceOf(Quantity.class));
assertThat(
((Quantity) value).getValue(),
comparesEqualTo(new BigDecimal("99999999999999999999.99999999")));
assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("99999999999999999999.99999999")));
assertThat(((Quantity) value).getUnit(), is("mg"));

// define QuantityPosMax: +99999999999999999999.99999999 'mg'
value = results.forExpression("QuantityPosMax").value();
assertThat(value, instanceOf(Quantity.class));
assertThat(
((Quantity) value).getValue(),
comparesEqualTo(new BigDecimal("99999999999999999999.99999999")));
assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("99999999999999999999.99999999")));
assertThat(((Quantity) value).getUnit(), is("mg"));

// define QuantityMin: -99999999999999999999.99999999 'mg'
value = results.forExpression("QuantityMin").value();
assertThat(value, instanceOf(Quantity.class));
assertThat(
((Quantity) value).getValue(),
comparesEqualTo(new BigDecimal("-99999999999999999999.99999999")));
assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("-99999999999999999999.99999999")));
assertThat(((Quantity) value).getUnit(), is("mg"));

value = results.forExpression("DecimalZero").value();
Expand Down

0 comments on commit 390275d

Please sign in to comment.