Skip to content
Merged
2 changes: 1 addition & 1 deletion healthcare/datasets/createDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const main = (
) => {
// [START healthcare_create_dataset]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const createDataset = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/deidentifyDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_dicom_keeplist_deidentify_dataset]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const deidentifyDataset = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/deleteDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const main = (
) => {
// [START healthcare_delete_dataset]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const deleteDataset = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/getDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const main = (
) => {
// [START healthcare_get_dataset]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const getDataset = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/getDatasetIamPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const main = (
) => {
// [START healthcare_dataset_get_iam_policy]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const getDatasetIamPolicy = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/listDatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const main = (
) => {
// [START healthcare_list_datasets]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const listDatasets = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"mocha": "^7.0.0"
},
"dependencies": {
"googleapis": "^48.0.0",
"googleapis": "^49.0.0",
"uuid": "^7.0.0",
"yargs": "^15.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/patchDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_patch_dataset]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const patchDataset = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/datasets/setDatasetIamPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_dataset_set_iam_policy]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const setDatasetIamPolicy = async () => {
const auth = await google.auth.getClient({
Expand Down
32 changes: 10 additions & 22 deletions healthcare/datasets/system-test/datasets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const assert = require('assert');
const uuid = require('uuid');
const {execSync} = require('child_process');

const cwd = path.join(__dirname, '..');
const projectId = process.env.GCLOUD_PROJECT;
const datasetId = `dataset-${uuid.v4()}`.replace(/-/gi, '_');
const destinationDatasetId = `destination-${uuid.v4()}`.replace(/-/gi, '_');
Expand All @@ -39,25 +38,22 @@ before(() => {
after(() => {
try {
execSync(
`node deleteDataset.js ${projectId} ${cloudRegion} ${destinationDatasetId}`,
cwd
`node deleteDataset.js ${projectId} ${cloudRegion} ${destinationDatasetId}`
);
// eslint-disable-next-line no-empty
} catch (err) {} // Ignore error
});

it('should create a dataset', () => {
const output = execSync(
`node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`,
cwd
`node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`
);
assert.strictEqual(output, `Created dataset: ${datasetId}`);
assert.ok(output.includes('Created dataset'));
});

it('should get a dataset', () => {
const output = execSync(
`node getDataset.js ${projectId} ${cloudRegion} ${datasetId}`,
cwd
);
assert.ok(output.includes('name'));
});
Expand All @@ -66,30 +62,24 @@ it('should patch a dataset', () => {
const timeZone = 'GMT';
const output = execSync(
`node patchDataset.js ${projectId} ${cloudRegion} ${datasetId} ${timeZone}`,
cwd
);
assert.strictEqual(
output,
`Dataset ${datasetId} patched with time zone ${timeZone}`
assert.ok(
output.includes('patched with time zone')
);
});

it('should list datasets', () => {
const output = execSync(
`node listDatasets.js ${projectId} ${cloudRegion}`,
cwd
);
const output = execSync(`node listDatasets.js ${projectId} ${cloudRegion}`, {
});
assert.ok(output.includes('datasets'));
});

it('should de-identify data in a dataset and write to a new dataset', () => {
const output = execSync(
`node deidentifyDataset.js ${projectId} ${cloudRegion} ${datasetId} ${destinationDatasetId} ${keeplistTags}`,
cwd
);
assert.strictEqual(
output,
`De-identified data written from dataset ${datasetId} to dataset ${destinationDatasetId}`
assert.ok(
output.includes('De-identified data written')
);
});

Expand All @@ -99,7 +89,6 @@ it('should create and get a dataset IAM policy', () => {

let output = execSync(
`node setDatasetIamPolicy.js ${projectId} ${cloudRegion} ${datasetId} ${localMember} ${localRole}`,
cwd
);
assert.ok(output.includes, 'ETAG');

Expand All @@ -112,7 +101,6 @@ it('should create and get a dataset IAM policy', () => {
it('should delete a dataset', () => {
const output = execSync(
`node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`,
cwd
);
assert.strictEqual(output, `Deleted dataset: ${datasetId}`);
assert.ok(output.includes('Deleted dataset'));
});
2 changes: 1 addition & 1 deletion healthcare/dicom/createDicomStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_create_dicom_store]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const createDicomStore = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/deleteDicomStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_delete_dicom_store]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const deleteDicomStore = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebDeleteStudy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_dicomweb_delete_study]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const dicomWebDeleteStudy = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebRetrieveInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const main = (
) => {
// [START healthcare_dicomweb_retrieve_instance]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');
const fs = require('fs');
const util = require('util');
const writeFile = util.promisify(fs.writeFile);
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebRetrieveRendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const main = (
) => {
// [START healthcare_dicomweb_retrieve_rendered]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');
const fs = require('fs');
const util = require('util');
const writeFile = util.promisify(fs.writeFile);
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebRetrieveStudy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_dicomweb_retrieve_study]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');
const fs = require('fs');
const util = require('util');
const writeFile = util.promisify(fs.writeFile);
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebSearchForInstances.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_dicomweb_search_instances]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const dicomWebSearchForInstances = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebSearchStudies.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_dicomweb_search_studies]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const dicomWebSearchStudies = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/dicomWebStoreInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_dicomweb_store_instance]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');
const fs = require('fs');
const binaryData = fs.createReadStream(dcmFile);

Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/exportDicomInstanceGcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_export_dicom_instance_gcs]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const exportDicomInstanceGcs = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/getDicomStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_get_dicom_store]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const getDicomStore = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/getDicomStoreIamPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const main = (
) => {
// [START healthcare_dicom_store_get_iam_policy]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const getDicomStoreIamPolicy = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/importDicomInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_import_dicom_instance]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');
const sleep = require('../sleep');

const importDicomInstance = async () => {
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/listDicomStores.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const main = (
) => {
// [START healthcare_list_dicom_stores]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const listDicomStores = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/patchDicomStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = (
) => {
// [START healthcare_patch_dicom_store]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const patchDicomStore = async () => {
const auth = await google.auth.getClient({
Expand Down
2 changes: 1 addition & 1 deletion healthcare/dicom/setDicomStoreIamPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const main = (
) => {
// [START healthcare_dicom_store_set_iam_policy]
const {google} = require('googleapis');
const healthcare = google.healthcare('v1beta1');
const healthcare = google.healthcare('v1');

const setDicomStoreIamPolicy = async () => {
const auth = await google.auth.getClient({
Expand Down
Loading