基于 Vue 3 和 Vite 构建的医疗诊断助手前端应用,集成了 AssistDoctor 大模型,提供智能对话和疾病诊断功能。
- 💬 智能对话:用户可以输入疾病相关问题,AssistDoctor 会提供专业的医疗建议和回答
- 🔬 智能诊断:基于用户输入的电子病历文本信息,诊断患者可能的疾病
- 📋 患者信息管理:显示和管理患者基本信息
- 🎨 现代化界面:美观、响应式的用户界面设计
- Vue 3 (Composition API)
- Vite
- JavaScript
src/
├── api/
│ └── assistDoctor.js # AssistDoctor API 接口调用
├── components/
│ ├── ChatPanel.vue # 对话面板组件
│ ├── DiagnosisPanel.vue # 诊断面板组件
│ └── PatientInfo.vue # 患者信息组件
├── App.vue # 主应用组件
└── main.js # 应用入口
API 接口调用位置在 src/api/assistDoctor.js 文件中,包含以下接口:
- sendMessage(message, history) - 发送对话消息
- diagnoseDisease(medicalRecord) - 基于病历进行诊断
- getDiagnosisBasis(disease, medicalRecord) - 获取诊断依据
在 src/api/assistDoctor.js 中修改 API_BASE_URL:
const API_BASE_URL = 'http://ip:port/api'POST /api/assist-doctor/chat
请求体:
{
"message": "用户的问题",
"history": [
{"role": "user", "content": "..."},
{"role": "assistant", "content": "..."}
]
}响应:
{
"answer": "AI 的回答内容"
}POST /api/assist-doctor/diagnose
请求体:
{
"medical_record": "电子病历文本"
}响应:
{
"diseases": [
{"name": "疾病名称", "probability": 0.85}
],
"confidence": 0.85,
"reasoning": "诊断分析"
}POST /api/assist-doctor/basis
请求体:
{
"disease": "疾病名称",
"medical_record": "电子病历文本"
}响应:
{
"basis": "诊断依据",
"suggestions": ["建议1", "建议2"]
}VS Code + Vue (Official) (and disable Vetur).
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
- Firefox:
See Vite Configuration Reference.
npm installnpm run devnpm run build