Skip to content

Commit

Permalink
MAT-5932 refactored code to add meaasureScore and groupIds
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-prateekkeerthi committed Nov 18, 2024
1 parent 99f1204 commit 5c40754
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,29 +242,36 @@ private List<MeasureReport.MeasureReportGroupComponent> buildMeasureReportGroupC
.map(
population -> {
var measureReportGroupComponent = new MeasureReport.MeasureReportGroupComponent();
measureReportGroupComponent.setId(population.getGroupId());
// adding populations
if (population.getPopulationValues() != null) {
var measureReportGroupPopulationComponents =
population.getPopulationValues().stream()
.map(
testCasePopulationValue -> {
String populationCode = testCasePopulationValue.getName().toCode();
String populationDisplay =
testCasePopulationValue.getName().getDisplay();
int expectedValue =
FhirResourceHelpers.getExpectedValue(
testCasePopulationValue.getExpected());
return (new MeasureReport.MeasureReportGroupPopulationComponent())
.setCode(
FhirResourceHelpers.buildCodeableConcept(
populationCode,
UriConstants.POPULATION_SYSTEM_URI,
populationDisplay))
.setCount(expectedValue);
var groupComponent =
(new MeasureReport.MeasureReportGroupPopulationComponent())
.setCode(
FhirResourceHelpers.buildCodeableConcept(
testCasePopulationValue.getName().toCode(),
UriConstants.POPULATION_SYSTEM_URI,
testCasePopulationValue.getName().getDisplay()))
.setCount(
FhirResourceHelpers.getExpectedValue(
testCasePopulationValue.getExpected()));
groupComponent.setId(testCasePopulationValue.getId());
return groupComponent;
})
.collect(Collectors.toList());
measureReportGroupComponent.setPopulation(measureReportGroupPopulationComponents);
}

// adding measure score
measureReportGroupComponent.setMeasureScore(
new Quantity()
.setValue(
StringUtils.equalsIgnoreCase("boolean", population.getPopulationBasis())
? 1.0
: 0));
// adding stratification for patient basis
if (population.getStratificationValues() != null) {
if (StringUtils.equalsIgnoreCase("boolean", population.getPopulationBasis())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public static List<MeasureReport.StratifierGroupPopulationComponent> buildStratu
MeasureReport.StratifierGroupPopulationComponent
stratifierGroupPopulationComponent =
new MeasureReport.StratifierGroupPopulationComponent();
String populationCode = populationValue.getName().toCode();
String populationDisplay = populationValue.getName().getDisplay();

stratifierGroupPopulationComponent.setId(populationValue.getId());
stratifierGroupPopulationComponent.setCode(
buildCodeableConcept(
populationCode, UriConstants.POPULATION_SYSTEM_URI, populationDisplay));
populationValue.getName().toCode(),
UriConstants.POPULATION_SYSTEM_URI,
populationValue.getName().getDisplay()));

stratifierGroupPopulationComponent.setCount(
isPatientBased
Expand Down

0 comments on commit 5c40754

Please sign in to comment.