Skip to content

start_medical_scribe_job async

start_medical_scribe_job(
    medical_scribe_job_name: TranscriptionJobName,
    media: Media,
    output_bucket_name: OutputBucketName,
    data_access_role_arn: DataAccessRoleArn,
    settings: MedicalScribeSettings,
    *,
    config_overrides: Optional[AsyncTranscribeClientConfig] = None,
    output_encryption_kms_key_id: Optional[KMSKeyId] = None,
    kms_encryption_context: Optional[KMSEncryptionContextMap] = None,
    channel_definitions: Optional[MedicalScribeChannelDefinitions] = None,
    tags: Optional[TagList] = None,
    medical_scribe_context: Optional[MedicalScribeContext] = None,
) -> StartMedicalScribeJobResponse

Transcribes patient-clinician conversations and generates clinical notes.

Amazon Web Services HealthScribe automatically provides rich conversation transcripts, identifies speaker roles, classifies dialogues, extracts medical terms, and generates preliminary clinical notes. To learn more about these features, refer to Amazon Web Services HealthScribe.

To make a StartMedicalScribeJob request, you must first upload your media file into an Amazon S3 bucket; you can then specify the Amazon S3 location of the file using the Media parameter.

You must include the following parameters in your StartMedicalTranscriptionJob request:

  • DataAccessRoleArn: The ARN of an IAM role with the these minimum permissions: read permission on input file Amazon S3 bucket specified in Media, write permission on the Amazon S3 bucket specified in OutputBucketName, and full permissions on the KMS key specified in OutputEncryptionKMSKeyId (if set). The role should also allow transcribe.amazonaws.com to assume it.

  • Media (MediaFileUri): The Amazon S3 location of your media file.

  • MedicalScribeJobName: A custom name you create for your MedicalScribe job that is unique within your Amazon Web Services account.

  • OutputBucketName: The Amazon S3 bucket where you want your output files stored.

  • Settings: A MedicalScribeSettings object that must set exactly one of ShowSpeakerLabels or ChannelIdentification to true. If ShowSpeakerLabels is true, MaxSpeakerLabels must also be set.

  • ChannelDefinitions: A MedicalScribeChannelDefinitions array should be set if and only if the ChannelIdentification value of Settings is set to true.

Parameters:

  • medical_scribe_job_name (TranscriptionJobName) –

    A unique name, chosen by you, for your Medical Scribe job.

    This name is case sensitive, cannot contain spaces, and must be unique within an Amazon Web Services account. If you try to create a new job with the same name as an existing job, you get a ConflictException error.

  • output_bucket_name (OutputBucketName) –

    The name of the Amazon S3 bucket where you want your Medical Scribe output stored. Do not include the S3:// prefix of the specified bucket.

    Note that the role specified in the DataAccessRoleArn request parameter must have permission to use the specified location. You can change Amazon S3 permissions using the Amazon Web Services Management Console. See also Permissions Required for IAM User Roles.

  • output_encryption_kms_key_id (Optional[KMSKeyId], default: None ) –

    The Amazon Resource Name (ARN) of a KMS key that you want to use to encrypt your Medical Scribe output.

    KMS key ARNs have the format arn:partition:kms:region:account:key/key-id. For example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. For more information, see KMS key ARNs.

    If you do not specify an encryption key, your output is encrypted with the default Amazon S3 key (SSE-S3).

    Note that the role making the request and the role specified in the DataAccessRoleArn request parameter (if present) must have permission to use the specified KMS key.

  • kms_encryption_context (Optional[KMSEncryptionContextMap], default: None ) –

    A map of plain text, non-secret key:value pairs, known as encryption context pairs, that provide an added layer of security for your data. For more information, see KMS encryption context and Asymmetric keys in KMS.

  • data_access_role_arn (DataAccessRoleArn) –

    The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files, write to the output bucket, and use your KMS key if supplied. If the role that you specify doesn’t have the appropriate permissions your request fails.

    IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path. For example: arn:aws:iam::111122223333:role/Admin.

    For more information, see IAM ARNs.

  • settings (MedicalScribeSettings) –

    Makes it possible to control how your Medical Scribe job is processed using a MedicalScribeSettings object. Specify ChannelIdentification if ChannelDefinitions are set. Enabled ShowSpeakerLabels if ChannelIdentification and ChannelDefinitions are not set. One and only one of ChannelIdentification and ShowSpeakerLabels must be set. If ShowSpeakerLabels is set, MaxSpeakerLabels must also be set. Use Settings to specify a vocabulary or vocabulary filter or both using VocabularyName, VocabularyFilterName. VocabularyFilterMethod must be specified if VocabularyFilterName is set.

  • channel_definitions (Optional[MedicalScribeChannelDefinitions], default: None ) –

    Makes it possible to specify which speaker is on which channel. For example, if the clinician is the first participant to speak, you would set ChannelId of the first ChannelDefinition in the list to 0 (to indicate the first channel) and ParticipantRole to CLINICIAN (to indicate that it's the clinician speaking). Then you would set the ChannelId of the second ChannelDefinition in the list to 1 (to indicate the second channel) and ParticipantRole to PATIENT (to indicate that it's the patient speaking).

  • tags (Optional[TagList], default: None ) –

    Adds one or more custom tags, each in the form of a key:value pair, to the Medical Scribe job.

    To learn more about using tags with Amazon Transcribe, refer to Tagging resources.

  • medical_scribe_context (Optional[MedicalScribeContext], default: None ) –

    The MedicalScribeContext object that contains contextual information which is used during clinical note generation to add relevant context to the note.

