Skip to content

Commit

Permalink
Merge pull request #258 from MeasureAuthoringTool/MAT-7830/removingFe…
Browse files Browse the repository at this point in the history
…atureFlagCode

MAT-7830 removed feature flag redundant code
  • Loading branch information
sb-prateekkeerthi authored Nov 8, 2024
2 parents 267728e + ae1b1c9 commit 2265895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import gov.cms.madie.madiefhirservice.dto.MadieFeatureFlag;
import gov.cms.madie.madiefhirservice.constants.IdentifierType;
import gov.cms.madie.madiefhirservice.utils.FhirResourceHelpers;
import gov.cms.madie.models.common.Organization;
Expand Down Expand Up @@ -388,12 +387,6 @@ private List<MeasureGroupStratifierComponent> buildStratifications(Group madieGr
.map(
strat -> {
List<PopulationType> associations = strat.getAssociations();
if (!appConfigService.isFlagEnabled(MadieFeatureFlag.QiCore_STU4_UPDATES)) {
associations = new ArrayList<>();
if (strat.getAssociation() != null) {
associations.add(strat.getAssociation());
}
}
MeasureGroupStratifierComponent stratComponent = null;
if (CollectionUtils.isNotEmpty(associations)) {
List<Extension> extensionList =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.when;

import com.fasterxml.jackson.core.JsonProcessingException;
import gov.cms.madie.madiefhirservice.constants.UriConstants;
import gov.cms.madie.madiefhirservice.dto.MadieFeatureFlag;
import gov.cms.madie.madiefhirservice.utils.FhirResourceHelpers;
import gov.cms.madie.madiefhirservice.utils.MeasureTestHelper;
import gov.cms.madie.madiefhirservice.utils.ResourceFileUtil;
Expand Down Expand Up @@ -771,11 +769,13 @@ public void testBuildFhirPopulationGroupsWithStratifications() {
Stratification strat1 = new Stratification();
strat1.setId("testStrat1Id");
strat1.setDescription("strat-description");
strat1.setAssociation(PopulationType.INITIAL_POPULATION);
strat1.setAssociations(
List.of(PopulationType.INITIAL_POPULATION, PopulationType.MEASURE_POPULATION));
stratifications.add(strat1);
Stratification strat2 = new Stratification();
strat2.setDescription("strat-description");
strat2.setAssociation(PopulationType.MEASURE_POPULATION);
strat1.setAssociations(
List.of(PopulationType.INITIAL_POPULATION, PopulationType.MEASURE_POPULATION));
stratifications.add(strat2);
group.setStratifications(stratifications);
List<Group> groups = new ArrayList<>();
Expand All @@ -795,12 +795,9 @@ public void testBuildFhirPopulationGroupsWithStratifications() {
assertThat(measureGroupStratifierComponent.getDescription(), is(equalTo("strat-description")));
Expression expression = measureGroupStratifierComponent.getCriteria();
assertThat(expression, is(notNullValue()));
assertThat(
measureGroupStratifierComponent.getExtensionByUrl(UriConstants.CqfMeasures.APPLIES_TO_URI),
is(notNullValue()));
Extension appliesToExt =
measureGroupStratifierComponent.getExtensionByUrl(UriConstants.CqfMeasures.APPLIES_TO_URI);
Type value = appliesToExt.getValue();
List<Extension> appliesToExt = measureGroupStratifierComponent.getExtension();
assertThat(appliesToExt.size(), is(2));
Type value = appliesToExt.get(0).getValue();
CodeableConcept codeableConcept = value.castToCodeableConcept(value);
assertThat(codeableConcept.getCoding(), is(notNullValue()));
assertThat(codeableConcept.getCoding().size(), is(equalTo(1)));
Expand All @@ -815,7 +812,6 @@ public void testBuildFhirPopulationGroupsWithStratifications() {

@Test
public void testBuildFhirPopulationGroupsWithStratificationsOfMultipleAssociations() {
when(appConfigService.isFlagEnabled(MadieFeatureFlag.QiCore_STU4_UPDATES)).thenReturn(true);

Population ip1 = new Population();
ip1.setName(PopulationType.INITIAL_POPULATION);
Expand Down Expand Up @@ -886,7 +882,6 @@ public void testBuildFhirPopulationGroupsWithStratificationsOfMultipleAssociatio

@Test
public void testBuildFhirPopulationGroupsWithStratificationsOfNoAssociations() {
when(appConfigService.isFlagEnabled(MadieFeatureFlag.QiCore_STU4_UPDATES)).thenReturn(false);

Population ip1 = new Population();
ip1.setName(PopulationType.INITIAL_POPULATION);
Expand Down

0 comments on commit 2265895

Please sign in to comment.