From 92e49c4ce7d128a06f96ddf2ac80ef123ca6717a Mon Sep 17 00:00:00 2001 From: CeciliaLiu8 Date: Fri, 8 Sep 2023 09:58:43 -0500 Subject: [PATCH] MAT-6156 resolve getExpectedValue exception with empty string --- .../services/TestCaseBundleService.java | 4 +++- .../measures/SimpleFhirMeasureLib/madie_measure.json | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java index c9099132..5a0a77d6 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java @@ -27,6 +27,8 @@ import java.util.zip.ZipOutputStream; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; + +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.hl7.fhir.r4.model.*; import org.springframework.stereotype.Service; @@ -204,7 +206,7 @@ private List buildMeasureReportGroupC * @return an equivalent integer */ private int getExpectedValue(Object expectedValue) { - if (expectedValue == null) { + if (expectedValue == null || StringUtils.isBlank(expectedValue.toString())) { return 0; } else if (expectedValue instanceof Boolean) { return (Boolean) expectedValue ? 1 : 0; diff --git a/src/test/resources/measures/SimpleFhirMeasureLib/madie_measure.json b/src/test/resources/measures/SimpleFhirMeasureLib/madie_measure.json index 585c0b90..5e29ab33 100644 --- a/src/test/resources/measures/SimpleFhirMeasureLib/madie_measure.json +++ b/src/test/resources/measures/SimpleFhirMeasureLib/madie_measure.json @@ -36,18 +36,18 @@ "populationValues":[ { "name":"initialPopulation", - "expected":false, - "actual":false + "expected":null, + "actual":null }, { "name":"initialPopulation", - "expected":false, - "actual":false + "expected":" ", + "actual":null }, { "name":"denominator", - "expected":true, - "actual":false + "expected":0, + "actual":0 }, { "name":"denominatorExclusion",