Recipe 10.10 Architecture and Implementation: Multilingual Real-Time Medical Interpretation
Companion to Recipe 10.10: Multilingual Real-Time Medical Interpretation. This page covers the AWS architecture, services, prerequisites, and pseudocode. For the problem framing and the conceptual approach, start with the main recipe.
The AWS Implementation
Why These Services
Amazon Transcribe and Amazon Transcribe Medical for streaming source-language ASR. Transcribe Medical provides streaming ASR optimized for clinical English with custom-vocabulary support; Transcribe (general) covers a broader set of languages including Spanish, Mandarin, Japanese, Korean, Portuguese, French, German, Italian, Arabic, Russian, Hindi, and others. For the patient direction (typically a non-English language), Transcribe streaming with the patient's language code is the path; for the clinician direction in English, Transcribe Medical with conversational mode is the path. Custom vocabulary applies medical terminology, drug names, and institution-specific terms. Where Transcribe does not cover a language at acceptable quality, the architecture falls back to a third-party streaming ASR vendor for that language.
Amazon Translate with Custom Terminology and Active Custom Translation for source-to-target MT. Translate provides neural machine translation across a broad set of language pairs with low per-character cost and predictable latency. Custom Terminology enforces consistent translation of institution-specific terms (drug names, provider names, location names, internal program names). Active Custom Translation enables fine-tuning the translation engine against parallel medical-domain corpora the institution has curated. For language pairs where Translate's medical-domain quality is inadequate, the architecture routes to Bedrock with a translation prompt (LLM-based translation) or to a third-party MT vendor.
Amazon Bedrock for LLM-based translation on hard content categories. When the deployment posture calls for higher-fluency translation on safety-critical content (cultural framing, idiomatic expressions, mental-health vocabulary, end-of-life discussions) or when the language pair is low-resource enough that Translate quality is inadequate, Bedrock invokes a frontier LLM with a translate-this-to-X prompt. The latency is higher than Translate (typically several hundred milliseconds to a few seconds, depending on the model) and the cost per token is higher. For appropriate use cases the quality gain justifies the cost. The hybrid pattern routes content categories to the appropriate engine: Translate for routine clinical and administrative content, Bedrock for high-fluency or low-resource content, with the same medical-vocabulary and faithfulness scaffolding applied to both.
Amazon Bedrock Guardrails for content filtering and prompt-injection mitigation on LLM-based translation. When the architecture uses Bedrock for translation, Guardrails applies content filtering (no harmful content generation, no PII echo beyond what was in the source) and contextual-grounding checks (the output is faithful to the source). Prompt-injection mitigation is essential: the source-language audio is patient-generated content, and a malicious patient could attempt to inject instructions into the LLM through carefully-crafted utterances. The Guardrails configuration treats all source content as untrusted input that should be translated, not interpreted as instructions.
Amazon Polly Neural and Polly Generative for streaming target-language TTS. Polly's neural and generative voices provide natural-sounding TTS across the languages the institution needs. The voice selection per language is a deployment decision (gender, age, dialect); the institutional preference and the patient demographic guide the choice. Polly Lexicons enable phonetic guidance for institution-specific pronunciation (drug names, provider names, location names) so that the synthesized speech is recognizable to the target-language listener.
Amazon Connect for telephonic deployment scenarios. When the deployment serves telephonic encounters (patient calls in, system translates between patient and clinician), Connect provides the contact center infrastructure: SIP integration, call routing, queue management, and the audio path that gets the patient's audio to the cloud and back. Connect also integrates with the human-interpreter pool for the escalation pathway: when the system escalates, Connect can transfer the call to a human interpreter on the institutional contract or to a contracted vendor's interpreter pool.
Amazon Chime SDK for in-person and telehealth video encounters. When the deployment serves in-person encounters with a shared room device or telehealth encounters with both parties on a video call, the Chime SDK provides the WebRTC-based audio and video infrastructure: real-time audio capture and delivery, per-participant channels, and the integration with the cloud ASR pipeline. Chime SDK handles the per-speaker audio channel separation that makes diarization trivial.
AWS Lambda and AWS Step Functions for pipeline orchestration. Per-stage Lambdas handle session setup, audio routing, ASR-to-MT-to-TTS pipeline coordination, confidence-based escalation logic, audit logging, and post-encounter cleanup. Step Functions coordinates longer-running flows (the full encounter lifecycle, the human-interpreter handoff process, the audit-and-archival flow). Real-time per-utterance processing happens in Lambda (or in containerized services for the lowest-latency configurations); the orchestration layer handles the encounter-level state.
Amazon DynamoDB for per-encounter session state and per-utterance audit. DynamoDB holds the encounter-session state (language pair, deployment posture, consent terms, escalation history) and the per-utterance audit records (source transcript, target transcript, confidence scores, model versions). The partition-key-by-encounter and sort-key-by-utterance-timestamp model supports the audit-trail queries efficiently.
Amazon S3 for audio storage with consent-bounded retention. When audio is retained for a quality-assurance window or for a longer adaptation window with explicit consent, S3 holds the audio with SSE-KMS encryption using customer-managed keys. Lifecycle rules enforce per-consent retention (typically days for QA, optionally longer with explicit consent for model improvement).
Amazon Kinesis Data Streams for real-time audio streaming where the architecture requires it. For some low-latency configurations, raw audio frames stream through Kinesis Data Streams to the ASR consumers and to the audit pipeline simultaneously. The Kinesis approach trades some latency overhead for cleaner separation of concerns and easier multi-consumer integration; for the lowest-latency configurations, direct WebRTC-to-ASR paths are preferred.
Amazon API Gateway for client-facing APIs. The patient device, the clinician device, the human-interpreter handoff service, and the institutional dashboards all access the system through API Gateway endpoints. Authentication via Cognito or institutional IdP applies, with per-role scopes (patient, clinician, interpreter, administrator).
Amazon Cognito or institutional IdP via OIDC/SAML for authentication. Clinician authentication through the institutional identity provider with appropriate clinical-application scopes. Patient authentication varies by deployment context: in-clinic use typically does not require explicit patient authentication beyond the clinical encounter context; telephonic use authenticates the patient through patient-portal credentials or through the call routing context; telehealth use authenticates through the patient's portal session.
AWS KMS for cryptographic key custody. Customer-managed keys for the audio bucket, the transcript and translation archive, the audit archive, and the per-utterance audit records in DynamoDB. Voice samples and biometric voiceprints (where used for clinician enrollment) use separate KMS keys for blast-radius containment, with explicit key rotation cadence.
AWS Secrets Manager for vendor API credentials. When the architecture integrates third-party ASR, MT, or TTS vendors for languages or pairs not well-covered by AWS native services, the vendor API credentials live in Secrets Manager with rotation per the institutional cadence.
Amazon EventBridge for cross-system event flow. Encounter-started, encounter-ended, escalation-triggered, and audio-discarded events flow through EventBridge. Downstream consumers (the per-language-pair quality monitoring pipeline, the language-access compliance dashboard, the human-interpreter staffing analytics) react to events without coupling to the orchestration Lambdas.
Amazon CloudWatch for operational metrics and alarms. Per-pair end-to-end latency, per-pair confidence distributions, per-pair escalation rates, per-population disparity metrics. Alarms on per-pair quality drift, on escalation-rate spikes, on latency-budget overruns, on per-population disparity widening.
AWS CloudTrail for API-level audit. All access to PHI-bearing and biometric-bearing resources is logged. ASR, MT, and TTS invocations are logged with metadata only (not full content, to avoid persisting biometric and PHI in CloudTrail). Lambda invocations and KMS key uses are logged. CloudTrail logs in a dedicated bucket with Object Lock and lifecycle to S3 Glacier Deep Archive after 90 days.
Amazon Kinesis Data Firehose, AWS Glue, Amazon Athena, Amazon QuickSight (optional) for quality analytics and surveillance. Per-utterance audit data streams to S3 via Firehose. Glue catalogs the data. Athena provides SQL access for the per-pair quality analysis and the per-population disparity analysis. QuickSight renders the language-access compliance dashboards and the per-pair quality dashboards.
Architecture Diagram
flowchart LR
subgraph Capture
PT[Patient<br/>Device or Phone]
CL[Clinician<br/>Device]
QA[Per-Stream<br/>Audio QA]
end
subgraph Telephony
CONN[Amazon Connect<br/>SIP and Call Routing]
CHM[Amazon Chime SDK<br/>WebRTC In-Person<br/>and Telehealth]
end
subgraph Pipeline
APIGW[API Gateway<br/>Session API]
L_SETUP[Lambda<br/>Session Setup]
L_ROUTE[Lambda<br/>Audio Router]
TS_PT[Transcribe<br/>Patient Language]
TS_CL[Transcribe Medical<br/>Clinician English]
TX[Amazon Translate<br/>Custom Terminology]
BR_TX[Bedrock<br/>LLM Translation<br/>Hard Cases]
BR_GR[Bedrock<br/>Guardrails]
L_VFY[Lambda<br/>Faithfulness and<br/>Number Verification]
POL[Amazon Polly<br/>Neural and<br/>Generative Voices]
L_TURN[Lambda<br/>Turn-Taking<br/>State Machine]
L_ESC[Lambda<br/>Escalation<br/>Logic]
end
subgraph Human
INTERP[Human Interpreter<br/>Pool Integration]
end
subgraph Storage
DDB_SESS[(DynamoDB<br/>Session State<br/>and Audit)]
S3_AUDIO[(S3 Audio<br/>Consent-Bounded<br/>SSE-KMS)]
S3_AUDIT[(S3 Audit Archive<br/>Object Lock)]
SM_VEND[(Secrets Manager<br/>Vendor API Creds)]
end
subgraph Workflow
COGNITO[Cognito or<br/>Institutional IdP]
DASH[Language-Access<br/>Dashboard]
QM[Per-Pair<br/>Quality Monitoring]
end
subgraph Surveillance
EB[EventBridge]
KIN[Kinesis Firehose]
GLUE[Glue Catalog]
ATH[Athena]
QS[QuickSight]
CW[CloudWatch]
CT[CloudTrail]
end
subgraph Keys
KMS[(AWS KMS<br/>Customer-Managed)]
end
PT --> CONN
PT --> CHM
CL --> CHM
CONN --> QA
CHM --> QA
QA --> APIGW
APIGW --> COGNITO
APIGW --> L_SETUP
L_SETUP --> DDB_SESS
APIGW --> L_ROUTE
L_ROUTE --> TS_PT
L_ROUTE --> TS_CL
TS_PT --> TX
TS_CL --> TX
TS_PT --> BR_TX
TS_CL --> BR_TX
BR_TX --> BR_GR
TX --> L_VFY
BR_TX --> L_VFY
L_VFY --> POL
L_VFY --> L_ESC
POL --> L_TURN
L_TURN --> CONN
L_TURN --> CHM
L_ESC --> INTERP
INTERP --> CONN
INTERP --> CHM
L_ROUTE --> S3_AUDIO
L_VFY --> DDB_SESS
L_TURN --> DDB_SESS
L_ESC --> DDB_SESS
L_VFY --> EB
L_ESC --> EB
EB --> KIN
KIN --> S3_AUDIT
S3_AUDIT --> GLUE
GLUE --> ATH
ATH --> QS
ATH --> QM
QM --> DASH
L_ROUTE --> CW
L_TURN --> CW
APIGW --> CT
KMS --> S3_AUDIO
KMS --> S3_AUDIT
KMS --> DDB_SESS
KMS --> SM_VEND
L_ROUTE --> SM_VEND
style TS_PT fill:#fcf,stroke:#333
style TS_CL fill:#fcf,stroke:#333
style TX fill:#fcf,stroke:#333
style BR_TX fill:#fcf,stroke:#333
style BR_GR fill:#fcf,stroke:#333
style POL fill:#fcf,stroke:#333
style CONN fill:#fcf,stroke:#333
style CHM fill:#fcf,stroke:#333
style DDB_SESS fill:#9ff,stroke:#333
style S3_AUDIO fill:#cfc,stroke:#333
style S3_AUDIT fill:#cfc,stroke:#333
Prerequisites
| Requirement | Details |
|---|---|
| AWS Services | Amazon Transcribe and Transcribe Medical (streaming), Amazon Translate (with Custom Terminology and Active Custom Translation), Amazon Bedrock (with Guardrails), Amazon Polly (neural and generative voices, lexicons), Amazon Connect (for telephonic), Amazon Chime SDK (for in-person and telehealth), AWS Lambda, AWS Step Functions, Amazon DynamoDB, Amazon S3, Amazon API Gateway, Amazon Cognito, AWS KMS, AWS Secrets Manager, Amazon EventBridge, Amazon CloudWatch, AWS CloudTrail, Amazon Kinesis Data Firehose, AWS Glue, Amazon Athena. Optionally Amazon QuickSight for dashboards and Amazon Kinesis Data Streams for low-latency audio streaming. |
| Validated Vendors per Language Pair | Per-pair vendor selection with explicit medical-content quality evaluation. Top-volume pairs (English-Spanish, English-Mandarin, English-Vietnamese, English-Tagalog, English-Russian, English-Arabic, English-Korean, English-Haitian-Creole, English-Portuguese, English-French) typically use AWS native services (Transcribe, Translate, Polly) with custom terminology and lexicon overlays. Lower-resource pairs may require third-party vendors integrated via API; the institutional integration layer abstracts the vendor choice from the rest of the pipeline. |
| External Inputs | Curated medical-vocabulary lists per language for ASR custom-vocabulary configuration. Curated parallel medical corpora per language pair for MT Custom Terminology and Active Custom Translation. Pronunciation lexicons per language for Polly with institution-specific phonetic guidance. Per-pair quality evaluation sets (curated medical content with reference translations) for ongoing quality monitoring. Human-interpreter pool integration (institutional or vendor contract) for escalation. |
| IAM Permissions | Per-Lambda least-privilege roles. The session-setup Lambda has DynamoDB write to the session table only. The audio-router Lambda has Transcribe streaming permissions, Translate permissions, Bedrock invoke-model permissions, Polly synthesize-speech permissions, and S3 write to the audio bucket. The faithfulness-and-verification Lambda has Bedrock invoke-model permissions and DynamoDB write to the audit table. The escalation Lambda has Connect and Chime SDK permissions for human-interpreter handoff plus Secrets Manager read for vendor credentials. The audit Lambda has DynamoDB write and EventBridge publish. Each Lambda's resource-based policy pins the invoking principal to the production API Gateway stage ARN, the production Step Functions state-machine ARN, or the production EventBridge rule ARN as appropriate, so that only the intended orchestration path can trigger each function. Avoid wildcard actions and resources in production. |
| BAA and Compliance | AWS BAA signed. Amazon Transcribe and Transcribe Medical, Translate, Bedrock (verify the specific models and regions covered), Polly, Connect, Chime SDK, Lambda, Step Functions, DynamoDB, S3, API Gateway, Cognito, KMS, Secrets Manager, EventBridge, CloudWatch Logs, CloudTrail, Kinesis Firehose, Glue, Athena are HIPAA-eligible (verify the current list at build time against the AWS HIPAA Eligible Services Reference). Voice samples are biometric data; biometric-data law (Illinois BIPA, Texas, Washington) applies in addition to HIPAA where the patient's jurisdiction triggers it. Federal language-access requirements (Title VI, Section 1557) apply to the broader language-access program; the technology deployment must support, not undermine, the institutional language-access policy. State-level qualified-interpreter requirements apply where they exist; the deployment should treat machine interpretation as supplemental to, not a replacement for, qualified human interpreters in the encounters that require them. |
| Encryption | Audio samples: SSE-KMS with customer-managed keys, retention bound to the consent terms (typically hours to days for QA, optionally longer with explicit consent for model improvement). Transcripts and translations: SSE-KMS with separate customer-managed keys, retention aligned with medical-record retention. Audit archive: SSE-KMS with customer-managed keys, retention sized to the longest of: HIPAA's six-year minimum, state-specific medical-records-retention requirements, per-jurisdiction biometric-records retention (BIPA five-year, CUBI, Washington, GDPR Article 9 for EU patients), federal language-access compliance documentation retention per Title VI, Section 1557, and OCR enforcement period, state qualified-interpreter compliance documentation retention where applicable, per-vendor disclosure-accounting log retention, and the institutional regulatory floor. Disclosure-accounting logs (per-invocation records of each ASR, MT, and TTS vendor call constituting a third-party disclosure event) follow a separate retention regime aligned with the longest applicable biometric-data and language-access compliance period. DynamoDB tables, Lambda environment variables, and Lambda log groups: KMS-encrypted. Secrets Manager: customer-managed KMS. TLS in transit for all API calls; mTLS preferred for vendor API integrations. |
| VPC | Production: Lambdas that call back-office APIs (institutional EHR, language-access platform, human-interpreter pool) run in VPC with controlled egress. VPC endpoints for S3, DynamoDB, KMS, Secrets Manager, CloudWatch Logs, EventBridge, Transcribe, Translate, Bedrock, Polly, Lambda. Endpoint policies pin access to the specific resources the pipeline uses. |
| CloudTrail | Enabled with data events on the audio bucket, the audit archive bucket, the DynamoDB tables, the Secrets Manager secrets, and the customer-managed KMS keys. Transcribe, Translate, Bedrock, and Polly invocations logged with metadata only (not full input/output content, to avoid persisting biometric and PHI content in CloudTrail). Lambda invocations logged. API Gateway access logs enabled. CloudTrail logs in a dedicated S3 bucket with Object Lock in Compliance mode and lifecycle to S3 Glacier Deep Archive after 90 days. |
| Sample Data | Public medical-content evaluation sets per language pair where available (the institution typically curates its own from de-identified institutional encounter content with explicit consent and IRB review). Synthetic test conversations for end-to-end pipeline validation. Never use uncoded production patient audio in development. |
| Cost Estimate | At a mid-sized health system scale (50,000 minutes of bilingual encounter per month across language pairs, with mixed deployment posture across topic categories): Transcribe and Transcribe Medical streaming at typically $40,000-100,000 per year combined. Translate at typically $5,000-20,000 per year (Custom Terminology adds modest cost). Bedrock for LLM-translation on hard cases at typically $15,000-50,000 per year depending on model and traffic share. Polly neural and generative TTS at typically $10,000-30,000 per year. Connect and Chime SDK telephony and WebRTC charges at typically $20,000-80,000 per year. Lambda, Step Functions, DynamoDB, S3, API Gateway, KMS, Secrets Manager, EventBridge, Kinesis Firehose, Glue, Athena total approximately $20,000-60,000 per year combined. Total AWS infrastructure typically $110,000-340,000 per year at this scale. Compare against contracted human-interpreter spend at $1-3 per minute, which at 50,000 minutes per month is $600,000-1,800,000 per year; the cost case is real but the responsible deployment reinvests savings in human-interpreter quality for high-stakes encounters rather than capturing all savings. Per-encounter cost is dominated by ASR streaming for long encounters and by Bedrock when LLM-translation is used. |
Ingredients
| AWS Service | Role |
|---|---|
| Amazon Transcribe and Transcribe Medical | Streaming source-language ASR with medical-vocabulary custom terminology; clinician-side English with Transcribe Medical conversational mode; patient-side per-language with Transcribe streaming |
| Amazon Translate | Source-to-target machine translation with Custom Terminology for institution-specific terms and Active Custom Translation for medical-domain corpora |
| Amazon Bedrock | LLM-based translation for low-resource language pairs and for high-fluency clinical content categories (cultural framing, idiomatic expressions) |
| Amazon Bedrock Guardrails | Content filtering and prompt-injection mitigation on LLM-based translation; contextual-grounding checks for faithfulness |
| Amazon Polly | Streaming target-language TTS with neural and generative voices; pronunciation lexicons for drug names and institution-specific terms |
| Amazon Connect | Telephonic-mode contact center, SIP integration, call routing, queue management, human-interpreter handoff |
| Amazon Chime SDK | In-person-mode and telehealth-mode WebRTC audio and video infrastructure with per-participant channel separation |
| AWS Lambda | Per-stage orchestration for session setup, audio routing, faithfulness verification, turn-taking state machine, escalation logic, audit logging |
| AWS Step Functions | Encounter-level state coordination, human-interpreter handoff process, audit-and-archival flow |
| Amazon DynamoDB | Per-encounter session state, per-utterance audit records, escalation history, vendor selection per pair |
| Amazon S3 | Audio storage with consent-bounded retention; transcript and translation archive; audit archive with Object Lock |
| Amazon API Gateway | Patient-device, clinician-device, human-interpreter, and dashboard APIs |
| Amazon Cognito | Clinician and administrative authentication federated through institutional IdP; patient authentication where required |
| AWS KMS | Customer-managed encryption keys for audio, transcripts, audit data, and biometric voiceprints (where used); separate keys per data class |
| AWS Secrets Manager | Third-party ASR, MT, and TTS vendor API credentials with rotation |
| Amazon EventBridge | Cross-system event flow for encounter, escalation, and audit events |
| Amazon CloudWatch | Operational metrics, per-pair quality and latency alarms, per-population disparity alarms |
| AWS CloudTrail | API-level audit logging for PHI-bearing and biometric-bearing resources and AI/ML service invocations |
| Amazon Kinesis Data Firehose | Streaming audit data into the audit archive |
| AWS Glue + Amazon Athena | SQL access to audit and quality-monitoring data for per-pair analysis and per-population disparity tracking |
| Amazon QuickSight (optional) | Language-access compliance dashboards, per-pair quality dashboards, escalation analytics |
Code
Walkthrough
Step 1: Set up the encounter session with the language pair, deployment posture, and consent capture. When the encounter begins, the system records the language pair, identifies the deployment posture per the encounter's topic category, presents the consent disclosure to the patient (machine interpretation, right to request human interpreter, audio retention terms), and captures the consent decision. Skip the explicit language declaration and the system might guess wrong on dialect; skip the deployment-posture mapping and the system might run a safety-critical encounter in machine-only mode that should be human-primary; skip the consent capture and the institution operates outside its language-access policy.
ON encounter_initiated(clinician_id, patient_id,
declared_language, declared_dialect,
encounter_type, topic_category):
// Step 1A: validate language and dialect coverage.
pair_def = lookup_language_pair(
source_language: declared_language,
source_dialect: declared_dialect,
target_language: "en-US")
IF pair_def IS NULL OR
pair_def.deployment_status != "validated":
// Pair not validated for any deployment posture;
// route to human-only interpretation.
log_pair_unsupported(
declared_language, declared_dialect)
RETURN {
status: "PAIR_REQUIRES_HUMAN_INTERPRETER",
handoff: initiate_human_interpreter_handoff(
language: declared_language,
dialect: declared_dialect,
encounter_type: encounter_type)
}
// Step 1B: determine deployment posture for this
// encounter. The mapping from topic_category to
// posture is policy-owned by clinical-quality
// leadership and the language-access program.
posture = determine_deployment_posture(
topic_category: topic_category,
pair_def: pair_def,
institutional_policy: LANGUAGE_ACCESS_POLICY)
// posture is one of:
// "machine_only" (low-stakes administrative)
// "machine_with_human_standby"
// "human_primary_with_machine_assistance"
// "human_only" (e.g., informed consent, mental
// health crisis, end-of-life)
IF posture == "human_only":
log_human_only_required(
topic_category, pair_def)
RETURN {
status: "HUMAN_ONLY_REQUIRED",
handoff: initiate_human_interpreter_handoff(
language: declared_language,
dialect: declared_dialect,
encounter_type: encounter_type)
}
// Step 1C: present consent disclosure to patient
// (in patient's language).
consent_disclosure = build_consent_disclosure(
language: declared_language,
deployment_posture: posture,
audio_retention_terms:
INSTITUTIONAL_AUDIO_RETENTION_POLICY,
biometric_jurisdiction:
determine_biometric_jurisdiction(patient_id))
consent_outcome = capture_patient_consent(
patient_id: patient_id,
disclosure: consent_disclosure,
consent_type: "machine_interpretation")
IF NOT consent_outcome.granted:
// Patient declines machine interpretation;
// route to human interpreter.
log_consent_decline(patient_id, consent_outcome)
RETURN {
status: "CONSENT_DECLINED_HUMAN_ROUTING",
handoff: initiate_human_interpreter_handoff(
language: declared_language,
dialect: declared_dialect,
encounter_type: encounter_type)
}
// Step 1D: bootstrap the encounter session record.
encounter_id = generate_uuid()
encounter_table.put({
encounter_id: encounter_id,
patient_id_hash: hash(patient_id),
clinician_id: clinician_id,
language_pair: pair_def.pair_id,
declared_language: declared_language,
declared_dialect: declared_dialect,
encounter_type: encounter_type,
topic_category: topic_category,
deployment_posture: posture,
consent_id: consent_outcome.consent_id,
consent_disclosure_version:
consent_disclosure.version,
// Provision per-encounter resources for the
// appropriate vendor configuration for this pair.
asr_config: pair_def.asr_config,
mt_config: pair_def.mt_config,
tts_config: pair_def.tts_config,
// Human-interpreter standby pre-staged when
// posture requires it.
human_standby_session:
(posture in ["machine_with_human_standby",
"human_primary_with_machine_assistance"]) ?
pre_stage_human_interpreter(
language: declared_language,
dialect: declared_dialect,
encounter_type: encounter_type) :
NULL,
started_at: now(),
status: "setup_complete"
})
EventBridge.PutEvents([{
source: "medical_interpretation",
detail_type: "encounter_setup_complete",
detail: {
encounter_id: encounter_id,
language_pair: pair_def.pair_id,
posture: posture,
// Per-event idempotency key so downstream
// consumers can deduplicate on retries.
idempotency_key:
encounter_id + ":setup"
}
}])
RETURN {
encounter_id: encounter_id,
language_pair: pair_def.pair_id,
posture: posture,
status: "READY_FOR_AUDIO"
}
Step 2: Route per-speaker audio streams to the appropriate ASR engine with channel separation where available. The audio router takes the patient-side audio and the clinician-side audio (separated where the deployment supports it, single-channel with diarization where it does not), routes each stream to the appropriate ASR endpoint with the correct language code and custom-vocabulary configuration, and tracks per-stream quality. Skip the channel separation and diarization becomes a hard problem; skip the per-stream quality tracking and audio-quality issues surface as transcript errors that the clinician then has to chase.
FUNCTION route_audio_to_asr(encounter_id,
patient_audio_stream,
clinician_audio_stream):
state = encounter_table.get(encounter_id)
// Step 2A: per-stream audio quality assessment.
patient_quality = assess_stream_quality(
stream: patient_audio_stream,
expected_language: state.declared_language)
clinician_quality = assess_stream_quality(
stream: clinician_audio_stream,
expected_language: "en-US")
IF patient_quality.snr_db < MIN_ACCEPTABLE_SNR OR
clinician_quality.snr_db < MIN_ACCEPTABLE_SNR:
log_audio_quality_warning(
encounter_id, patient_quality, clinician_quality)
// Continue with degraded confidence; the
// downstream confidence-based escalation
// will handle low-quality audio.
// Step 2B: start the appropriate streaming ASR
// sessions per stream.
patient_asr = start_streaming_transcription(
engine: state.asr_config.patient_engine,
// engine value is one of "transcribe",
// "transcribe_medical", or a third-party
// vendor identifier; the audio_router
// abstracts the engine choice.
language_code: state.declared_language,
custom_vocabulary:
state.asr_config.custom_vocabulary_id,
partial_results_stability: "high",
end_of_utterance_silence_ms:
select_endpointing_threshold(
topic_category: state.topic_category))
clinician_asr = start_streaming_transcription(
engine: "transcribe_medical",
language_code: "en-US",
specialty: state.encounter_type.specialty,
// Transcribe Medical conversational mode for
// bidirectional clinical conversation.
type: "CONVERSATION",
partial_results_stability: "high",
end_of_utterance_silence_ms:
select_endpointing_threshold(
topic_category: state.topic_category))
// Step 2C: subscribe to ASR result streams.
// Each ASR session emits partial and final
// transcripts as audio is processed; the
// downstream pipeline consumes finalized
// transcripts from each stream.
encounter_table.update(
encounter_id: encounter_id,
patient_asr_session_id: patient_asr.session_id,
clinician_asr_session_id: clinician_asr.session_id,
audio_quality: {
patient: patient_quality,
clinician: clinician_quality
},
status: "asr_streaming")
RETURN {
patient_asr: patient_asr,
clinician_asr: clinician_asr
}
Step 3: Translate finalized source-language transcripts with medical-domain configuration, faithfulness checks, and number-and-unit verification. Each finalized source transcript is routed to the appropriate translation engine: Translate with Custom Terminology for routine content, Bedrock LLM with translation prompt for high-fluency or low-resource cases. The translated output is verified for numerical-content fidelity and faithfulness against the source. Skip the verification and the system can produce confidently-wrong translations on the content (drug doses, dosing intervals) that matters most clinically.
ON asr_finalized_transcript(encounter_id, speaker, segment):
// Triggered when an ASR stream finalizes a transcript
// segment. speaker is "patient" or "clinician".
state = encounter_table.get(encounter_id)
// Step 3A: select translation direction.
IF speaker == "patient":
source_language = state.declared_language
target_language = "en-US"
target_audience = state.clinician_id
ELSE:
source_language = "en-US"
target_language = state.declared_language
target_audience = state.patient_id_hash
// Step 3B: select translation engine per content
// category and pair configuration.
engine = select_translation_engine(
source_language: source_language,
target_language: target_language,
topic_category: state.topic_category,
segment_text: segment.transcript_text,
confidence_pattern: segment.per_word_confidence)
// Routine content -> Amazon Translate with Custom
// Terminology. High-fluency or low-resource ->
// Bedrock with translation prompt.
// Step 3C: translate.
IF engine == "translate":
translation_result = translate.translate_text(
text: segment.transcript_text,
source_language_code: source_language,
target_language_code: target_language,
terminology_names: [
state.mt_config.custom_terminology_id
],
settings: {
profanity: "MASK" // Per institutional
// policy; some flows
// suppress profanity
// in clinical output.
})
translated_text = translation_result.translated_text
translation_confidence =
translation_result.applied_settings_confidence
?? estimate_quality(
source: segment.transcript_text,
target: translated_text)
ELIF engine == "bedrock_llm":
prompt = build_translation_prompt(
source_text: segment.transcript_text,
source_language: source_language,
target_language: target_language,
// Delimit source content as untrusted input;
// Guardrails configured to treat tagged
// content as content to translate, not as
// instructions.
source_delimiter: "<patient_speech>",
domain: "medical",
institution_glossary:
state.mt_config.institution_glossary)
translation_result = bedrock.invoke_model(
model_id: state.mt_config.llm_model_id,
prompt: prompt,
guardrail_id:
TRANSLATION_GUARDRAIL_ID,
response_format: {
type: "json_schema",
schema: TRANSLATION_SCHEMA
},
max_tokens: estimate_tokens(
segment.transcript_text) * 2)
translated_text = translation_result.translation
translation_confidence =
translation_result.confidence
// Step 3D: number-and-unit verification.
// Extract numerical content from source and from
// translated output; verify they match. Drug doses,
// dosing intervals, ages, weights, vitals, dates,
// and other numerical content all checked.
number_verification = verify_numerical_content(
source_text: segment.transcript_text,
target_text: translated_text,
source_language: source_language,
target_language: target_language)
IF NOT number_verification.matches:
// Hard block on numerical mismatch. Route to
// human interpreter for this segment.
log_number_mismatch(
encounter_id, segment, number_verification)
escalate_to_human(
encounter_id: encounter_id,
reason: "number_mismatch",
segment: segment,
verification: number_verification)
RETURN {
translated: NULL,
escalated: true
}
// Step 3E: faithfulness check.
// For Bedrock LLM-based translations especially,
// verify the translation does not invent content,
// omit content, or contradict the source.
IF engine == "bedrock_llm":
faithfulness_result = check_faithfulness(
source_text: segment.transcript_text,
target_text: translated_text,
source_language: source_language,
target_language: target_language,
// Independent verifier model; not the same
// model that produced the translation.
verifier_model:
FAITHFULNESS_VERIFIER_MODEL_ID)
IF faithfulness_result.score < FAITHFULNESS_THRESHOLD:
// Faithfulness below threshold; escalate.
log_faithfulness_failure(
encounter_id, segment, faithfulness_result)
escalate_to_human(
encounter_id: encounter_id,
reason: "faithfulness_below_threshold",
segment: segment,
faithfulness: faithfulness_result)
RETURN {
translated: NULL,
escalated: true
}
// Step 3F: confidence-based escalation.
IF translation_confidence < CONFIDENCE_THRESHOLD OR
segment.per_word_confidence_min < ASR_CONFIDENCE_THRESHOLD:
// Confidence below threshold; depending on the
// deployment posture, either escalate or render
// with a low-confidence indicator.
IF state.deployment_posture in
["machine_with_human_standby",
"human_primary_with_machine_assistance"]:
escalate_to_human(
encounter_id: encounter_id,
reason: "confidence_below_threshold",
segment: segment)
RETURN {
translated: NULL,
escalated: true
}
ELSE:
// Machine-only posture; render with
// logged low-confidence flag.
log_low_confidence_render(
encounter_id, segment, translation_confidence)
// Step 3G: persist per-utterance audit record.
audit_table.put({
encounter_id: encounter_id,
utterance_id: segment.utterance_id,
timestamp: segment.timestamp,
speaker: speaker,
source_language: source_language,
target_language: target_language,
// Content stored encrypted; do not echo to
// general logs.
source_text_ref: archive_text(
segment.transcript_text),
target_text_ref: archive_text(translated_text),
engine: engine,
translation_confidence: translation_confidence,
asr_confidence:
segment.per_word_confidence_min,
number_verification: number_verification,
faithfulness_score: (engine == "bedrock_llm") ?
faithfulness_result.score : NULL,
escalation_triggered: false,
latency_ms: now() - segment.start_timestamp
})
RETURN {
translated_text: translated_text,
translation_confidence: translation_confidence,
target_audience: target_audience,
escalated: false
}
Step 4: Synthesize target-language audio with neural TTS, pronunciation lexicons, and streaming output. The verified translation goes to TTS with the appropriate voice for the target language and dialect, with a pronunciation lexicon applied for institution-specific terms (drug names, provider names, location names). Output streams to the listener as audio bytes are produced. Skip the lexicon and drug names get mispronounced in ways that confuse the listener; skip streaming output and time-to-first-audio doubles, breaking the conversational flow.
FUNCTION synthesize_translated_audio(
encounter_id, translated_text,
target_language, target_audience):
state = encounter_table.get(encounter_id)
// Step 4A: select voice for target language.
voice_config = select_voice(
language: target_language,
dialect: state.declared_dialect,
institutional_voice_preference:
state.tts_config.voice_preference,
patient_demographic_hints:
state.tts_config.demographic_hints)
// Step 4B: synthesize with streaming output.
synthesis_request = {
text: translated_text,
text_type: "ssml", // Use SSML for fine-grained
// pronunciation control.
ssml_text: build_ssml(
text: translated_text,
language: target_language,
// Apply pronunciation lexicons for
// institution-specific terms.
apply_lexicons: state.tts_config.lexicon_ids),
voice_id: voice_config.voice_id,
engine: voice_config.engine,
// engine: "neural" or "generative" depending on
// pair quality requirements and cost posture.
output_format: "ogg_vorbis",
sample_rate: "24000"
}
synthesis_stream = polly.synthesize_speech_streaming(
synthesis_request)
// Step 4C: stream audio to the target audience.
// The audio path (Connect for telephonic, Chime SDK
// for in-person and telehealth) handles delivery.
deliver_audio_stream(
target_audience: target_audience,
audio_stream: synthesis_stream,
encounter_id: encounter_id,
time_to_first_byte_target_ms: 800)
// Step 4D: track end-to-end latency.
end_to_end_latency_ms =
now() - synthesis_request.source_timestamp
cloudwatch.put_metric(
namespace: "MedicalInterpretation",
metric_name: "EndToEndLatencyMs",
value: end_to_end_latency_ms,
dimensions: {
language_pair: state.language_pair,
posture: state.deployment_posture,
speaker_direction:
determine_direction(target_audience)
})
RETURN {
synthesis_stream: synthesis_stream,
end_to_end_latency_ms: end_to_end_latency_ms
}
Step 5: Manage turn-taking and barge-in with a conversational state machine. The conversational state machine tracks who is speaking, when the system is translating, when the system is playing translated audio to a listener, and how to handle interruptions. Barge-in (a speaker starting before the system has finished translating the previous turn) gracefully halts in-flight TTS and queues the new audio. Skip the state machine and the conversation feels like a walkie-talkie; skip barge-in handling and speakers talk over the system's output and lose content.
ON vad_event(encounter_id, speaker, event_type):
// event_type: "speech_start", "speech_end", "silence"
state = encounter_table.get(encounter_id)
current_state = state.conversational_state ?? "idle"
// Step 5A: state machine transitions.
IF event_type == "speech_start":
IF current_state == "idle":
transition_to_state(
encounter_id, "speaker_active",
active_speaker: speaker)
ELIF current_state == "translating" AND
speaker != state.translating_for_speaker:
// Other speaker started while system was
// translating; handle barge-in.
handle_barge_in(
encounter_id: encounter_id,
interrupting_speaker: speaker,
in_flight_translation:
state.in_flight_translation)
ELIF current_state == "playing_translation" AND
speaker == state.target_audience_speaker:
// Target audience started talking before
// translation playback finished; barge-in
// on playback.
handle_playback_barge_in(
encounter_id: encounter_id,
interrupting_speaker: speaker)
ELIF event_type == "speech_end":
// Speaker finished an utterance; finalize the
// ASR transcript for this segment.
finalize_asr_segment(
encounter_id: encounter_id,
speaker: speaker)
ELIF event_type == "silence":
// Long silence detected; check if we should
// reset to idle.
silence_duration =
now() - state.last_speech_event_at
IF silence_duration > IDLE_SILENCE_THRESHOLD_MS:
transition_to_state(encounter_id, "idle")
// Step 5B: emit conversational-state event for
// downstream consumers (UI updates, logging).
EventBridge.PutEvents([{
source: "medical_interpretation",
detail_type: "conversational_state",
detail: {
encounter_id: encounter_id,
previous_state: current_state,
new_state: get_current_state(encounter_id),
event: event_type,
speaker: speaker
}
}])
FUNCTION handle_barge_in(encounter_id,
interrupting_speaker,
in_flight_translation):
// Halt the in-flight translation. The translation
// result up to this point is preserved in audit;
// it is not delivered to the target audience.
halt_translation(in_flight_translation.translation_id)
// The interrupting speaker's audio is captured
// through the normal ASR path; their utterance
// becomes the next segment to translate.
log_barge_in_event(encounter_id,
in_flight_translation,
interrupting_speaker)
Step 6: Escalate to a human interpreter on confidence-below-threshold, topic-category-requires-human, explicit speaker request, system-detected error pattern, or latency-budget exhaustion. The escalation pathway connects to the institutional human-interpreter pool (or the contracted vendor's pool), briefs the interpreter on conversational context with appropriate confidentiality scoping, transfers audio routing to the interpreter, and logs the escalation reason and timing for audit. Skip the seamless handoff and the conversation breaks awkwardly when the machine fails; skip the confidentiality scoping and the interpreter receives more context than they should.
FUNCTION escalate_to_human(encounter_id, reason,
segment, additional_context):
state = encounter_table.get(encounter_id)
// Step 6A: identify appropriate interpreter pool.
interpreter_pool = determine_interpreter_pool(
language: state.declared_language,
dialect: state.declared_dialect,
encounter_type: state.encounter_type,
// Pre-staged session if posture requires it,
// otherwise dispatch to on-demand pool.
pre_staged_session: state.human_standby_session)
// Step 6B: connect to interpreter.
IF state.human_standby_session IS NOT NULL:
// Pre-staged interpreter is already on standby;
// bring them into the conversation.
interpreter_session = state.human_standby_session
promote_standby_to_active(interpreter_session)
ELSE:
// On-demand dispatch; expected wait time tracked.
interpreter_session = dispatch_on_demand(
interpreter_pool: interpreter_pool,
urgency: determine_urgency(
state.topic_category, reason))
// Step 6C: brief interpreter on conversational
// context with confidentiality scoping. The
// briefing is the recent few utterances, redacted
// to the patient's stated identity scope. Sensitive
// content (mental health, substance use, sexual
// health, IPV, etc.) is provided with appropriate
// need-to-know framing.
context_briefing = build_interpreter_briefing(
recent_utterances: get_recent_utterances(
encounter_id, MAX_BRIEFING_UTTERANCES),
confidentiality_scope:
determine_confidentiality_scope(state),
topic_category: state.topic_category)
deliver_briefing_to_interpreter(
interpreter_session, context_briefing)
// Step 6D: transfer audio routing.
// The audio paths (Connect for telephonic, Chime SDK
// for in-person and telehealth) reroute the patient
// and clinician audio through the human interpreter.
transfer_audio_routing(
encounter_id: encounter_id,
from_mode: "machine",
to_mode: "human_interpreter",
interpreter_session: interpreter_session)
// Step 6E: log escalation event.
audit_table.put({
encounter_id: encounter_id,
event_type: "human_escalation",
timestamp: now(),
reason: reason,
segment_at_escalation: segment.utterance_id,
interpreter_session_id:
interpreter_session.session_id,
wait_time_ms:
interpreter_session.connect_time -
interpreter_session.dispatch_time,
additional_context: additional_context
})
EventBridge.PutEvents([{
source: "medical_interpretation",
detail_type: "human_escalation",
detail: {
encounter_id: encounter_id,
reason: reason,
language_pair: state.language_pair,
// Per-event idempotency key: encounter plus
// the specific escalation event ID.
idempotency_key:
encounter_id + ":" +
segment.utterance_id + ":escalation"
}
}])
encounter_table.update(
encounter_id: encounter_id,
current_mode: "human_interpreter",
last_escalation_reason: reason,
last_escalation_at: now())
Step 7: Close the encounter, retain audio per consent, write the audit record, and update per-pair quality monitoring. When the encounter ends, the system writes the durable audit record (encounter metadata, per-utterance confidence distributions, escalation events, satisfaction signals where captured), schedules audio deletion per consent terms, and feeds the per-pair quality monitoring pipeline with this encounter's data. Skip the audit record and the institution loses the language-access compliance evidence; skip the quality monitoring update and per-pair regression goes undetected.
ON encounter_ended(encounter_id, end_reason):
state = encounter_table.get(encounter_id)
// Step 7A: aggregate encounter-level audit summary.
encounter_audit = {
encounter_id: encounter_id,
patient_id_hash: state.patient_id_hash,
clinician_id: state.clinician_id,
language_pair: state.language_pair,
declared_language: state.declared_language,
declared_dialect: state.declared_dialect,
encounter_type: state.encounter_type,
topic_category: state.topic_category,
deployment_posture: state.deployment_posture,
consent_id: state.consent_id,
started_at: state.started_at,
ended_at: now(),
duration_seconds: now() - state.started_at,
end_reason: end_reason,
utterance_count: count_utterances(encounter_id),
per_utterance_confidence_distribution:
compute_confidence_distribution(encounter_id),
end_to_end_latency_distribution:
compute_latency_distribution(encounter_id),
escalation_events:
list_escalation_events(encounter_id),
modes_used:
list_modes_used(encounter_id),
// modes_used reflects whether the encounter ran
// entirely in machine mode, escalated to human,
// ran in hybrid mode, etc.
model_versions: {
asr_models: state.asr_config.models_used,
mt_models: state.mt_config.models_used,
tts_models: state.tts_config.models_used
}
}
audit_archive_kinesis_firehose.put(encounter_audit)
// Step 7B: schedule audio deletion per consent.
schedule_audio_deletion(
audio_refs: get_audio_refs_for_encounter(
encounter_id),
delete_after: lookup_audio_retention(
consent_id: state.consent_id,
deployment_context: state.encounter_type))
// Step 7C: per-pair quality metrics emission.
cloudwatch.put_metric(
namespace: "MedicalInterpretation",
metric_name: "EscalationRate",
value: len(encounter_audit.escalation_events) /
max(encounter_audit.utterance_count, 1),
dimensions: {
language_pair: state.language_pair,
posture: state.deployment_posture,
topic_category: state.topic_category
})
cloudwatch.put_metric(
namespace: "MedicalInterpretation",
metric_name: "P95LatencyMs",
value: encounter_audit
.end_to_end_latency_distribution.p95,
dimensions: {
language_pair: state.language_pair
})
// Step 7D: per-pair quality monitoring update.
// The quality-monitoring pipeline consumes the
// encounter audit and updates per-pair quality
// dashboards and disparity analyses.
EventBridge.PutEvents([{
source: "medical_interpretation",
detail_type: "encounter_ended",
detail: {
encounter_id: encounter_id,
language_pair: state.language_pair,
// Per-event idempotency key.
idempotency_key:
encounter_id + ":ended"
}
}])
// Downstream consumers maintain a DynamoDB
// deduplication table keyed on idempotency_key
// with a TTL on each record (typically 24 hours).
// On receipt of any event, the consumer checks the
// deduplication table before processing; duplicate
// deliveries (retry, at-least-once) are discarded.
encounter_table.update(
encounter_id: encounter_id,
ended_at: now(),
end_reason: end_reason,
status: "ended")
Curious how this looks in Python? The pseudocode above covers the concepts. If you'd like to see sample Python code that demonstrates these patterns using boto3, check out the Python Example. It walks through each step with inline comments and notes on what you'd need to change for a real deployment.
Expected Results
Sample encounter output (illustrative, synthetic encounter):
{ "encounter_id": "mi-9c1b4f2e-3d52-4e88", "patient_id_hash": "p_82a3c14e...", "clinician_id": "clinician_dr_patel", "language_pair": "es-MX_to_en-US_bidirectional", "declared_language": "es-MX", "declared_dialect": "Mexican Spanish", "encounter_type": "outpatient_routine_followup", "topic_category": "routine_clinical", "deployment_posture": "machine_with_human_standby", "started_at": "2026-05-23T14:02:11Z", "ended_at": "2026-05-23T14:23:47Z", "duration_seconds": 1296, "utterance_count": 84, "per_utterance_confidence_distribution": { "asr_patient_p50": 0.92, "asr_patient_p10": 0.78, "asr_clinician_p50": 0.95, "asr_clinician_p10": 0.84, "mt_p50": 0.88, "mt_p10": 0.71 }, "end_to_end_latency_distribution": { "p50_ms": 1480, "p95_ms": 2310, "p99_ms": 3120, "max_ms": 4870 }, "modes_used": ["machine"], "escalation_events": [ { "utterance_id": "u_47", "timestamp": "2026-05-23T14:14:32Z", "reason": "number_mismatch", "details": "source mentioned 25mg, translation rendered 250mg", "resolution": "human_interpreter_re_translated_segment", "human_interpreter_handle_time_seconds": 38 } ], "model_versions": { "asr_patient": "transcribe_streaming_es-MX_v3_with_med_vocab_v12", "asr_clinician": "transcribe_medical_conversational_v4", "mt_routine": "translate_es-MX_to_en-US_with_custom_terminology_v8", "mt_high_fluency": "bedrock_anthropic_claude_translation_prompt_v3", "tts_target_es-MX": "polly_lupe_neural" }, "consent_id": "consent_2026_05_23_p82a3c14e", "audio_retention_until": "2026-05-30T14:23:47Z" }
Performance benchmarks (illustrative; ranges depend heavily on language pair, deployment context, audio quality, and content category; your mileage will vary):
| Metric | English-Spanish | English-Mandarin | English-Vietnamese | English-Haitian Creole | English-low-resource (e.g., Karen) |
|---|---|---|---|---|---|
| ASR word error rate (clinical content, typical audio) | 5-9% | 8-14% | 10-18% | 12-22% | 18-35% |
| MT clinical-content quality (BLEU on curated medical eval set) | 38-46 | 32-40 | 28-36 | 25-33 | 15-25 |
| End-to-end latency (p50 ms) | 1300-1800 | 1500-2200 | 1700-2400 | 1800-2600 | 2200-3500 |
| End-to-end latency (p95 ms) | 2100-2900 | 2400-3300 | 2700-3600 | 2900-3900 | 3500-5500 |
| Escalation rate (machine-with-standby posture, routine clinical) | 4-9% | 7-13% | 10-18% | 12-22% | 30-55% |
| Number-and-unit verification block rate | 0.3-1.2% | 0.5-1.8% | 0.7-2.4% | 1.0-3.0% | 2.5-6.0% |
| Per-encounter AWS infrastructure cost (20-minute encounter) | $0.50-1.20 | $0.60-1.40 | $0.70-1.60 | $0.80-1.80 | $1.20-3.00 |
Where it struggles:
-
Drug name and dosing accuracy. Drug names sometimes translate, sometimes do not, sometimes have different brand names in different countries. Dosing language varies in subtle ways across languages ("twice daily" versus "every twelve hours" versus "in the morning and evening" all map to clinically equivalent regimens but the rendering matters). Mitigations: institution-curated drug-translation lexicon, number-and-unit verification as a hard gate, dosing-language standardization rules per language pair, structured-output verification for any segment containing a medication name, conservative confidence thresholds for medication content, mandatory human-interpreter review for new prescriptions in safety-critical contexts.
-
Cultural framing of clinical content. Bad-news disclosure varies across cultures, end-of-life discussions vary, mental-health vocabulary varies, reproductive-health framing varies. The system can render words faithfully and still produce content that is culturally inappropriate. Mitigations: human-only deployment posture for cultural-framing-sensitive content categories, cultural-competence training for clinicians who use the technology, in-room human cultural advisors where the patient population's cultural context warrants it, ongoing review by community advisory boards.
-
Idiomatic and figurative language. Patients describe symptoms with metaphors, hyperbole, and culturally-specific expressions that translate poorly word-for-word. Mitigations: idiom detection in the source-language transcript with explicit handling, LLM-based translation for figurative content, human-interpreter escalation for content the system cannot confidently handle, clinician training on the system's typical idiom-handling failures.
-
Long-tail languages with limited training data. Languages with smaller speaker populations and limited commercial investment have lower ASR and MT quality. Mitigations: per-pair quality evaluation as a launch gate, multi-vendor strategy with the best-performing vendor selected per pair, fallback to human-only interpretation for pairs that do not meet the threshold, ongoing investment in evaluation-set expansion and model improvement for the pairs the institution serves.
-
Code-switching. Many bilingual patients mix two languages within a single utterance. The pipeline that assumes monolingual input fails on these utterances. Mitigations: per-pair code-switching evaluation, vendors with code-switching-aware ASR where available, conservative confidence thresholds on code-switched segments, human-interpreter escalation when code-switching is detected if the system cannot confidently handle it.
-
Pediatric and elderly speech. ASR systems are tuned predominantly for adult speakers in a typical age range. Pediatric speech (smaller vocal tract, developmental phonology) and elderly speech (vocal-quality changes, dental-related articulation differences, speech changes related to neurological conditions) both see worse ASR accuracy. Mitigations: age-appropriate ASR configurations where vendors offer them, conservative confidence thresholds on pediatric and geriatric audio, lower escalation thresholds for these demographic slices.
-
Audio quality variability. Telephonic audio over poor cellular connections, in-person audio in noisy clinic environments, telehealth audio over consumer-grade microphones, all produce audio quality that varies substantially. Mitigations: per-stream audio quality assessment with feedback to capture devices, noise suppression and echo cancellation at the capture path, conservative confidence thresholds on low-quality audio, recapture prompts where the deployment supports them, room-acoustics improvements for high-volume in-person sites.
-
Latency budget exhaustion under load. When the system is busy or when a particular vendor service is slow, end-to-end latency can exceed the conversational budget. Mitigations: per-pair latency budgets with alerting on overruns, fallback paths to alternate vendors when primary is slow, graceful degradation (the conversation continues but the latency erodes the user experience), user-visible indicators when latency is degraded, automatic escalation to human interpreter when latency budget is repeatedly exceeded within an encounter.
-
Patient understanding of the technology. Patients who do not understand that the interpretation is machine-mediated may behave differently than they would with a human interpreter (more guarded, less detailed, less likely to share sensitive information; or conversely, more candid in ways that reflect a different mental model of the privacy implications). Mitigations: clear and culturally-appropriate consent disclosure in the patient's language, opt-in confirmation rather than passive acceptance, clear right to request human interpreter at any time without delay or care degradation, regular review of patient feedback on the experience.
-
Clinician trust calibration. Clinicians who do not understand the system's failure modes may over-trust the technology in cases where it is failing silently, or under-trust the technology in cases where it is performing well and slow them down for no benefit. Mitigations: clinician training on the system's typical failure modes, surfacing of confidence and uncertainty signals to the clinician interface, consistent feedback from clinicians on edge cases that drive improvements, regular review of clinical-quality data with the clinician community.
-
Workforce displacement and human-interpreter pipeline erosion. A deployment that deliberately reduces human-interpreter staffing on the basis of cost savings can erode the trained-interpreter workforce that the institution needs for the cases where machines cannot safely operate. Mitigations: explicit reinvestment of cost savings into human-interpreter quality (training, compensation, technology to support human interpreters), partnership with the interpreter community on deployment design, scope-limited deployment that explicitly preserves human-interpreter roles for safety-critical encounters, sustained investment in interpreter training programs and certification pipelines.
-
Regulatory uncertainty. Federal language-access requirements, state qualified-interpreter rules, and the broader regulatory framework that explicitly addresses machine interpretation are still developing. Mitigations: institutional legal review of the deployment posture per topic category, ongoing tracking of OCR guidance and state regulatory developments, conservative deployment posture that errs toward human interpretation in safety-critical contexts, documentation of deployment decisions sufficient to defend the institutional posture if challenged.
-
Liability concentration at the moment of utterance. The legal framework for assigning liability when machine interpretation produces a clinical error is unsettled. Mitigations: institutional legal review and explicit risk acceptance per topic category, vendor BAA and indemnification clauses, clinician documentation of the use of machine interpretation per encounter, clear deployment posture that limits machine-only mode to topic categories where the institution has accepted the risk.
-
Audio-quality and dialect variations within a single language code. A language code like "es-MX" covers Mexican Spanish but not Caribbean Spanish, Castilian, or other variants; speakers of those variants who are routed to es-MX models may see worse accuracy. Mitigations: per-dialect identification at intake where possible, fallback strategies when the patient's dialect does not match the system's configuration, ongoing dialect-coverage expansion based on the patient population.
-
Long-form encounters with topic shifts. A 45-minute encounter that starts as a routine refill discussion and shifts to a complex new diagnosis halfway through has a content category that the topic_category classification at session start does not capture. Mitigations: ongoing topic-category monitoring during the encounter with deployment-posture re-evaluation if the topic shifts, clinician-initiated escalation when the conversation moves into safety-critical content, explicit topic-shift detection with prompts to the clinician.
Why This Isn't Production-Ready
The pseudocode and architecture above demonstrate the pattern. A production deployment for any specific language pair and topic category needs to close substantial gaps that are out of scope for a recipe.
Per-pair clinical validation evidence. This is the dominant gap. Each language pair, in each direction, on representative medical content, against a curated evaluation set, with measured accuracy on number-and-unit content, drug names, anatomical terms, and cultural-framing-sensitive content. Per-pair validation is a launch gate; pairs without adequate validation do not deploy in machine-mediated mode at all.
Curated medical-vocabulary and parallel-corpus assets per language pair. Custom Vocabulary lists for ASR, Custom Terminology lists for Translate, Active Custom Translation parallel corpora, Polly pronunciation lexicons. These are institutional assets that require ongoing curation by the language-access team in collaboration with clinical specialty leaders. Building them is a multi-month workstream per pair, with ongoing maintenance.
Human-interpreter pool integration. The escalation pathway requires real integration with the institutional human-interpreter program or the contracted vendor's pool. The integration includes routing, briefing, audio transfer, billing reconciliation, and audit. Production deployment requires this integration to work reliably; the demo deployment that simulates the human pool with a placeholder is not production-ready.
Federal and state language-access compliance documentation. The institutional language-access program is regulated by Title VI, Section 1557, and state-level qualified-interpreter requirements. The technology deployment is part of the institutional language-access program; the program documentation must reflect the deployment posture, the topic-category mapping, the human-interpreter availability, and the patient-rights communication. Compliance documentation is owned by the institutional compliance office in collaboration with the language-access program manager.
Patient-facing consent flow validation across the patient population. The consent disclosure must be comprehensible to the patient in their declared language, must accurately convey the machine-mediated nature of the interpretation, and must clearly preserve the patient's right to request human interpretation. The consent flow is validated per language with native speakers, with attention to literacy levels and cultural framing. A consent flow that works in English does not necessarily work in twelve other languages.
Clinician training and adoption support. Clinicians need training on when to use the technology, when not to, how to recognize failure modes, how to escalate, and how to document their use of the technology in the medical record. The training is per-specialty (primary care, emergency medicine, behavioral health, ob-gyn, pediatrics, etc.) because the deployment posture and the failure modes vary by specialty. Sustained training, peer-support communities, and feedback channels are part of the production deployment.
Per-pair and per-population disparity monitoring. Continuous monitoring of accuracy stratified by language pair, dialect, patient demographic, and clinical content category. Alerts on disparity widening, on per-pair regression, on vendor-update-triggered quality changes. This is operational discipline, not a project deliverable.
LLM faithfulness scaffolding for translation. When the architecture uses Bedrock LLM-based translation for any pairs or content categories, the same faithfulness scaffolding from recipe 2.6 (clinical note summarization) and recipe 2.10 (multi-modal clinical reasoning) applies: structured-output validation, citation grounding to source segments, secondary verification by independent models, prompt-injection defense via Guardrails. The LLM-translation path is not a free fluency upgrade; it inherits LLM hallucination concerns that need active management.
Disaster recovery and degraded-mode operation. When upstream vendor services fail (Transcribe outage, Translate outage, Polly outage, third-party vendor outage), the system must degrade gracefully: automatic failover to alternate vendors per pair where available, automatic escalation to human-only interpretation when the machine pipeline is unavailable, durable session state that survives transient failures, clear user-facing communication about the degraded mode. Quarterly disaster-recovery testing is part of production operation.
Audio biometric data governance. Voice samples are biometric. The institutional biometric-data posture (BIPA, CUBI, Washington biometric law, GDPR Article 9 for EU patients) applies to all captured audio. Voiceprint storage for clinician enrollment (where used) is a separate biometric class with explicit governance. The institutional privacy officer, in collaboration with the language-access program and the technology team, owns the biometric-data policy and its implementation in the deployment.
Workforce model and human-interpreter staffing strategy. The technology deployment is one component of a broader language-access strategy that includes bilingual clinician recruitment, human-interpreter staffing, telephonic and video remote interpretation contracts, and patient-facing language services. The institutional staffing model has to balance these components, accounting for the technology's appropriate scope, the human-interpreter coverage required for safety-critical encounters, and the long-term workforce pipeline. Production deployment is part of the staffing strategy; it is not a substitute for the staffing strategy.
Vendor and engine selection per pair with explicit fallback strategy. Each pair has a primary vendor and a fallback strategy when the primary is unavailable or underperforming. The selection is reviewed regularly as vendor capabilities evolve. The fallback strategy is tested under load. Production deployment requires the multi-vendor architecture with active monitoring and proven fallback paths.
Continuous quality review with clinical-quality leadership. A regular cadence of clinical-quality review meetings, attended by clinical-quality leadership, the language-access program manager, the privacy officer, and the technology team, with the per-pair quality data, the escalation patterns, the patient and clinician feedback, and the disparity analysis on the table. This is not a launch checklist; it is a sustained operational discipline.
Cross-cultural advisory and community engagement. A community advisory board representing the patient populations served, with regular review of the deployment, the consent flow, and the patient experience. Community engagement is part of the responsible-deployment posture; it surfaces failure modes that the internal evaluation process does not catch.
Variations and Extensions
Telephonic patient-self-service flow. A focused deployment for inbound patient phone calls (appointment scheduling, refill requests, billing questions) where machine interpretation handles the entire interaction, with explicit opt-in to human interpretation at any moment. The lowest-stakes deployment posture, with the simplest consent flow and the most aggressive cost-and-time savings. Patient self-service flows in the patient's preferred language are one of the highest-value low-stakes deployments.
Outbound patient communication translation. Discharge summaries, after-visit summaries, patient-portal messages, appointment reminders, refill reminders, and other outbound communications translated into the patient's preferred language. Asynchronous rather than real-time, but using the same translation infrastructure with appropriate per-pair quality controls. Recipe 2.2 (Medical Terminology Simplification) and recipe 2.5 (After-Visit Summary Generation) cover related patterns; the translation layer extends them to multilingual patient populations.
In-person clinic deployment with shared room device. A focused deployment for in-clinic encounters using a shared device (tablet, dedicated capture device) with both speakers using the same audio path. Lower per-encounter cost than telephonic. Higher complexity in audio capture (room acoustics, multi-speaker diarization). The deployment context that benefits most from clinician training and workflow integration.
Telehealth visit deployment with per-participant audio. A focused deployment for telehealth visits where each participant has their own device and audio channel, simplifying diarization and improving audio quality compared to in-person shared-device deployment. Integrates with the institutional telehealth platform via Chime SDK or third-party telehealth vendor APIs.
Emergency department triage deployment. A focused deployment for ED triage and initial encounters where rapid response matters and where the topic category is typically routine clinical with potential for safety-critical content. Pre-staged human-interpreter standby for high-volume languages. Aggressive escalation thresholds. Clinician training on the specific failure modes most relevant to ED workflow.
Inpatient bedside deployment. A focused deployment for inpatient encounters with a bedside device. Long-running encounters with multiple visits per day, multiple speakers (clinicians, nurses, family members), and changing topic categories over the course of an admission. Particularly valuable for long-stay patients whose family or interpreter availability varies day to day.
Behavioral health visit deployment with strict guardrails. A specialized deployment for behavioral health visits with conservative deployment posture (machine-with-human-on-standby at minimum, often human-primary for crisis content), strict audit retention, explicit patient consent at each visit (rather than blanket consent), and content-category gates that preclude machine-only mode for crisis content.
Pediatric encounter deployment with parent-translator handling. A specialized deployment for pediatric encounters where the parent is the primary patient-side speaker for the child's clinical content but the child themselves may also speak. The system handles three speakers (clinician, parent, child) with explicit role assignment. The parent's consent for machine-mediated interpretation also extends to the child per the institutional consent model.
Multilingual clinician-patient matching. Use the language-pair infrastructure to also support patient matching with bilingual clinicians where available. Patients whose preferred language matches a bilingual clinician's languages are routed to that clinician directly; the technology serves the cases where bilingual clinician matching is not available.
Patient education content translation pipeline. A separate asynchronous pipeline for translating institutional patient education content (brochures, videos, web content, mobile-app content) into the supported languages, with the same medical-vocabulary curation and per-pair quality controls. The asynchronous pipeline allows higher quality through human review and iteration; the real-time pipeline benefits from the curated assets developed for asynchronous translation.
Clinician-facing summary of patient utterances. During the encounter, in addition to the bidirectional translation, the system provides the clinician with a structured summary of the patient's utterances (chief complaint, key symptoms, key history elements, key concerns) drawn from the source-language transcript. This is similar to the ambient documentation pattern from recipe 10.7 but focused on the patient's content specifically; it helps the clinician track key information across language barriers.
Multilingual ambient documentation. Combine recipe 10.7 (Ambient Clinical Documentation) with this recipe to capture multilingual encounters and produce structured documentation in the institution's preferred language. Substantial complexity: per-language ASR, faithful translation, per-language documentation conventions, and the consent and audit considerations of both recipes apply. Production deployments are emerging.
Multilingual patient-facing voice assistant. Combine recipe 10.5 (Patient-Facing Voice Assistant) with this recipe to provide voice-assistant capabilities in the patient's preferred language. The voice assistant's intent vocabulary, slot vocabulary, and response generation all need per-language support; the medical-interpretation infrastructure provides the language-pair foundation.
Multilingual IVR and call routing. Combine recipe 10.1 (IVR Call Routing Enhancement) with this recipe to provide language-detection-and-routing at the start of inbound calls, with the call's full content interpreted in the patient's preferred language thereafter. Reduces the friction of the institutional language-access program at the front-door step that currently routes through human-language-line transfers.
Multilingual consent for clinical research enrollment. A specialized deployment for clinical-research enrollment where the patient's consent for research participation is captured in their preferred language with the same rigor as the consent for clinical care. Higher regulatory exposure (the research consent is governed by IRB requirements in addition to language-access requirements), and typically deployed in human-primary-with-machine-assistance posture.
Per-pair and per-encounter cost analytics for the language-access program. The audit data captured per encounter supports detailed cost analytics for the language-access program: cost per encounter by pair, cost per encounter by topic category, cost per encounter by deployment posture, savings versus the human-only baseline, reinvestment of savings in human-interpreter quality. The analytics support the program management and the institutional reporting to leadership.
Interpreter-quality analytics with machine output as a baseline. When the architecture has both machine-translation output and human-interpreter output for the same encounter (in hybrid posture), the audit data supports interpreter-quality analytics: where do machine and human interpretations differ, where are the systematic differences in framing, where do machine outputs reveal pattern errors that the human interpreter catches. This is a research-track use of the data with appropriate IRB and consent considerations.
Patient feedback capture in patient's language. Post-encounter patient feedback captured in the patient's preferred language using the same translation infrastructure. The feedback informs the per-pair quality monitoring and the patient-experience analytics. Capturing feedback in the patient's language rather than only in English produces meaningfully better signal on the patient-experience dimensions that matter.
Cultural-competence advisory for clinician users. A clinician-facing capability that surfaces cultural-context information relevant to the encounter (cultural framing of bad news, decision-making norms, dietary or religious considerations, family-involvement expectations) drawn from a curated cultural-competence knowledge base. The technology does not solve cultural competence on its own; it can scaffold the clinician's awareness of considerations they might otherwise miss.
Interpreter training and feedback environment. A training environment for newly-certified medical interpreters that uses the audit data from machine-mediated encounters as training material (with appropriate consent and de-identification). The interpreters score the machine output, identify failure modes, and develop their interpretation expertise on real clinical content. A workforce-development extension that the institution can offer in partnership with interpreter-training programs.
Additional Resources
AWS Documentation:
- Amazon Transcribe Developer Guide
- Amazon Transcribe Medical Developer Guide
- Amazon Transcribe Streaming Transcription
- Amazon Transcribe Custom Vocabulary
- Amazon Translate Developer Guide
- Amazon Translate Custom Terminology
- Amazon Translate Active Custom Translation
- Amazon Polly Developer Guide
- Amazon Polly Neural and Generative Voices
- Amazon Polly Lexicons
- Amazon Bedrock User Guide
- Amazon Bedrock Guardrails
- Amazon Connect Administrator Guide
- Amazon Chime SDK Developer Guide
- AWS Lambda Developer Guide
- AWS Step Functions Developer Guide
- AWS HIPAA Eligible Services Reference
AWS Sample Repos:
aws-samples/amazon-transcribe-streaming-python: Transcribe streaming and async-job samplesaws-samples/amazon-translate-samples: Translate API samples including custom terminologyaws-samples/amazon-bedrock-samples: Bedrock invocation patterns including grounded generation and Guardrailsaws-samples/amazon-chime-sdk-recording: Chime SDK samples including real-time audio handlingaws-samples/aws-healthcare-lifescience-ai-ml-sample-notebooks: healthcare AI/ML sample notebooks
AWS Solutions and Blogs:
- AWS Machine Learning Blog: search "Transcribe," "Translate," "Polly," "Bedrock translation" for implementation deep dives
- AWS for Industries: Healthcare and Life Sciences Blog: healthcare-specific AI/ML case studies
- AWS Solutions Library (filter Healthcare and Life Sciences): browse for language-access reference architectures
External References (Standards, Regulatory, and Professional):
- HHS Office for Civil Rights: Limited English Proficiency: federal language-access requirements under Title VI
- HHS OCR Section 1557 Final Rule: nondiscrimination requirements for federally-funded healthcare programs, including language-access provisions
- LEP.gov: federal interagency working group on limited English proficiency
- National Council on Interpreting in Health Care (NCIHC): professional organization for medical interpreters; National Code of Ethics and National Standards of Practice
- International Medical Interpreters Association (IMIA): international professional organization for medical interpreters
- California Healthcare Interpreting Association (CHIA): California-specific medical interpreter professional organization with published standards
- Certification Commission for Healthcare Interpreters (CCHI): certifying body for medical interpreters
- National Board of Certification for Medical Interpreters (NBCMI): another certifying body for medical interpreters
- Joint Commission Standards for Patient-Centered Communication: healthcare-accreditation standards including language-access requirements
- HIPAA Privacy Rule: governs PHI in interpretation workflows
- HIPAA Security Rule: governs technical and administrative safeguards
- Illinois Biometric Information Privacy Act (BIPA): biometric-data law applicable to voice samples in Illinois
- Texas Capture or Use of Biometric Identifier Act (CUBI): biometric-data law applicable in Texas
- Washington Biometric Privacy Law: biometric-data law applicable in Washington
- GDPR Article 9: EU regulation on processing of biometric and health data
Standards and Frameworks:
- HL7 FHIR Specification: healthcare data interoperability framework, including patient-language and communication-preference resources
- FHIR Patient Communication Preferences: canonical FHIR resource for capturing patient language preferences
- ISO 13611 (Community interpreting): international standard for community interpreting that includes healthcare contexts
- ASTM F2089 (Standard Practice for Language Interpreting): U.S. standard practice for language interpreting
Research and Industry Resources:
- Migration Policy Institute Language Access Resources: research on language access in healthcare and other public services
- Robert Wood Johnson Foundation Language Access Reports: healthcare-equity research including language access
- Health Affairs Blog: peer-reviewed analysis including language-access policy
- JAMA Health Forum: peer-reviewed health-policy and health-services research
Estimated Implementation Time
| Tier | Scope | Time |
|---|---|---|
| Basic | Single language pair (typically English-Spanish), single deployment context (typically telephonic patient-self-service for refill requests and appointment scheduling), Amazon Transcribe and Translate with basic Custom Vocabulary and Custom Terminology, Polly neural voice for the patient direction, simple consent flow, audit logging, brief audio retention, machine-only deployment posture for low-stakes content categories, pilot with one patient population segment | 4-6 months |
| Production-ready | Multiple validated language pairs covering the institution's top-volume languages (typically Spanish, Mandarin, Vietnamese, Tagalog, Russian, Arabic, Korean, Haitian Creole, Portuguese, French and one or two more depending on patient population), multiple deployment contexts (telephonic, in-person, telehealth), differentiated deployment postures per topic category (machine-only for administrative, machine-with-human-standby for routine clinical, human-primary for safety-critical), full per-pair validation with launch gates, hybrid Translate-and-Bedrock translation pipeline with faithfulness checks, number-and-unit verification as hard gates, seamless human-interpreter handoff with institutional pool integration, consent flow validated per language with native speakers, full HIPAA-and-state-biometric-law compliance review, multi-context rollout with named operational owners, language-access program integration, clinician training program, per-pair quality and disparity monitoring with regular clinical-quality review meetings | 18-30 months |
| With variations | Outbound patient communication translation, in-person clinic shared-device deployment, telehealth visit deployment, ED triage deployment, inpatient bedside deployment, behavioral health deployment with strict guardrails, pediatric encounter deployment, multilingual ambient documentation, multilingual patient-facing voice assistant, multilingual IVR and call routing, clinical-research enrollment consent in patient's language, cultural-competence advisory for clinicians, interpreter training environment, per-pair cost analytics, patient feedback capture in patient's language, expansion to additional language pairs as patient population evolves | 12-24 months beyond production-ready |
โ Main Recipe 10.10 ยท Python Example ยท Chapter Preface