Files
vueapp/dist/assets/chat.CREdEGEh.js
T

2 lines
19 KiB
JavaScript
Raw Normal View History

2026-06-08 17:34:22 +08:00
import{D as e,d as a,b as l,a as t,c as s,o as n,e as o,f as i,g as c,C as r,w as u,j as d,k as m,t as f,m as p,p as g,F as h,n as _,l as v,h as b,u as y,z as k,A as w,y as x,S as $,x as C,I as V,K as D}from"./index-BYZeXb15.js";import{_ as O}from"./config-doctor.TgARj_nM.js";import{c as F}from"./navigation.DDtmshLK.js";import S from"./pages-diagnosis-diagnosis.DwV73rtb.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";const E={id:"case-1006004",title:"持续胸痛3小时",patientName:"陈先生",gender:"男",age:60,department:"心血管内科",scene:"住院部",caseNo:"1006004",tone:"orange",mode:"training"};function I(){const a=e("clinical-thinking-access-token");if("string"!=typeof a||!a.trim())throw new Error("登录已过期,请重新登录");return a}function T(e="application/json"){return{"Content-Type":"application/json",Accept:e,Authorization:`Bearer ${I()}`,"X-Entry-Scene":"vue_frontend"}}async function A(e){const a=await e.text().catch((()=>""));if(!a)return`请求失败(${e.status}`;try{const e=JSON.parse(a),l=e.message||e.detail||e.error;if("string"==typeof l&&l.trim())return l}catch{}return a}async function P(e){var a;const l=await fetch("/fastapi/api/v1/sessions",{method:"POST",headers:T(),body:JSON.stringify(e)});if(!l.ok)throw new Error(await A(l));const t=await l.json();if("OK"!==t.code||!(null==(a=t.data)?void 0:a.session_id))throw new Error(t.message||"新建会话失败");return t.data}const N=j(a({__name:"chat",props:{caseItem:{}},emits:["open-settings","open-profile","go-home"],setup(a,{emit:j}){const I=a,P=j,N=F(P),U=l({patient:{name:"陈先生",gender:"男",age:60,department:"心血管内科",chiefComplaint:"持续胸痛3小时"},stages:[{key:"history",label:"病史采集",active:!0},{key:"diagnosis",label:"初步诊断",active:!1},{key:"treatment",label:"治疗方案",active:!1}],messages:[]}),J=t(""),q=t(!1),z=t(!1),H=t(0),M=t(""),R=t(!1),X=t(!1),B=t(!1),K=t(!1),G=t(null);let Q=null,L=null,W=null;const Y=[{name:"心电图",result:"检查结果:床边12导联心电图提示窦性心律,II、III、aVF 导联 ST 段抬高,提示下壁急性心肌梗死可能。"},{name:"胸部X线",result:"检查结果:胸部X线未见明显气胸或纵隔明显增宽,心影大小基本正常,不能排除急性冠脉综合征。"},{name:"心脏超声",result:"检查结果:心脏超声提示左室下壁节段性运动减低,未见大量心包积液,需结合心电图及心肌标志物判断。"},{name:"冠脉CTA",result:"检查结果:冠脉CTA提示右冠状动脉近段重度狭窄/闭塞可能,建议结合急诊介入评估。"}],Z=l({temperature:"",pulse:"",respiration:"",bloodPressure:"",spo2:"",complexion:"",examFinding:"",otherFinding:""}),ee=s((()=>U.patient.chiefComplaint.includes("胸痛")?"胸痛":U.patient.chiefComplaint.slice(0,6)));function ae(){K.value=!1,B.value=!0}function le(){B.value=!1,K.value=!0}function te(){const e=[Z.temperature.trim()?`体温 ${Z.temperature.trim()}`:"",Z.pulse.trim()?`心率 ${Z.pulse.trim()}次/分`:"",Z.respiration.trim()?`呼吸 ${Z.respiration.trim()}次/分`:"",Z.bloodPressure.trim()?`血压 ${Z.bloodPressure.trim()}mmHg`:"",Z.spo2.trim()?`血氧 ${Z.spo2.trim()}%`:"",Z.complexion.trim()?`意识/面色:${Z.complexion.trim()}`:"",Z.examFinding.trim()?`心肺/腹部查体:${Z.examFinding.trim()}`:"",Z.otherFinding.trim()?`其他发现:${Z.otherFinding.trim()}`:""].filter(Boolean);if(0===e.length)return void re("请至少录入一项体格检查");const a=Date.now(),l=[{id:`doctor-physical-${a}`,role:"doctor",content:`录入体格检查:${e.join("")}`,label:"我"},{id:`mentor-physical-${a+1}`,role:"mentor",content:se(),label:"AI助手"}];U.messages.push(...l),K.value=!1,Z.temperature="",Z.pulse="",Z.respiration="",Z.bloodPressure="",Z.spo2="",Z.complexion="",Z.examFinding="",Z.otherFinding="",ce()}function se(){const e=Number(Z.pulse),a=Number(Z.respiration),l=Number(Z.spo2),t=Number(Z.temperature),s=[];e>=100&&s.push("心率偏快"),a>=22&&s.push("呼吸频率偏快"),l>0&&l<95&&s.push("血氧偏低"),t>=37.3&&s.pu