diff --git a/healthcare/fhir/createFhirStore.js b/healthcare/fhir/createFhirStore.js index 696f32fcf5..b1e95b2731 100644 --- a/healthcare/fhir/createFhirStore.js +++ b/healthcare/fhir/createFhirStore.js @@ -24,7 +24,7 @@ const main = ( ) => { // [START healthcare_create_fhir_store] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const createFhirStore = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/deleteFhirResource.js b/healthcare/fhir/deleteFhirResource.js index 3cb120718a..f19d1f2771 100644 --- a/healthcare/fhir/deleteFhirResource.js +++ b/healthcare/fhir/deleteFhirResource.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_delete_resource] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const deleteFhirResource = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/deleteFhirResourcePurge.js b/healthcare/fhir/deleteFhirResourcePurge.js index ae0603c259..5d58c632e3 100644 --- a/healthcare/fhir/deleteFhirResourcePurge.js +++ b/healthcare/fhir/deleteFhirResourcePurge.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_delete_resource_purge] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const deleteFhirResourcePurge = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/deleteFhirStore.js b/healthcare/fhir/deleteFhirStore.js index be4a561115..c9c98346d5 100644 --- a/healthcare/fhir/deleteFhirStore.js +++ b/healthcare/fhir/deleteFhirStore.js @@ -24,7 +24,7 @@ const main = ( ) => { // [START healthcare_delete_fhir_store] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const deleteFhirStore = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/exportFhirResources.js b/healthcare/fhir/exportFhirResources.js index 28f258cce0..917065b0b5 100644 --- a/healthcare/fhir/exportFhirResources.js +++ b/healthcare/fhir/exportFhirResources.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_export_fhir_resources_gcs] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const sleep = require('../sleep'); const exportFhirResourcesGcs = async () => { diff --git a/healthcare/fhir/fhir_resources.js b/healthcare/fhir/fhir_resources.js index b5e22c2a69..8d809e0768 100644 --- a/healthcare/fhir/fhir_resources.js +++ b/healthcare/fhir/fhir_resources.js @@ -15,7 +15,7 @@ const {GoogleToken} = require('gtoken'); const request = require('request-promise'); -const BASE_URL = 'https://healthcare.googleapis.com/v1beta1'; +const BASE_URL = 'https://healthcare.googleapis.com/v1'; // [START healthcare_get_token] const getToken = (serviceAccountJson, cb) => { diff --git a/healthcare/fhir/getFhirResource.js b/healthcare/fhir/getFhirResource.js index ff6925c786..8b37e2d42c 100644 --- a/healthcare/fhir/getFhirResource.js +++ b/healthcare/fhir/getFhirResource.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_get_resource] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getFhirResource = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/getFhirResourceHistory.js b/healthcare/fhir/getFhirResourceHistory.js index a0b3741277..1a2d6f11e6 100644 --- a/healthcare/fhir/getFhirResourceHistory.js +++ b/healthcare/fhir/getFhirResourceHistory.js @@ -27,7 +27,7 @@ const main = ( ) => { // [START healthcare_get_resource_history] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getFhirResourceHistory = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/getFhirStore.js b/healthcare/fhir/getFhirStore.js index 6d4f13ab53..716f49d718 100644 --- a/healthcare/fhir/getFhirStore.js +++ b/healthcare/fhir/getFhirStore.js @@ -24,7 +24,7 @@ const main = ( ) => { // [START healthcare_get_fhir_store] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getFhirStore = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/getFhirStoreCapabilities.js b/healthcare/fhir/getFhirStoreCapabilities.js index 83305828e5..6f0b4b6c42 100644 --- a/healthcare/fhir/getFhirStoreCapabilities.js +++ b/healthcare/fhir/getFhirStoreCapabilities.js @@ -24,7 +24,7 @@ const main = ( ) => { // [START healthcare_get_metadata] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getFhirStoreCapabilities = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/getFhirStoreIamPolicy.js b/healthcare/fhir/getFhirStoreIamPolicy.js index b6a0cda6f9..d3b92fcec4 100644 --- a/healthcare/fhir/getFhirStoreIamPolicy.js +++ b/healthcare/fhir/getFhirStoreIamPolicy.js @@ -24,7 +24,7 @@ const main = ( ) => { // [START healthcare_fhir_store_get_iam_policy] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getFhirStoreIamPolicy = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/getPatientEverything.js b/healthcare/fhir/getPatientEverything.js index bd11b8c08f..da2ed38a61 100644 --- a/healthcare/fhir/getPatientEverything.js +++ b/healthcare/fhir/getPatientEverything.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_get_patient_everything] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const getPatientEverything = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/importFhirResources.js b/healthcare/fhir/importFhirResources.js index 4bd01d79fd..46da3d2452 100644 --- a/healthcare/fhir/importFhirResources.js +++ b/healthcare/fhir/importFhirResources.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_import_fhir_resources] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const sleep = require('../sleep'); const importFhirResources = async () => { diff --git a/healthcare/fhir/listFhirResourceHistory.js b/healthcare/fhir/listFhirResourceHistory.js index d07019a403..1f652d205c 100644 --- a/healthcare/fhir/listFhirResourceHistory.js +++ b/healthcare/fhir/listFhirResourceHistory.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_list_resource_history] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const listFhirResourceHistory = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/listFhirStores.js b/healthcare/fhir/listFhirStores.js index 58414cba0a..6a813ffb0d 100644 --- a/healthcare/fhir/listFhirStores.js +++ b/healthcare/fhir/listFhirStores.js @@ -23,7 +23,7 @@ const main = ( ) => { // [START healthcare_list_fhir_stores] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const listFhirStores = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/package.json b/healthcare/fhir/package.json index c69b010cc2..5941430f7e 100644 --- a/healthcare/fhir/package.json +++ b/healthcare/fhir/package.json @@ -17,7 +17,7 @@ "mocha": "^7.0.0" }, "dependencies": { - "googleapis": "^48.0.0", + "googleapis": "^49.0.0", "uuid": "^7.0.0", "yargs": "^15.0.0", "gtoken": "^5.0.0", diff --git a/healthcare/fhir/patchFhirStore.js b/healthcare/fhir/patchFhirStore.js index cd5757d945..a6a05291f4 100644 --- a/healthcare/fhir/patchFhirStore.js +++ b/healthcare/fhir/patchFhirStore.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_patch_fhir_store] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const patchFhirStore = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/searchFhirResourcesGet.js b/healthcare/fhir/searchFhirResourcesGet.js index 32b6b14c4c..4eeaebde37 100644 --- a/healthcare/fhir/searchFhirResourcesGet.js +++ b/healthcare/fhir/searchFhirResourcesGet.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_search_resources_get] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const searchFhirResourcesGet = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/searchFhirResourcesPost.js b/healthcare/fhir/searchFhirResourcesPost.js index 5536dcade8..9a6edb0745 100644 --- a/healthcare/fhir/searchFhirResourcesPost.js +++ b/healthcare/fhir/searchFhirResourcesPost.js @@ -25,7 +25,7 @@ const main = ( ) => { // [START healthcare_search_resources_post] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const searchFhirResourcesPost = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/setFhirStoreIamPolicy.js b/healthcare/fhir/setFhirStoreIamPolicy.js index ab1c9c3ea4..5ad781cc1f 100644 --- a/healthcare/fhir/setFhirStoreIamPolicy.js +++ b/healthcare/fhir/setFhirStoreIamPolicy.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_fhir_store_set_iam_policy] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const setFhirStoreIamPolicy = async () => { const auth = await google.auth.getClient({ diff --git a/healthcare/fhir/system-test/fhir_resources.test.js b/healthcare/fhir/system-test/fhir_resources.test.js index 2759d95d5d..408db079ff 100644 --- a/healthcare/fhir/system-test/fhir_resources.test.js +++ b/healthcare/fhir/system-test/fhir_resources.test.js @@ -45,14 +45,14 @@ before(() => { ); execSync( `node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets + {cwd: cwdDatasets} ); }); after(() => { try { execSync( `node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets + {cwd: cwdDatasets} ); } catch (err) {} // Ignore error }); @@ -60,11 +60,11 @@ after(() => { it('should create a FHIR resource', () => { execSync( `node createFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId}`, - cwd + {cwd} ); const output = execSync( `node fhir_resources.js createResource ${datasetId} ${fhirStoreId} ${resourceType}`, - cwd + {cwd} ); const createdResource = new RegExp( `Created FHIR resource ${resourceType} with ID (.*).` @@ -76,7 +76,7 @@ it('should create a FHIR resource', () => { it('should get a FHIR resource', () => { const output = execSync( `node getFhirResource.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual( new RegExp(`Got ${resourceType} resource`).test(output), @@ -87,7 +87,7 @@ it('should get a FHIR resource', () => { it('should list and get a FHIR resource history', () => { let output = execSync( `node listFhirResourceHistory.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.ok(output.includes('versionId')); @@ -105,7 +105,7 @@ it('should list and get a FHIR resource history', () => { output = execSync( `node getFhirResourceHistory.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId} ${versionId}`, - cwd + {cwd} ); assert.ok(output.includes(versionId)); }); @@ -113,7 +113,7 @@ it('should list and get a FHIR resource history', () => { it('should get everything in Patient compartment', () => { const output = execSync( `node getPatientEverything.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual( new RegExp(`Got all resources in patient ${resourceId} compartment`).test( @@ -126,7 +126,7 @@ it('should get everything in Patient compartment', () => { it('should update a FHIR resource', () => { const output = execSync( `node updateFhirResource.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual( new RegExp(`Updated ${resourceType} resource`).test(output), @@ -137,7 +137,7 @@ it('should update a FHIR resource', () => { it('should patch a FHIR resource', () => { const output = execSync( `node fhir_resources.js patchResource ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual(output, `Patched ${resourceType} resource`); }); @@ -159,7 +159,7 @@ it('should search for FHIR resources using POST', () => { it('should purge all historical versions of a FHIR resource', () => { const output = execSync( `node deleteFhirResourcePurge.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual( output, @@ -170,7 +170,7 @@ it('should purge all historical versions of a FHIR resource', () => { it('should execute a Bundle', () => { const output = execSync( `node fhir_resources.js executeBundle ${datasetId} ${fhirStoreId} ${bundleFile}`, - cwd + {cwd} ); assert.strictEqual(new RegExp('Executed Bundle').test(output), true); }); @@ -178,13 +178,13 @@ it('should execute a Bundle', () => { it('should delete a FHIR resource', () => { const output = execSync( `node deleteFhirResource.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${resourceType} ${resourceId}`, - cwd + {cwd} ); assert.strictEqual(output, `Deleted FHIR resource ${resourceType}`); // Clean up execSync( `node deleteFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId}`, - cwd + {cwd} ); }); diff --git a/healthcare/fhir/system-test/fhir_stores.test.js b/healthcare/fhir/system-test/fhir_stores.test.js index a9c095caa0..af9102372c 100644 --- a/healthcare/fhir/system-test/fhir_stores.test.js +++ b/healthcare/fhir/system-test/fhir_stores.test.js @@ -62,7 +62,7 @@ before(async () => { console.log(`Topic ${topic.name} created.`); execSync( `node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets + {cwd: cwdDatasets} ); }); @@ -78,7 +78,7 @@ after(async () => { console.log(`Topic ${topicName} deleted.`); execSync( `node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets + {cwd: cwdDatasets} ); } catch (err) {} // Ignore error }); @@ -86,7 +86,7 @@ after(async () => { it('should create a FHIR store', () => { const output = execSync( `node createFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId}`, - cwd + {cwd} ); assert.ok(output.includes('Created FHIR store')); }); @@ -94,7 +94,7 @@ it('should create a FHIR store', () => { it('should get a FHIR store', () => { const output = execSync( `node getFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId}`, - cwd + {cwd} ); assert.ok(output.includes('name')); }); @@ -102,7 +102,7 @@ it('should get a FHIR store', () => { it('should list FHIR stores', () => { const output = execSync( `node listFhirStores.js ${projectId} ${cloudRegion} ${datasetId}`, - cwd + {cwd} ); assert.ok(output.includes('fhirStores')); }); @@ -110,7 +110,7 @@ it('should list FHIR stores', () => { it('should patch a FHIR store', () => { const output = execSync( `node patchFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${topicName}`, - cwd + {cwd} ); assert.ok(output.includes('Patched FHIR store')); }); @@ -118,7 +118,7 @@ it('should patch a FHIR store', () => { it('should import FHIR resources into a FHIR store from Cloud Storage', () => { const output = execSync( `node importFhirResources.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${gcsUri}`, - cwd + {cwd} ); assert.ok(output.includes('Import FHIR resources succeeded')); }); @@ -126,7 +126,7 @@ it('should import FHIR resources into a FHIR store from Cloud Storage', () => { it('should export FHIR resources from a FHIR store to Cloud Storage', () => { const output = execSync( `node exportFhirResources.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${gcsUri}`, - cwd + {cwd} ); assert.ok(output.includes('Exported FHIR resources successfully')); }); @@ -137,7 +137,7 @@ it('should create and get a FHIR store IAM policy', () => { let output = execSync( `node setFhirStoreIamPolicy.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId} ${localMember} ${localRole}`, - cwd + {cwd} ); assert.ok(output.includes, 'ETAG'); @@ -150,7 +150,7 @@ it('should create and get a FHIR store IAM policy', () => { it('should delete a FHIR store', () => { const output = execSync( `node deleteFhirStore.js ${projectId} ${cloudRegion} ${datasetId} ${fhirStoreId}`, - cwd + {cwd} ); assert.ok(output.includes('Deleted FHIR store')); }); diff --git a/healthcare/fhir/updateFhirResource.js b/healthcare/fhir/updateFhirResource.js index 601f87b7cb..4df3ab66d5 100644 --- a/healthcare/fhir/updateFhirResource.js +++ b/healthcare/fhir/updateFhirResource.js @@ -26,7 +26,7 @@ const main = ( ) => { // [START healthcare_update_resource] const {google} = require('googleapis'); - const healthcare = google.healthcare('v1beta1'); + const healthcare = google.healthcare('v1'); const updateFhirResource = async () => { const auth = await google.auth.getClient({