feat: add reviewed follow-up audio patient enrichment

This commit is contained in:
2026-09-29 15:44:30 +08:00
parent 3cdc812f2b
commit 70be2fc70f
46 changed files with 7384 additions and 246 deletions
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace app\common\service\followupaudio;
/** Only stable public codes/messages. Never propagate a response body, URL, key or clinical text. */
final class FollowupAudioException extends \RuntimeException
{
public string $errorCode;
public bool $uncertain;
public function __construct(string $errorCode, bool $uncertain = false)
{
$this->errorCode = $errorCode;
$this->uncertain = $uncertain;
$messages = [
'CONFIG_MISSING' => '当前 Dify 应用凭据未配置,音频能力尚未验证',
'FEATURE_DISABLED' => '随访音频功能未启用',
'AUDIO_NOT_VERIFIED' => '当前应用尚未通过音频能力验证',
'AUDIO_NOT_PROCESSED' => '上游未确认读取原始音频,未生成可采用结果',
'UPSTREAM_UNCERTAIN' => '上游结果未知,请先核对任务或计费,禁止重复提交',
'RECONCILIATION_REQUIRED' => '任务已有上游请求,须先人工核对,禁止重复提交',
'UPSTREAM_SCHEMA_INVALID' => '上游未返回完整、可核验的结构化音频事实',
'UPSTREAM_AUDIO_REJECTED' => '当前 Dify 应用拒绝音频附件,未降级为纯文本',
'LEASE_LOST' => '任务租约或访问权限已失效',
'ACCESS_REVOKED' => '执行权限已撤销',
'UPSTREAM_AUDIO_LIMIT' => '录音处理副本仍超出已配置的上游限制,未发送,请联系管理员',
'AUDIO_NORMALIZATION_FAILED' => '录音兼容处理失败,原件已保留且未发送,请检查 FFmpeg',
'AUDIO_NORMALIZATION_TIMEOUT' => '录音兼容处理超时,原件已保留且未发送',
'AUDIO_INVALID' => '音频文件无效、发生变化或超出限制',
];
parent::__construct($messages[$errorCode] ?? '随访音频处理失败,请检查服务配置或任务状态');
}
}