From 6f59f31588eae9a6a443c439aa55a7e1a63ff9c8 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Tue, 3 Mar 2026 23:06:37 +0000 Subject: [PATCH 1/2] fix(healthcare): set responseType to JSON instead of Buffer --- healthcare/fhir/patchFhirResource.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/healthcare/fhir/patchFhirResource.js b/healthcare/fhir/patchFhirResource.js index 1d6d326997..df137ac38c 100644 --- a/healthcare/fhir/patchFhirResource.js +++ b/healthcare/fhir/patchFhirResource.js @@ -31,6 +31,7 @@ function main( scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), headers: {'Content-Type': 'application/json-patch+json'}, + responseType: 'json', }); async function patchFhirResource() { @@ -50,8 +51,19 @@ function main( requestBody: patchOptions, }; - await healthcare.projects.locations.datasets.fhirStores.fhir.patch(request); - console.log(`Patched ${resourceType} resource`); + try { + const resource = + await healthcare.projects.locations.datasets.fhirStores.fhir.patch( + request + ); + console.log(`Patched ${resourceType} resource`); + console.log(JSON.stringify(resource.data, null, 2)); + } catch (error) { + console.error( + `Error patching ${resourceType} resource:`, + error.message || error + ); + } } patchFhirResource(); From ff82f265e6f9f82abb2b059d9875165103aa199b Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Tue, 3 Mar 2026 23:14:55 +0000 Subject: [PATCH 2/2] fix(healthcare): fix header in patch sample --- healthcare/fhir/patchFhirResource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/healthcare/fhir/patchFhirResource.js b/healthcare/fhir/patchFhirResource.js index df137ac38c..2f5f9559be 100644 --- a/healthcare/fhir/patchFhirResource.js +++ b/healthcare/fhir/patchFhirResource.js @@ -1,5 +1,5 @@ /** - * Copyright 2020, Google, LLC + * Copyright 2020 Google LLC * Licensed under the Apache License, Version 2.0 (the `License`); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at