Skip to content

Commit

Permalink
Merge pull request #155 from MeasureAuthoringTool/MAT-6156_exceptionG…
Browse files Browse the repository at this point in the history
…etExpectedValue

MAT-6156 resolve getExpectedValue exception with empty string
  • Loading branch information
sb-cecilialiu authored Sep 13, 2023
2 parents c0e1501 + 92e49c4 commit dccf467
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -204,7 +206,7 @@ private List<MeasureReport.MeasureReportGroupComponent> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dccf467

Please sign in to comment.