Raises:

  • BadRequestException –

    Your request didn't pass one or more validation tests. This can occur when the entity you're trying to delete doesn't exist or if it's in a non-terminal state (such as IN PROGRESS). See the exception message field for more information.

  • ConflictException –

    A resource already exists with this name. Resource names must be unique within an Amazon Web Services account.

  • InternalFailureException –

    There was an internal error. Check the error message, correct the issue, and try your request again.

  • LimitExceededException –

    You've either sent too many requests or your input file is too long. Wait before retrying your request, or use a smaller file and try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_transcribe/_services/async_transcribe.py
async def start_medical_scribe_job(
    self,
    medical_scribe_job_name: "capo_transcribe.types.transcription_job_name.TranscriptionJobName",
    media: "capo_transcribe.types.media.Media",
    output_bucket_name: "capo_transcribe.types.output_bucket_name.OutputBucketName",
    data_access_role_arn: "capo_transcribe.types.data_access_role_arn.DataAccessRoleArn",
    settings: "capo_transcribe.types.medical_scribe_settings.MedicalScribeSettings",
    *,
    config_overrides: Optional[AsyncTranscribeClientConfig] = None,
    output_encryption_kms_key_id: Optional[
        "capo_transcribe.types.kms_key_id.KMSKeyId"
    ] = None,
    kms_encryption_context: Optional[
        "capo_transcribe.types.kms_encryption_context_map.KMSEncryptionContextMap"
    ] = None,
    channel_definitions: Optional[
        "capo_transcribe.types.medical_scribe_channel_definitions.MedicalScribeChannelDefinitions"
    ] = None,
    tags: Optional["capo_transcribe.types.tag_list.TagList"] = None,
    medical_scribe_context: Optional[
        "capo_transcribe.types.medical_scribe_context.MedicalScribeContext"
    ] = None,
) -> "capo_transcribe.types.start_medical_scribe_job_response.StartMedicalScribeJobResponse":
    """<p>Transcribes patient-clinician conversations and generates clinical notes. </p> <p>Amazon Web Services HealthScribe automatically provides rich conversation transcripts, identifies speaker roles, classifies dialogues, extracts medical terms, and generates preliminary clinical notes. To learn more about these features, refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe.html">Amazon Web Services HealthScribe</a>.</p> <p>To make a <code>StartMedicalScribeJob</code> request, you must first upload your media file into an Amazon S3 bucket; you can then specify the Amazon S3 location of the file using the <code>Media</code> parameter.</p> <p>You must include the following parameters in your <code>StartMedicalTranscriptionJob</code> request:</p> <ul> <li> <p> <code>DataAccessRoleArn</code>: The ARN of an IAM role with the these minimum permissions: read permission on input file Amazon S3 bucket specified in <code>Media</code>, write permission on the Amazon S3 bucket specified in <code>OutputBucketName</code>, and full permissions on the KMS key specified in <code>OutputEncryptionKMSKeyId</code> (if set). The role should also allow <code>transcribe.amazonaws.com</code> to assume it. </p> </li> <li> <p> <code>Media</code> (<code>MediaFileUri</code>): The Amazon S3 location of your media file.</p> </li> <li> <p> <code>MedicalScribeJobName</code>: A custom name you create for your MedicalScribe job that is unique within your Amazon Web Services account.</p> </li> <li> <p> <code>OutputBucketName</code>: The Amazon S3 bucket where you want your output files stored.</p> </li> <li> <p> <code>Settings</code>: A <code>MedicalScribeSettings</code> object that must set exactly one of <code>ShowSpeakerLabels</code> or <code>ChannelIdentification</code> to true. If <code>ShowSpeakerLabels</code> is true, <code>MaxSpeakerLabels</code> must also be set. </p> </li> <li> <p> <code>ChannelDefinitions</code>: A <code>MedicalScribeChannelDefinitions</code> array should be set if and only if the <code>ChannelIdentification</code> value of <code>Settings</code> is set to true. </p> </li> </ul>

    Args:
        medical_scribe_job_name: <p>A unique name, chosen by you, for your Medical Scribe job.</p> <p>This name is case sensitive, cannot contain spaces, and must be unique within an Amazon Web Services account. If you try to create a new job with the same name as an existing job, you get a <code>ConflictException</code> error.</p>
        output_bucket_name: <p>The name of the Amazon S3 bucket where you want your Medical Scribe output stored. Do not include the <code>S3://</code> prefix of the specified bucket.</p> <p>Note that the role specified in the <code>DataAccessRoleArn</code> request parameter must have permission to use the specified location. You can change Amazon S3 permissions using the <a href="https://console.aws.amazon.com/s3">Amazon Web Services Management Console</a>. See also <a href="https://docs.aws.amazon.com/transcribe/latest/dg/security_iam_id-based-policy-examples.html#auth-role-iam-user">Permissions Required for IAM User Roles</a>.</p>
        output_encryption_kms_key_id: <p>The Amazon Resource Name (ARN) of a KMS key that you want to use to encrypt your Medical Scribe output.</p> <p>KMS key ARNs have the format <code>arn:partition:kms:region:account:key/key-id</code>. For example: <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN"> KMS key ARNs</a>.</p> <p>If you do not specify an encryption key, your output is encrypted with the default Amazon S3 key (SSE-S3).</p> <p>Note that the role making the request and the role specified in the <code>DataAccessRoleArn</code> request parameter (if present) must have permission to use the specified KMS key.</p>
        kms_encryption_context: <p>A map of plain text, non-secret key:value pairs, known as encryption context pairs, that provide an added layer of security for your data. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/key-management.html#kms-context">KMS encryption context</a> and <a href="https://docs.aws.amazon.com/transcribe/latest/dg/symmetric-asymmetric.html">Asymmetric keys in KMS</a>.</p>
        data_access_role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files, write to the output bucket, and use your KMS key if supplied. If the role that you specify doesn’t have the appropriate permissions your request fails.</p> <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
        settings: <p>Makes it possible to control how your Medical Scribe job is processed using a <code>MedicalScribeSettings</code> object. Specify <code>ChannelIdentification</code> if <code>ChannelDefinitions</code> are set. Enabled <code>ShowSpeakerLabels</code> if <code>ChannelIdentification</code> and <code>ChannelDefinitions</code> are not set. One and only one of <code>ChannelIdentification</code> and <code>ShowSpeakerLabels</code> must be set. If <code>ShowSpeakerLabels</code> is set, <code>MaxSpeakerLabels</code> must also be set. Use <code>Settings</code> to specify a vocabulary or vocabulary filter or both using <code>VocabularyName</code>, <code>VocabularyFilterName</code>. <code>VocabularyFilterMethod</code> must be specified if <code>VocabularyFilterName</code> is set. </p>
        channel_definitions: <p>Makes it possible to specify which speaker is on which channel. For example, if the clinician is the first participant to speak, you would set <code>ChannelId</code> of the first <code>ChannelDefinition</code> in the list to <code>0</code> (to indicate the first channel) and <code>ParticipantRole</code> to <code>CLINICIAN</code> (to indicate that it's the clinician speaking). Then you would set the <code>ChannelId</code> of the second <code>ChannelDefinition</code> in the list to <code>1</code> (to indicate the second channel) and <code>ParticipantRole</code> to <code>PATIENT</code> (to indicate that it's the patient speaking). </p>
        tags: <p>Adds one or more custom tags, each in the form of a key:value pair, to the Medical Scribe job.</p> <p>To learn more about using tags with Amazon Transcribe, refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html">Tagging resources</a>.</p>
        medical_scribe_context: <p>The <code>MedicalScribeContext</code> object that contains contextual information which is used during clinical note generation to add relevant context to the note.</p>

    Raises:
        capo_transcribe.errors.bad_request_exception.BadRequestException: <p>Your request didn't pass one or more validation tests. This can occur when the entity you're trying to delete doesn't exist or if it's in a non-terminal state (such as <code>IN PROGRESS</code>). See the exception message field for more information.</p>
        capo_transcribe.errors.conflict_exception.ConflictException: <p>A resource already exists with this name. Resource names must be unique within an Amazon Web Services account.</p>
        capo_transcribe.errors.internal_failure_exception.InternalFailureException: <p>There was an internal error. Check the error message, correct the issue, and try your request again.</p>
        capo_transcribe.errors.limit_exceeded_exception.LimitExceededException: <p>You've either sent too many requests or your input file is too long. Wait before retrying your request, or use a smaller file and try your request again.</p>
        capo_transcribe.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_transcribe.types.start_medical_scribe_job_request.StartMedicalScribeJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_transcribe.types.start_medical_scribe_job_response.StartMedicalScribeJobResponse"
    ]:
        import capo_transcribe._operations.transcribe.start_medical_scribe_job

        (
            output,
            http_response,
        ) = await capo_transcribe._operations.transcribe.start_medical_scribe_job.async_start_medical_scribe_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_transcribe.types.start_medical_scribe_job_request.StartMedicalScribeJobRequest",
    ) -> dict[str, Any]:
        import capo_transcribe.types.start_medical_scribe_job_request

        return (
            capo_transcribe.types.start_medical_scribe_job_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartMedicalScribeJob", redact_input=_redact_input),
    )
    input_: capo_transcribe.types.start_medical_scribe_job_request.StartMedicalScribeJobRequest = {
        "medical_scribe_job_name": medical_scribe_job_name,
        "media": media,
        "output_bucket_name": output_bucket_name,
        "data_access_role_arn": data_access_role_arn,
        "settings": settings,
    }
    if output_encryption_kms_key_id is not None:
        input_["output_encryption_kms_key_id"] = output_encryption_kms_key_id
    if kms_encryption_context is not None:
        input_["kms_encryption_context"] = kms_encryption_context
    if channel_definitions is not None:
        input_["channel_definitions"] = channel_definitions
    if tags is not None:
        input_["tags"] = tags
    if medical_scribe_context is not None:
        input_["medical_scribe_context"] = medical_scribe_context

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output