From 05e6984599f1de042c121fb4255470f40c33c390 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Tue, 24 Feb 2026 21:51:24 +0000 Subject: [PATCH 1/2] fix(healthcare): set responseType to JSON instead of Buffer --- healthcare/fhir/listFhirResourceHistory.js | 1 + 1 file changed, 1 insertion(+) diff --git a/healthcare/fhir/listFhirResourceHistory.js b/healthcare/fhir/listFhirResourceHistory.js index acee5552e0..a4a207b740 100644 --- a/healthcare/fhir/listFhirResourceHistory.js +++ b/healthcare/fhir/listFhirResourceHistory.js @@ -29,6 +29,7 @@ const main = ( auth: new google.auth.GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), + responseType: 'json', }); const listFhirResourceHistory = async () => { From c57740fc6b27c815e854364617b70959a45add08 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Thu, 26 Feb 2026 17:04:57 +0000 Subject: [PATCH 2/2] fix(healthcare): Add error handling to sample --- healthcare/fhir/listFhirResourceHistory.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/healthcare/fhir/listFhirResourceHistory.js b/healthcare/fhir/listFhirResourceHistory.js index a4a207b740..f71979d9f8 100644 --- a/healthcare/fhir/listFhirResourceHistory.js +++ b/healthcare/fhir/listFhirResourceHistory.js @@ -43,11 +43,18 @@ const main = ( const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir/${resourceType}/${resourceId}/_history`; const request = {name}; - const resource = - await healthcare.projects.locations.datasets.fhirStores.fhir.read( - request + try { + const resource = + await healthcare.projects.locations.datasets.fhirStores.fhir.read( + request + ); + console.log(JSON.stringify(resource.data, null, 2)); + } catch (error) { + console.error( + 'Error listing FHIR resource history:', + error.message || error ); - console.log(JSON.stringify(resource.data, null, 2)); + } }; listFhirResourceHistory();