From 2b4513070fa2776730ace0484ff568c583a362e1 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Mon, 23 Feb 2026 23:00:09 +0000 Subject: [PATCH 1/2] fix(healthcare): set responseType to JSON instead of Buffer --- healthcare/fhir/getFhirResourceHistory.js | 1 + 1 file changed, 1 insertion(+) diff --git a/healthcare/fhir/getFhirResourceHistory.js b/healthcare/fhir/getFhirResourceHistory.js index 8dd56d6997..8a16badaf3 100644 --- a/healthcare/fhir/getFhirResourceHistory.js +++ b/healthcare/fhir/getFhirResourceHistory.js @@ -30,6 +30,7 @@ const main = ( auth: new google.auth.GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), + responseType: 'json', }); const getFhirResourceHistory = async () => { From c6d36d817d9fc3e9449b4fc8bd160e7921b7eead Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Thu, 26 Feb 2026 16:48:51 +0000 Subject: [PATCH 2/2] fix(healthcare): Add error handling to sample --- healthcare/fhir/getFhirResourceHistory.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/healthcare/fhir/getFhirResourceHistory.js b/healthcare/fhir/getFhirResourceHistory.js index 8a16badaf3..d91d6d026d 100644 --- a/healthcare/fhir/getFhirResourceHistory.js +++ b/healthcare/fhir/getFhirResourceHistory.js @@ -45,11 +45,18 @@ const main = ( const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir/${resourceType}/${resourceId}/_history/${versionId}`; const request = {name}; - const resource = - await healthcare.projects.locations.datasets.fhirStores.fhir.vread( - request + try { + const resource = + await healthcare.projects.locations.datasets.fhirStores.fhir.vread( + request + ); + console.log(JSON.stringify(resource.data, null, 2)); + } catch (error) { + console.error( + 'Error getting FHIR resource history:', + error.message || error ); - console.log(JSON.stringify(resource.data, null, 2)); + } }; getFhirResourceHistory();