Skip to content

Commit 51fa090

Browse files
authored
healthcare API: fix path for FhirResourceGetHistory and make output d… (#2857)
* healthcare API: fix path for FhirResourceGetHistory and make output description clearer * fix number of args, fix test for new expected output * Fix failing lint test
1 parent 3fb8428 commit 51fa090

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

healthcare/v1/src/main/java/snippets/healthcare/fhir/resources/FhirResourceGetHistory.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@
3737
import org.apache.http.impl.client.HttpClients;
3838

3939
public class FhirResourceGetHistory {
40-
private static final String FHIR_NAME = "projects/%s/locations/%s/datasets/%s/fhirStores/%s";
40+
private static final String FHIR_NAME =
41+
"projects/%s/locations/%s/datasets/%s/fhirStores/%s/fhir/%s/%s";
4142
private static final JsonFactory JSON_FACTORY = new JacksonFactory();
4243
private static final NetHttpTransport HTTP_TRANSPORT = new NetHttpTransport();
4344

4445
public static void fhirResourceGetHistory(String resourceName, String versionId)
4546
throws IOException, URISyntaxException {
4647
// String resourceName =
4748
// String.format(
48-
// FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id", "fhir-id");
49+
// FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id", "resource-type",
50+
// "resource-id");
4951
// String versionId = "version-uuid"
5052

5153
// Initialize the client, which will be used to interact with the service.
@@ -74,7 +76,7 @@ public static void fhirResourceGetHistory(String resourceName, String versionId)
7476
responseEntity.writeTo(System.err);
7577
throw new RuntimeException();
7678
}
77-
System.out.println("FHIR resource history list retrieved: ");
79+
System.out.println("FHIR resource retrieved from version: ");
7880
responseEntity.writeTo(System.out);
7981
}
8082

healthcare/v1/src/test/java/snippets/healthcare/FhirResourceTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void test_FhirResourceGetHistory() throws Exception {
216216
FhirResourceGetHistory.fhirResourceGetHistory(fhirResourceName, versionId);
217217

218218
String output = bout.toString();
219-
assertThat(output, containsString("FHIR resource history list retrieved:"));
219+
assertThat(output, containsString("FHIR resource retrieved from version:"));
220220
}
221221

222222
@Test

0 commit comments

Comments
 (0)