/
transcribe_create_medical_job.js
57 lines (51 loc) · 1.94 KB
/
transcribe_create_medical_job.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
ABOUT THIS NODE.JS EXAMPLE: This example works with the AWS SDK for JavaScript version 3 (v3),
which is available at https://github.com/aws/aws-sdk-js-v3.
Purpose:
transcribe_create_medical_job.js demonstrates how to create an Amazon Transcribe medical transcription job.
Inputs (replace in code):
- MEDICAL_JOB_NAME
- OUTPUT_BUCKET_NAME
- JOB_TYPE
- LANGUAGE_CODE
- SOURCE_FILE_FORMAT
- SOURCE_FILE_LOCATION
Running the code:
node transcribe_create_medical_job.js
*/
// snippet-start:[transcribe.JavaScript.jobs.createMedicalJobV3]
// Import the required AWS SDK clients and commands for Node.js
import { StartMedicalTranscriptionJobCommand } from "@aws-sdk/client-transcribe";
import { transcribeClient } from "./libs/transcribeClient.js";
// Set the parameters
export const params = {
MedicalTranscriptionJobName: "MEDICAL_JOB_NAME", // Required
OutputBucketName: "OUTPUT_BUCKET_NAME", // Required
Specialty: "PRIMARYCARE", // Required. Possible values are 'PRIMARYCARE'
Type: "JOB_TYPE", // Required. Possible values are 'CONVERSATION' and 'DICTATION'
LanguageCode: "LANGUAGE_CODE", // For example, 'en-US'
MediaFormat: "SOURCE_FILE_FORMAT", // For example, 'wav'
Media: {
MediaFileUri: "SOURCE_FILE_LOCATION",
// The S3 object location of the input media file. The URI must be in the same region
// as the API endpoint that you are calling.For example,
// "https://transcribe-demo.s3-REGION.amazonaws.com/hello_world.wav"
},
};
export const run = async () => {
try {
const data = await transcribeClient.send(
new StartMedicalTranscriptionJobCommand(params)
);
console.log("Success - put", data);
return data; // For unit tests.
} catch (err) {
console.log("Error", err);
}
};
run();
// snippet-end:[transcribe.JavaScript.jobs.createMedicalJobV3]
// For unit tests.
// module.exports = {run, params}