From 78bcdef7fd0d7f570e154388c8f692d4c73a71e9 Mon Sep 17 00:00:00 2001 From: zhugeliang Date: Thu, 23 Apr 2026 09:09:03 +0800 Subject: [PATCH] fix: resolve #407 examination request wrong advice type classification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug #407: 检查申请同步到医嘱列表时,医嘱类型被错误标注为中成药而非诊疗 Root cause: ServiceRequest.categoryEnum was not set when creating service requests from examination applications, causing the system to misclassify them as Chinese medicine (adviceType=2) instead of medical treatment (adviceType=3) Fix: Added serviceRequest.setCategoryEnum(3) in both POST and PUT methods of ExamApplyController to correctly classify examination requests as medical treatment type Impact: Examination requests will now display correct type (诊疗/medical treatment) in the advice list and won't trigger database errors when signing --- .../com/openhis/web/check/controller/ExamApplyController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/ExamApplyController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/ExamApplyController.java index 4e857d57..15d130b9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/ExamApplyController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/ExamApplyController.java @@ -212,6 +212,8 @@ public class ExamApplyController extends BaseController { // 检查申请不走诊疗定义,设置为0占位(数据库有NOT NULL约束) serviceRequest.setActivityId(0L); + // 🔧 Bug #407修复:设置医嘱类型为诊疗(3),避免被错误识别为中成药 + serviceRequest.setCategoryEnum(3); // 患者和就诊信息 —— 使用前端传递的数字型ID if (dto.getPatientIdNum() != null) { @@ -389,6 +391,8 @@ public class ExamApplyController extends BaseController { serviceRequest.setBasedOnTable("exam_apply"); serviceRequest.setBasedOnId(examApply.getId()); serviceRequest.setActivityId(0L); + // 🔧 Bug #407修复:设置医嘱类型为诊疗(3),避免被错误识别为中成药 + serviceRequest.setCategoryEnum(3); if (dto.getPatientIdNum() != null) { serviceRequest.setPatientId(dto.getPatientIdNum());