Skip to content

Commit

Permalink
MAT-7362-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcphillips committed Jul 26, 2024
1 parent d6ab8cf commit 6aea621
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -107,7 +104,7 @@ public List<QdmValueSet> 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;
Expand All @@ -116,7 +113,6 @@ public List<QdmValueSet> recursivelyRequestAllValueSetsExpansionsForQDM(
public List<QdmValueSet> getValueSetsExpansionsForQdm(
ValueSetsSearchCriteria valueSetsSearchCriteria, UmlsUser umlsUser) {
List<CodeSystemEntry> codeSystemEntries = mappingService.getCodeSystemEntries();
List<QdmValueSet> allValueSets = new ArrayList<>(); // going to build all values here.
return valueSetsSearchCriteria.getValueSetParams().stream()
.map(
vsParam -> {
Expand All @@ -127,7 +123,7 @@ public List<QdmValueSet> getValueSetsExpansionsForQdm(
.flatMap(
vsParam ->
recursivelyRequestAllValueSetsExpansionsForQDM(
allValueSets,
new ArrayList<>(),
umlsUser.getApiKey(),
vsParam,
valueSetsSearchCriteria,
Expand Down

0 comments on commit 6aea621

Please sign in to comment.