Skip to content

Commit

Permalink
MAT-7362: fix calls to correctly use uri
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcphillips committed Jul 29, 2024
1 parent 6aea621 commit 125b80b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public List<QdmValueSet> recursivelyRequestAllValueSetsExpansionsForQDM(
valueSetsSearchCriteria.getProfile(),
valueSetsSearchCriteria.getIncludeDraft(),
valueSetsSearchCriteria.getManifestExpansion());
ValueSet ValueSetResource = parser.parseResource(ValueSet.class, resource);

var total = ValueSetResource.getExpansion().getTotal(); // total valuesets
ValueSet valueSetResource = parser.parseResource(ValueSet.class, resource);
var total = valueSetResource.getExpansion().getTotal(); // total valuesets

List<QdmValueSet.Concept> concepts =
getValueSetConcepts(ValueSetResource, codeSystemEntries, "QDM");
getValueSetConcepts(valueSetResource, codeSystemEntries, "QDM");
log.info("vs total [{}] count: [{}] offset: [{}], oid: [{}]", total, vsParam.getCount(), vsParam.getOffset(), vsParam.getOid());

// Check if the ValueSet with the same oid already exists in allValueSets
Expand All @@ -93,9 +93,9 @@ public List<QdmValueSet> recursivelyRequestAllValueSetsExpansionsForQDM(
} else {
allValueSets.add(
QdmValueSet.builder()
.oid(ValueSetResource.getIdPart())
.displayName(ValueSetResource.getName())
.version(ValueSetResource.getVersion())
.oid(valueSetResource.getIdPart())
.displayName(valueSetResource.getName())
.version(valueSetResource.getVersion())
.concepts(concepts)
.build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ public static URI buildValueSetResourceUri(
ManifestExpansion manifestExpansion) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
String expandValueSetUri = "/ValueSet/" + valueSetParams.getOid() + "/$expand";
if (valueSetParams.getOffset() >= 0) {
params.put("offset", List.of(String.valueOf(valueSetParams.getOffset())));
}
if (valueSetParams.getCount() >= 0) {
params.put("count", List.of(String.valueOf(valueSetParams.getCount())));
}
if (StringUtils.isNotBlank(valueSetParams.getVersion())) {
params.put("valueSetVersion", List.of(valueSetParams.getVersion()));
} else if (manifestExpansion != null
Expand All @@ -127,6 +133,7 @@ public static URI buildValueSetResourceUri(
} else if (StringUtils.isNotBlank(includeDraft)) {
params.put("includeDraft", List.of("true"));
}

return UriComponentsBuilder.fromPath(expandValueSetUri).queryParams(params).build().toUri();
}

Expand Down

0 comments on commit 125b80b

Please sign in to comment.