diff --git a/healthcare/hl7v2/listHl7v2Messages.js b/healthcare/hl7v2/listHl7v2Messages.js index b7f1840a16..dcb80115d4 100644 --- a/healthcare/hl7v2/listHl7v2Messages.js +++ b/healthcare/hl7v2/listHl7v2Messages.js @@ -43,7 +43,7 @@ const main = ( const response = await healthcare.projects.locations.datasets.hl7V2Stores.messages.list( request ); - const hl7v2Messages = response.data.messages; + const hl7v2Messages = response.data.hl7V2Messages; console.log(`HL7v2 messages: ${hl7v2Messages.length}`); for (const hl7v2Message of hl7v2Messages) { console.log(hl7v2Message); diff --git a/healthcare/hl7v2/system-test/hl7v2_messages.test.js b/healthcare/hl7v2/system-test/hl7v2_messages.test.js index bcd2f7c7dc..3b3983c0eb 100644 --- a/healthcare/hl7v2/system-test/hl7v2_messages.test.js +++ b/healthcare/hl7v2/system-test/hl7v2_messages.test.js @@ -44,28 +44,26 @@ before(() => { process.env.GOOGLE_APPLICATION_CREDENTIALS, `Must set GOOGLE_APPLICATION_CREDENTIALS environment variable!` ); - execSync( - `node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets - ); + execSync(`node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, { + cwd: cwdDatasets, + }); }); after(() => { try { - execSync( - `node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets - ); + execSync(`node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, { + cwd: cwdDatasets, + }); } catch (err) {} // Ignore error }); it('should create an HL7v2 message', () => { execSync( `node createHl7v2Store.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); const output = execSync( `node createHl7v2Message.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${messageFile}`, - cwd + {cwd} ); assert.ok(output.includes('Created HL7v2 message')); }); @@ -73,7 +71,7 @@ it('should create an HL7v2 message', () => { it('should ingest an HL7v2 message', () => { const output = execSync( `node ingestHl7v2Message.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${messageFile}`, - cwd + {cwd} ); assert.ok(output.includes('Ingested HL7v2 message')); }); @@ -81,7 +79,7 @@ it('should ingest an HL7v2 message', () => { it('should get an HL7v2 message', () => { const output = execSync( `node getHl7v2Message.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${messageId}`, - cwd + {cwd} ); assert.ok(output.includes('Got HL7v2 message')); }); @@ -89,7 +87,7 @@ it('should get an HL7v2 message', () => { it('should list HL7v2 messages', () => { const output = execSync( `node listHl7v2Messages.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); assert.ok(output.includes('HL7v2 messages')); }); @@ -97,7 +95,7 @@ it('should list HL7v2 messages', () => { it('should patch an HL7v2 message', () => { const output = execSync( `node patchHl7v2Message.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${messageId} ${labelKey} ${labelValue}`, - cwd + {cwd} ); assert.ok(output.includes('Patched HL7v2 message')); }); @@ -105,13 +103,13 @@ it('should patch an HL7v2 message', () => { it('should delete an HL7v2 message', () => { const output = execSync( `node deleteHl7v2Message.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${messageId}`, - cwd + {cwd} ); assert.ok(output.includes('Deleted HL7v2 message')); // Clean up execSync( `node deleteHl7v2Store.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); }); diff --git a/healthcare/hl7v2/system-test/hl7v2_stores.test.js b/healthcare/hl7v2/system-test/hl7v2_stores.test.js index 2c8b7879ba..943a397402 100644 --- a/healthcare/hl7v2/system-test/hl7v2_stores.test.js +++ b/healthcare/hl7v2/system-test/hl7v2_stores.test.js @@ -45,26 +45,24 @@ before(async () => { // Create a Pub/Sub topic to be used for testing. const [topic] = await pubSubClient.createTopic(topicName); console.log(`Topic ${topic.name} created.`); - execSync( - `node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets - ); + execSync(`node createDataset.js ${projectId} ${cloudRegion} ${datasetId}`, { + cwd: cwdDatasets, + }); }); after(async () => { try { await pubSubClient.topic(topicName).delete(); console.log(`Topic ${topicName} deleted.`); - execSync( - `node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, - cwdDatasets - ); + execSync(`node deleteDataset.js ${projectId} ${cloudRegion} ${datasetId}`, { + cwd: cwdDatasets, + }); } catch (err) {} // Ignore error }); it('should create an HL7v2 store', () => { const output = execSync( `node createHl7v2Store.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); assert.ok(output.includes('Created HL7v2 store')); }); @@ -72,7 +70,7 @@ it('should create an HL7v2 store', () => { it('should get an HL7v2 store', () => { const output = execSync( `node getHl7v2Store.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); assert.ok(output.includes('name')); }); @@ -80,7 +78,7 @@ it('should get an HL7v2 store', () => { it('should patch an HL7v2 store', () => { const output = execSync( `node patchHl7v2Store.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${topicName}`, - cwd + {cwd} ); assert.ok(output.includes('Patched HL7v2 store')); }); @@ -88,7 +86,7 @@ it('should patch an HL7v2 store', () => { it('should list HL7v2 stores', () => { const output = execSync( `node listHl7v2Stores.js ${projectId} ${cloudRegion} ${datasetId}`, - cwd + {cwd} ); assert.ok(output.includes('hl7V2Stores')); }); @@ -99,7 +97,7 @@ it('should create and get an HL7v2 store IAM policy', () => { let output = execSync( `node setHl7v2StoreIamPolicy.js ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId} ${localMember} ${localRole}`, - cwd + {cwd} ); assert.ok(output.includes, 'ETAG'); @@ -112,7 +110,7 @@ it('should create and get an HL7v2 store IAM policy', () => { it('should delete an HL7v2 Store', () => { const output = execSync( `node deleteHl7v2Store ${projectId} ${cloudRegion} ${datasetId} ${hl7v2StoreId}`, - cwd + {cwd} ); assert.ok(output.includes('Deleted HL7v2 store')); });