From ec5e67c684863b91de312d83a10c4a0c1d44ff0c Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Fri, 27 Feb 2026 21:46:59 +0000 Subject: [PATCH 1/2] fix(healthcare): set responseType to JSON instead of Buffer --- healthcare/fhir/getPatientEverything.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/healthcare/fhir/getPatientEverything.js b/healthcare/fhir/getPatientEverything.js index 417fc8312d..4910f74e7f 100644 --- a/healthcare/fhir/getPatientEverything.js +++ b/healthcare/fhir/getPatientEverything.js @@ -28,6 +28,7 @@ const main = ( auth: new google.auth.GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), + responseType: 'json', }); const getPatientEverything = async () => { @@ -40,14 +41,18 @@ const main = ( const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir/Patient/${patientId}`; const request = {name}; - const patientEverything = - await healthcare.projects.locations.datasets.fhirStores.fhir.PatientEverything( - request + try { + const patientEverything = + await healthcare.projects.locations.datasets.fhirStores.fhir.PatientEverything( + request + ); + console.log( + `Got all resources in patient ${patientId} compartment:\n`, + JSON.stringify(patientEverything) ); - console.log( - `Got all resources in patient ${patientId} compartment:\n`, - JSON.stringify(patientEverything) - ); + } catch (error) { + console.error('Error getting patient:', error.message || error); + } }; getPatientEverything(); From 5c3ddc4205866ea6252839e30d3e3197538f0bec Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Tue, 3 Mar 2026 17:38:28 +0000 Subject: [PATCH 2/2] fix(healthcare): improve readability of patient everything response with JSON formatting --- healthcare/fhir/getPatientEverything.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/healthcare/fhir/getPatientEverything.js b/healthcare/fhir/getPatientEverything.js index 4910f74e7f..ad4c760926 100644 --- a/healthcare/fhir/getPatientEverything.js +++ b/healthcare/fhir/getPatientEverything.js @@ -48,7 +48,7 @@ const main = ( ); console.log( `Got all resources in patient ${patientId} compartment:\n`, - JSON.stringify(patientEverything) + JSON.stringify(patientEverything.data, null, 2) ); } catch (error) { console.error('Error getting patient:', error.message || error);