Skip to content

Commit

Permalink
Merge branch 'develop' into snyk-fix-b63f3e3b39a97955ce7b8bedc26146df
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitKandimalla authored Sep 22, 2023
2 parents a4eb191 + ac39553 commit 5bc1e93
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;
import java.util.stream.Collectors;

import org.apache.commons.collections4.CollectionUtils;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
Expand Down Expand Up @@ -197,10 +198,14 @@ private void sortParameters(
madieMeasure.getGroups().stream()
.forEach(
(g) ->
strats.addAll(
g.getStratifications().stream()
.map(s -> s.getCqlDefinition())
.collect(Collectors.toList())));
{
if (CollectionUtils.isNotEmpty(g.getStratifications())) {
strats.addAll(
g.getStratifications().stream()
.map(s -> s.getCqlDefinition())
.collect(Collectors.toList()));
}
});
}

Collections.sort(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
import gov.cms.madie.madiefhirservice.utils.ResourceFileUtil;
import gov.cms.madie.madiefhirservice.utils.ResourceUtils;
import gov.cms.madie.models.common.Version;
import gov.cms.madie.models.measure.Group;
import gov.cms.madie.models.measure.Measure;
import gov.cms.madie.models.measure.MeasureGroupTypes;
import gov.cms.madie.models.measure.MeasureMetaData;
import gov.cms.madie.models.measure.MeasureScoring;
import gov.cms.madie.models.measure.Population;
import gov.cms.madie.models.measure.PopulationType;
import org.hl7.fhir.MeasureGroup;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.Attachment;
import org.hl7.fhir.r4.model.Bundle;
Expand All @@ -24,6 +30,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

import java.util.Date;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -53,6 +60,22 @@ class HumanReadableServiceTest implements ResourceFileUtil {

@BeforeEach
void setUp() {
Group measureGroup1 = Group.builder()
.id("GroupId1")
.groupDescription("some random group")
.measureGroupTypes(List.of(MeasureGroupTypes.OUTCOME))
.scoring(MeasureScoring.COHORT.toString())
.populations(List.of(
Population.builder()
.id("PopId1")
.name(PopulationType.INITIAL_POPULATION)
.definition("Initial Population")
.description(null)
.build()
))
.build();
measureGroup1.setStratifications(null);

madieMeasure =
Measure.builder()
.id("madie-test-id")
Expand All @@ -67,6 +90,7 @@ void setUp() {
.copyright("test_copyright")
.disclaimer("test_disclaimer")
.build())
.groups(List.of(measureGroup1))
.build();

measure =
Expand Down

0 comments on commit 5bc1e93

Please sign in to comment.