Compare commits

...

3 Commits

Author SHA1 Message Date
4e9c1a9716 fix(#765): 请修复 Bug #765
根因:
- `@mousedown.prevent` 阻止了 input 的默认失焦行为
- `handleBlur` 中的 `showPopover.value = false` 永远不会被触发
- 患者选择后浮窗持续显示

修复:
- 在 `selsectPatient` 函数末尾(第 2240 行)添加一行:
- ```javascript
- showPopover.value = false;
- 变更文件**:`healthlink-his-ui/src/views/charge/outpatientregistration/index.vue`(+1 行)
- 验证结果**:`npm run build:dev` 编译通过,0 error。
- 全链路 6 环检查**:
- | 环 | 状态 | 说明 |
- |---|---|---|
- | ① 录入 |  | 患者列表点击触发 `selsectPatient` |
- | ② 验证 |  | 无后端验证逻辑变更 |
- | ③ 业务 |  | 表单回填逻辑不受影响 |
- | ④ 持久化 |  | 不涉及数据库 |
- | ⑤ 存储 |  | 不涉及 |
- | ⑥ 联动 |  | 关闭浮窗不影响下游流程 |
- Review ---
- Now I have the full context. Let me write the review.
- ## Bug #765 代码审查报告
- ### 变更内容
- 文件**: `healthlink-his-ui/src/views/charge/outpatientregistration/index.vue` (+1 行)
- ```diff
- function selsectPatient(row) {
- Object.assign(form.value, row);
- form.value.patientId = row.id;
- // ... 字段赋值 ...
- form.value.identifierNo = row.identifierNo;
- +  showPopover.value = false;
- `selsectPatient` 是 `patientList` 组件 `@selsect-patient` 事件的回调,选择患者后关闭浮窗是预期行为。
- ### 现有 showPopover 生命周期
- | 位置 | 行为 |
- |------|------|
- | `handleFocus` (L1991) | `showPopover.value = true` — input 获焦打开浮窗 |
- | `handleBlur` (L1997) | `showPopover.value = false` — input 失焦关闭(因 `@mousedown.prevent` 被阻断) |
- | `selsectPatient` (L2239, 新增) | `showPopover.value = false` — 选择患者后关闭浮窗  |
- 三处逻辑互不冲突,`selsectPatient` 中的关闭调用是 `handleBlur` 被阻断后的必要补偿。
- ### 发现的问题
- | # | 问题 | 严重度 |
- |---|------|--------|
- scope 应对应实际变更) | 中 |
- ### 评分
- | 维度 | 分数 | 说明 |
- |------|------|------|
- | 功能性 | 5/5 | 选择患者后浮窗正确关闭,`form` 数据回填不受影响 |
- | 风格一致性 | 4/5 | 与现有 `handleFocus`/`handleBlur` 中的赋值方式一致;注释风格未标注 Bug 编号(项目中其他 fix 常带 Bug 编号注释) |
- | **总分** | **18/20** | **功能性 5 ≥ 3,总分 18 ≥ 12** |
- ### 改进建议(非阻塞)
- 1. **Commit 拆分**:应将 Bug #765 的 Vue 变更与 Bug #764 的 Java 变更拆为独立 commit,各自对应正确的 commit message
- 2. 可选:在 `showPopover.value = false;` 上方加一行注释说明为何需要手动关闭(`@mousedown.prevent` 阻断了 `handleBlur`)
- VERDICT: PASS
- Test ---
- ## Bug #765 QA 测试报告
- ### Bug 概述
- 标题**: 门诊挂号页面选中患者后浮窗未自动关闭
- 在 `selsectPatient()` 末尾添加 `showPopover.value = false;`(1行,1个文件)
- ### 修改文件
- `healthlink-his-ui/src/views/charge/outpatientregistration/index.vue` — 第 2239 行新增 `showPopover.value = false;`
- ### 测试结果
- | 验证项 | 结果 | 详情 |
- |--------|------|------|
- | **后端编译** |  PASS | `mvn compile -pl healthlink-his-application -am -q` — exit code 0 |
- | **前端构建** |  PASS | `npm run build:dev` — exit code 0,1m57s 完成 |
- | **ESLint 检查** |  PASS | 0 errors, 6 pre-existing warnings(均非本次修改引入) |
- | **修改范围** |  合规 | 仅 1 个文件 +1 行,无后端/数据库变更 |
- | **无回归风险** |  确认 | `selsectPatient()` 仅在此处定义和调用,修改不影响其他模块 |
- | **与 Bug #764 无冲突** |  确认 | Bug #764 未修改同一文件 |
- | **无单元测试** | ℹ️ N/A | OutpatientRegistration 无已有测试用例 |
- `showPopover` 变量的完整链路:
- 1. `ref(false)` 声明 → `:visible` 绑定 → `handleFocus` 置 `true` → `handleBlur` 置 `false`
- `selsectPatient` 中选中患者后置 `false` — 修复了因 `@mousedown.prevent` 阻止 blur 导致浮窗不关闭的问题
- VERDICT: PASS
- Verify ---
2026-06-12 21:29:08 +08:00
2aa8b88b3a fix(#764): 请修复 Bug #764
根因:
- Bug #请修复 Bug #764 存在的问题

修复:
- 修改文件:`healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationLabApplyServiceImpl.java`
- 核心改动:将门诊医嘱创建阶段的检验项目定义查询从 `wor_activity_definition`(按名称)改为 `lab_activity_definition`(按 `activityId`),与阶段一(保存申请单明细)的查询方式保持一致。编译通过,可进入测试/验收流程。
- Review ---
- Now I have all the information needed for a thorough review.
- Bug #764 Fix
- ### Summary
- What the fix does**: Replaces the `wor_activity_definition` name-based lookup with `lab_activity_definition` ID-based lookup using `activityId` from the DTO, matching the pattern already used in stage one (line ~182).
- ### Dimension Scores
- 1. Design Quality (4/5)**
-  Correct root-cause fix: switches from wrong table to correct table
-  Uses ID-based lookup (more reliable than name-based)
-  Consistent with stage one's query pattern (line 182)
-  Error messages are specific and actionable (include item name and ID)
- ⚠ Minor: `activityDefinitionService` field (line 79) is now unused — Spring still injects it harmlessly, but it's dead code
- 2. Craftsmanship (4/5)**
-  Null check on `labActivityId` before query — prevents NPE
-  Null check on result — handles missing records gracefully
-  `LabActivityDefinition` entity verified: has `categoryCode`, `permittedUnitCode`, `feePackageId` — all fields accessed in the fix exist
-  `adviceTableName` correctly changed to `"lab_activity_definition"` for downstream tracking
- ⚠ Minor: unused `activityDefinitionService` field could be cleaned up in a follow-up
- 3. Functionality (5/5)**
- lab items now correctly resolve from `lab_activity_definition`
-  `adviceDefinitionId`, `definitionId`, `activityId` all set to `labActivityId` — consistent
-  `categoryCode`, `permittedUnitCode`, `feePackageId` correctly read from `LabActivityDefinition`
-  Fee package logic preserved: `feePackageId` flows through to package price lookup correctly
-  Compilation passes (verified, exit code 0)
- 4. Style Consistency (4/5)**
-  Matches stage one's pattern (`labActivityDefinitionService.getById(...)`)
-  Same error-throwing style (`throw new RuntimeException(...)`)
-  Uses Lombok `@Data` entity accessors consistent with project style
-  Comments updated to explain the change rationale
- ⚠ Comment numbering jumped from "1" to "3" (skipping "2") — the old "2. 获取诊疗定义详情" was removed but the remaining steps weren't renumbered
- ### Total: 17/20 (Functionality: 5)
- ### Minor Issues (non-blocking)
- | Issue | Severity | Recommendation |
- |-------|----------|----------------|
- | `activityDefinitionService` field now unused | Low | Remove in follow-up cleanup if no other caller exists |
- | Step numbering gap ("1" → "3") | Cosmetic | Renumber to 1, 2, 3... in a follow-up |
- | `activityId == null` throws RuntimeException | Low | Consider returning a structured error, but this matches existing project patterns |
- ### VERDICT: PASS
- Test ---
- All verification complete. Here's the summary:
- ## Bug #764 Verification Report
- ### Verification Results
- | Check | Result |
- |-------|--------|
- | `mvn compile -pl healthlink-his-application -am` |  BUILD SUCCESS (33.8s, 11 modules) |
- | `mvn test` — 8 test classes |  **126 tests, 0 failures, 0 errors, 0 skipped** |
- | InspectionApiTest (direct regression) |  11 tests, 0 failures |
- | DoctorWorkstationTest (closest module) |  20 tests, 0 failures |
- | Import/injection correctness |  `LabActivityDefinition` + `ILabActivityDefinitionService` properly imported and `@Autowired` |
- | Entity field coverage |  All 3 fields (`categoryCode`, `permittedUnitCode`, `feePackageId`) exist in entity |
- | No unrelated changes |  Only `DoctorStationLabApplyServiceImpl.java` modified |
- | No regressions |  All pre-existing warnings unchanged, zero new warnings |
- VERDICT: PASS**
- Verify ---
- ## Bug #764 验收报告
- ### 1. Git Commit 存在性 —  未提交
- 最新 commit 为 `fix(#763)` — Bug #763
- 诸葛亮分析报告 Bug #764`(仅文档,非修复)
- M ...DoctorStationLabApplyServiceImpl.java`)
- ### 2. 编译 —  通过
- `mvn clean compile -DskipTests` → **BUILD SUCCESS**(12 模块全部 SUCCESS)
- ### 3. 测试 —  通过
- 全量测试:**126 tests, 0 failures, 0 errors, 0 skipped**
- 相关模块 `InspectionApiTest`:11 tests 全通过
- 其他模块:Registration(18), Billing(7), Inpatient(19), Pharmacy(17) 全通过
- ### 4. 无回归 — 
- 全部 5 个测试套件通过,无新增失败
- ### 5. 文件变更合理性 — 
- 仅修改 **1 个文件**:`DoctorStationLabApplyServiceImpl.java`(+15 / -17 行)
- 未删除任何源文件**
- 变更内容合理:将检验申请从错误查询 `activityDefinitionService`(wor_activity_definition)切换为正确的 `labActivityDefinitionService`(lab_activity_definition)
- 所有依赖就位:`LabActivityDefinition` 实体含 `categoryCode`/`permittedUnitCode`/`feePackageId`;DTO 含 `activityId`;Service 已注入
- ### 变更质量评估
- 检验项目走独立表 `lab_activity_definition`,不再误查 `wor_activity_definition`。`adviceTableName` 也正确改为 `"lab_activity_definition"`。
- 修复代码未提交。需要执行 `git add` + `git commit -m "fix(#764): ..."` 后方可视为完成。
- FAIL [修复代码已验证正确(编译通过、126测试全通过、无回归、变更合理),但缺少 git commit,不符合铁律3"测试通过后才提交"的完成标准]
2026-06-12 21:29:08 +08:00
1a51508e78 fix(#761): 修复汇总领药列表领药时间显示异常 — 改用 cli_procedure.occurrence_time 作为执行时间数据源 2026-06-12 21:29:08 +08:00
4 changed files with 24 additions and 22 deletions

View File

@@ -251,18 +251,16 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
// 遍历检验申请单明细,为每个检验项目创建对应的门诊医嘱记录
for (DoctorStationLabApplyItemDto labApplyItemDto : doctorStationLabApplyDto.getLabApplyItemList()) {
// 1. 根据检验项目名称查询诊疗定义(检验项目
// 1. Bug #764: 使用 lab_activity_definition 表的 activityId 查询检验项目定义
// 检验项目存储在 lab_activity_definition 独立表中,不走 wor_activity_definition
String itemName = labApplyItemDto.getItemName();
Long activityDefinitionId = activityDefinitionService.getAppointActivityDefinitionId(itemName);
if (activityDefinitionId == null) {
throw new RuntimeException("未找到检验项目 '" + itemName + "' 对应的诊疗定义");
Long labActivityId = labApplyItemDto.getActivityId();
if (labActivityId == null) {
throw new RuntimeException("检验项目 '" + itemName + "' 未传入 activityId请重新选择检验项目");
}
// 2. 获取诊疗定义详情
ActivityDefinition activityDefinition = activityDefinitionService.getById(activityDefinitionId);
if (activityDefinition == null) {
throw new RuntimeException("诊疗定义不存在");
LabActivityDefinition labActivityDef = labActivityDefinitionService.getById(labActivityId);
if (labActivityDef == null) {
throw new RuntimeException("检验项目 '" + itemName + "' 对应的检验项目定义不存在ID: " + labActivityId + "");
}
// 3. 根据执行科室代码获取科室 IDpositionId
@@ -297,17 +295,17 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
// 设置检验项目相关信息
// 医嘱定义 ID诊疗定义 ID
adviceSaveDto.setAdviceDefinitionId(activityDefinitionId);
adviceSaveDto.setAdviceDefinitionId(labActivityId);
// 费用定价主表 ID对应 adm_charge_item 表的 definition_id 字段)
adviceSaveDto.setDefinitionId(activityDefinitionId);
adviceSaveDto.setDefinitionId(labActivityId);
// 医嘱名称
adviceSaveDto.setAdviceName(itemName);
// 医嘱详细分类
adviceSaveDto.setCategoryCode(activityDefinition.getCategoryCode());
adviceSaveDto.setCategoryCode(labActivityDef.getCategoryCode());
// 活动 ID诊疗定义 ID
adviceSaveDto.setActivityId(activityDefinitionId);
adviceSaveDto.setActivityId(labActivityId);
// 医嘱定义对应表名
adviceSaveDto.setAdviceTableName("wor_activity_definition");
adviceSaveDto.setAdviceTableName("lab_activity_definition");
// 执行科室 ID
adviceSaveDto.setPositionId(positionId);
@@ -346,13 +344,13 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
// 请求数量
adviceSaveDto.setQuantity(labApplyItemDto.getItemQty() != null ? labApplyItemDto.getItemQty() : java.math.BigDecimal.ONE);
// 请求单位编码(使用诊疗定义的使用单位)
adviceSaveDto.setUnitCode(activityDefinition.getPermittedUnitCode());
adviceSaveDto.setUnitCode(labActivityDef.getPermittedUnitCode());
// 单价处理BugFix#CodeReview: 根据套餐ID从正确的数据源获取价格
// 套餐项目:从 inspection_basic_information 表获取 package_amount
// 普通项目:使用前端传入的 itemPrice已从诊疗项目获取
java.math.BigDecimal unitPrice;
Long feePackageId = activityDefinition.getFeePackageId();
Long feePackageId = labActivityDef.getFeePackageId();
if (feePackageId != null) {
// 套餐项目:查询套餐价格

View File

@@ -36,7 +36,7 @@
<collection property="medicineSummaryParamList" ofType="com.healthlink.his.web.inhospitalnursestation.dto.MedicineSummaryParam">
<result property="procedureId" column="procedure_id"/>
<result property="dispenseId" column="dispense_id"/>
<result property="dispenseTime" column="planned_dispense_time"/>
<result property="dispenseTime" column="execution_time"/>
<result property="dispenseStatus" column="dispense_status"/>
</collection>
</resultMap>
@@ -75,7 +75,7 @@
ii.admitting_doctor_name,
ii.balance_amount,
ii.dispense_id,
ii.planned_dispense_time,
ii.execution_time,
ii.procedure_id,
ii.dispense_status
FROM (( SELECT T1.encounter_id,
@@ -113,7 +113,7 @@
pra."name" AS admitting_doctor_name,
personal_account.balance_amount,
mmd.id AS dispense_id,
mmd.planned_dispense_time,
cp.occurrence_time AS execution_time,
mmd.procedure_id,
mmd.status_enum AS dispense_status
FROM med_medication_request AS T1
@@ -121,6 +121,9 @@
ON T1.id = mmd.med_req_id
AND mmd.delete_flag = '0'
AND mmd.status_enum != #{summarized}
LEFT JOIN cli_procedure cp
ON cp.id = mmd.procedure_id
AND cp.delete_flag = '0'
LEFT JOIN med_medication_definition AS T2
ON T2.id = T1.medication_id
AND T2.delete_flag = '0'
@@ -200,7 +203,7 @@
AND T1.status_enum = #{completed}
AND T1.refund_medicine_id IS NULL
AND mmd.procedure_id IS NOT NULL
ORDER BY mmd.planned_dispense_time )) AS ii
ORDER BY cp.occurrence_time )) AS ii
${ew.customSqlSegment}
</select>
<select id="selectMedicineSummaryFormPage"

View File

@@ -2236,6 +2236,7 @@ function selsectPatient(row) {
form.value.firstEnum_enumText = row.firstEnum_enumText;
form.value.age = row.age;
form.value.identifierNo = row.identifierNo;
showPopover.value = false;
}
// 设置新增参数

View File

@@ -161,7 +161,7 @@
</template>
</vxe-column>
<vxe-column
title="领药时间"
title="执行时间"
field="times"
>
<template #default="scope">