Skip to content

Commit 6072032

Browse files
committed
Merge remote-tracking branch 'mi-fork/fix-fhir-delete-resource' into feat/fhir-batch-1-resources
2 parents eddf329 + c876688 commit 6072032

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

healthcare/fhir/deleteFhirResource.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const main = (
2929
auth: new google.auth.GoogleAuth({
3030
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3131
}),
32+
responseType: 'json',
3233
});
3334

3435
const deleteFhirResource = async () => {
@@ -46,10 +47,14 @@ const main = (
4647
// fails, the server returns a 200 OK HTTP status code. To check that the
4748
// resource was successfully deleted, search for or get the resource and
4849
// see if it exists.
49-
await healthcare.projects.locations.datasets.fhirStores.fhir.delete(
50-
request
51-
);
52-
console.log('Deleted FHIR resource');
50+
try {
51+
await healthcare.projects.locations.datasets.fhirStores.fhir.delete(
52+
request
53+
);
54+
console.log(`Deleted FHIR resource: ${resourceId}`);
55+
} catch (error) {
56+
console.error('Error deleting FHIR resource:', error.message || error);
57+
}
5358
};
5459

5560
deleteFhirResource();

healthcare/fhir/system-test/fhir_resources.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ it('should delete a FHIR resource', () => {
181181
`node deleteFhirResource.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`,
182182
{cwd}
183183
);
184-
assert.strictEqual(new RegExp('Deleted FHIR resource').test(output), true);
184+
assert.strictEqual(
185+
new RegExp(`Deleted FHIR resource: ${resourceId}`).test(output),
186+
true
187+
);
185188

186189
// Clean up
187190
execSync(

0 commit comments

Comments
 (0)