更新
This commit is contained in:
@@ -8647,17 +8647,14 @@ class ReceptionPage(QWidget):
|
||||
task=diagnosis_ai_task(prompt),
|
||||
)
|
||||
|
||||
def _open_ai_consult(self) -> None:
|
||||
if not self._can_ai_assistant:
|
||||
show_toast(self, "当前账号没有使用 AI 问诊助手的权限。", "danger")
|
||||
return
|
||||
if self._detail_loading:
|
||||
show_toast(self, "患者病历仍在加载,请稍候。", "warning")
|
||||
return
|
||||
def open_selected_ai_consult(self) -> bool:
|
||||
"""Open AI chat only when the reception selection has a diagnosis."""
|
||||
|
||||
if not self._can_ai_assistant or self._detail_loading:
|
||||
return False
|
||||
context = self._selection_context()
|
||||
if context is None or context[2] is None:
|
||||
show_toast(self, "当前患者缺少诊单编号。", "danger")
|
||||
return
|
||||
return False
|
||||
seed = self._selected_detail or self._selected_record or {}
|
||||
present_ai_consult(
|
||||
self.repository,
|
||||
@@ -8668,6 +8665,17 @@ class ReceptionPage(QWidget):
|
||||
seed=seed,
|
||||
source_title="接诊台",
|
||||
)
|
||||
return True
|
||||
|
||||
def _open_ai_consult(self) -> None:
|
||||
if self.open_selected_ai_consult():
|
||||
return
|
||||
if not self._can_ai_assistant:
|
||||
show_toast(self, "当前账号没有使用 AI 问诊助手的权限。", "danger")
|
||||
elif self._detail_loading:
|
||||
show_toast(self, "患者病历仍在加载,请稍候。", "warning")
|
||||
else:
|
||||
show_toast(self, "请先选择一位有诊单的患者。", "warning")
|
||||
|
||||
def _open_ai_report(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user