From eb7bc5c51ce2b1a8847b62eb39322fb839a77fff Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Thu, 5 Mar 2026 17:27:42 +0000 Subject: [PATCH 1/2] fix(healthcare): set responseType to JSON instead of Buffer --- healthcare/fhir/deleteFhirResource.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/healthcare/fhir/deleteFhirResource.js b/healthcare/fhir/deleteFhirResource.js index 49a432aab2..52016b5df8 100644 --- a/healthcare/fhir/deleteFhirResource.js +++ b/healthcare/fhir/deleteFhirResource.js @@ -29,6 +29,7 @@ const main = ( auth: new google.auth.GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), + responseType: 'json', }); const deleteFhirResource = async () => { @@ -46,10 +47,14 @@ const main = ( // fails, the server returns a 200 OK HTTP status code. To check that the // resource was successfully deleted, search for or get the resource and // see if it exists. - await healthcare.projects.locations.datasets.fhirStores.fhir.delete( - request - ); - console.log('Deleted FHIR resource'); + try { + await healthcare.projects.locations.datasets.fhirStores.fhir.delete( + request + ); + console.log(`Deleted FHIR resource: ${resourceId}`); + } catch (error) { + console.error('Error deleting FHIR resource:', error.message || error); + } }; deleteFhirResource(); From c876688a5cac97227157954529aaf3b9494a37d7 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Thu, 5 Mar 2026 17:44:22 +0000 Subject: [PATCH 2/2] fix(healthcare): Fix test for delete resource --- healthcare/fhir/system-test/fhir_resources.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/healthcare/fhir/system-test/fhir_resources.test.js b/healthcare/fhir/system-test/fhir_resources.test.js index 61c09595fa..17769ff97b 100644 --- a/healthcare/fhir/system-test/fhir_resources.test.js +++ b/healthcare/fhir/system-test/fhir_resources.test.js @@ -181,7 +181,10 @@ it('should delete a FHIR resource', () => { `node deleteFhirResource.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, {cwd} ); - assert.strictEqual(new RegExp('Deleted FHIR resource').test(output), true); + assert.strictEqual( + new RegExp(`Deleted FHIR resource: ${resourceId}`).test(output), + true + ); // Clean up execSync(