From 6aea6215a984ee81e3700508fbb4a2a728e536b7 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Fri, 26 Jul 2024 11:28:45 -0700 Subject: [PATCH] MAT-7362-fix --- .../terminology/service/FhirTerminologyService.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/gov/cms/madie/terminology/service/FhirTerminologyService.java b/src/main/java/gov/cms/madie/terminology/service/FhirTerminologyService.java index 9dd54fb..0ecaeb4 100644 --- a/src/main/java/gov/cms/madie/terminology/service/FhirTerminologyService.java +++ b/src/main/java/gov/cms/madie/terminology/service/FhirTerminologyService.java @@ -19,11 +19,8 @@ import org.springframework.web.util.UriComponentsBuilder; import java.time.Instant; +import java.util.*; import java.util.stream.Collectors; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; @Service @Slf4j @@ -107,7 +104,7 @@ public List recursivelyRequestAllValueSetsExpansionsForQDM( // of our last request, then we request again if (vsParam.getOffset() + vsParam.getCount() <= total) { vsParam.setOffset(vsParam.getOffset() + 1000); - recursivelyRequestAllValueSetsExpansionsForQDM( + return recursivelyRequestAllValueSetsExpansionsForQDM( allValueSets, apiKey, vsParam, valueSetsSearchCriteria, codeSystemEntries); } return allValueSets; @@ -116,7 +113,6 @@ public List recursivelyRequestAllValueSetsExpansionsForQDM( public List getValueSetsExpansionsForQdm( ValueSetsSearchCriteria valueSetsSearchCriteria, UmlsUser umlsUser) { List codeSystemEntries = mappingService.getCodeSystemEntries(); - List allValueSets = new ArrayList<>(); // going to build all values here. return valueSetsSearchCriteria.getValueSetParams().stream() .map( vsParam -> { @@ -127,7 +123,7 @@ public List getValueSetsExpansionsForQdm( .flatMap( vsParam -> recursivelyRequestAllValueSetsExpansionsForQDM( - allValueSets, + new ArrayList<>(), umlsUser.getApiKey(), vsParam, valueSetsSearchCriteria,