Skip to content

Commit

Permalink
Merge pull request #85 from MeasureAuthoringTool/feature/mat-7310-inc…
Browse files Browse the repository at this point in the history
…lude-drafts-with-latest

MAT-7310: Append includeDraft=true to FHIR Term requests when Latest is selected (manifest is null).
  • Loading branch information
jkotanchik-SB committed Jun 11, 2024
2 parents 37ff2ce + 07ec3da commit 7a283e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public static URI buildValueSetResourceUri(
} else if (manifestExpansion != null
&& StringUtils.isNotBlank(manifestExpansion.getFullUrl())) {
params.put("manifest", List.of(manifestExpansion.getFullUrl()));
} else if (StringUtils.isNotBlank(includeDraft)) {
params.put("includeDraft", List.of("true"));
}
return UriComponentsBuilder.fromPath(expandValueSetUri).queryParams(params).build().toUri();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ void getLatestValueSetResourceSuccessfully_when_noCustomSearchCriteriaIsProvided
assertEquals("/ValueSet/test-vs-id/$expand", recordedRequest.getPath());
}

@Test
void getDraftValueSetResourceSuccessfully_when_noCustomSearchCriteriaIsProvided()
throws InterruptedException {
mockBackEnd.enqueue(
new MockResponse()
.setResponseCode(200)
.setBody(MOCK_RESPONSE_STRING)
.addHeader("Content-Type", "application/fhir+json"));
String actualResponse =
fhirTerminologyServiceWebClient.getValueSetResource(
MOCK_API_KEY, testValueSetParams, null, "yes", new ManifestExpansion());
assertNotNull(actualResponse);
assertEquals(MOCK_RESPONSE_STRING, actualResponse);
RecordedRequest recordedRequest = mockBackEnd.takeRequest();
assertEquals("/ValueSet/test-vs-id/$expand?includeDraft=true", recordedRequest.getPath());
}

@Test
void getValueSetResourceSuccessfully_when_manifestExpansionIsProvided()
throws InterruptedException {
Expand Down

0 comments on commit 7a283e8

Please sign in to comment.