diff --git a/MD/MODULE_INDEX.md b/MD/MODULE_INDEX.md index 61088ae03..cbdf979ff 100644 --- a/MD/MODULE_INDEX.md +++ b/MD/MODULE_INDEX.md @@ -1,7 +1,7 @@ # HealthLink-HIS 代码模块索引 > 供 LLM 快速定位代码。每个模块列出 Controller → Service → Mapper 关键文件。 -> 最后更新: 2026-06-18 12:00 (309 个 Controller) +> 最后更新: 2026-06-18 18:00 (334 个 Controller) ## 关键词 → 模块速查 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationLabApplyServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationLabApplyServiceImpl.java index a03c9b2ae..d272550ad 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationLabApplyServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationLabApplyServiceImpl.java @@ -152,6 +152,9 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio InspectionLabApply inspectionLabApply = new InspectionLabApply(); //将 dto 数据复制到 InspectionLabApply 对象中 BeanUtils.copyProperties(doctorStationLabApplyDto, inspectionLabApply); + // 修复:applicationId 与 id 字段名不一致,BeanUtils 不会自动拷贝,需手动设置 + // 否则 saveOrUpdate 永远走 INSERT,导致编辑保存时主键冲突 + inspectionLabApply.setId(doctorStationLabApplyDto.getApplicationId()); //设置租户 ID inspectionLabApply.setTenantId(SecurityUtils.getLoginUser().getTenantId()); //获取当前登陆用户名称 @@ -337,8 +340,11 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio } adviceSaveDto.setAccountId(accountId); - // 将申请单号作为业务关联标识(请求内容 json) - adviceSaveDto.setContentJson("{\"applyNo\":\"" + doctorStationLabApplyDto.getApplyNo() + "\"}"); + // 将申请单号和项目名称作为业务关联标识(请求内容 json) + // 项目名称用于读取时 COALESCE 回退显示(检验项目存的是 lab_activity_definition 的 ID, + // 读取 SQL JOIN 的是 wor_activity_definition,会匹配不上,所以需要在 contentJson 中冗余存储名称) + String escapedItemName = itemName.replace("\"", "\\\""); + adviceSaveDto.setContentJson("{\"applyNo\":\"" + doctorStationLabApplyDto.getApplyNo() + "\",\"adviceName\":\"" + escapedItemName + "\"}"); // 设置其他必要字段 // 请求数量 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java index 43a75a658..dbcc2fd68 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java @@ -40,7 +40,9 @@ import com.healthlink.his.web.document.dto.DocStatisticsDto; import com.healthlink.his.web.inhospitalnursestation.appservice.IATDManageAppService; import com.healthlink.his.web.inhospitalnursestation.dto.*; import com.healthlink.his.web.inhospitalnursestation.mapper.ATDManageAppMapper; +import com.healthlink.his.workflow.domain.DeviceRequest; import com.healthlink.his.workflow.domain.ServiceRequest; +import com.healthlink.his.workflow.service.IDeviceRequestService; import com.healthlink.his.workflow.service.IServiceRequestService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -98,6 +100,9 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { @Resource private IServiceRequestService serviceRequestService; + @Resource + private IDeviceRequestService deviceRequestService; + @Resource private IPractitionerService practitionerService; @@ -402,7 +407,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(), EncounterClass.IMP.getValue(), GenerateSource.DOCTOR_PRESCRIPTION.getValue(), ActivityDefCategory.TRANSFER.getCode(), - ActivityDefCategory.DISCHARGE.getCode(), ActivityDefCategory.NURSING.getCode()); + ActivityDefCategory.DISCHARGE.getCode(), ActivityDefCategory.NURSING.getCode(), + RequestStatus.DISPENSE_COMPLETED.getValue()); inpatientAdvicePage.getRecords().forEach(e -> { // 是否皮试 e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag())); @@ -622,20 +628,10 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { if (encounterId == null) { return R.fail("转科失败,请选择有效的患者"); } - // 获取是否还有待执行医嘱 - List medicationRequestList = medicationRequestService - .list(new LambdaQueryWrapper().eq(MedicationRequest::getEncounterId, encounterId) - .ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) - .eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode())); - List serviceRequestList = serviceRequestService - .list(new LambdaQueryWrapper().eq(ServiceRequest::getEncounterId, encounterId) - .ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue()) - .eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); - if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) { - return R.fail("有待执行的医嘱,请执行完后再转科"); + // 校验是否有未处理完的医嘱(药品/诊疗/耗材) + String blockingMsg = checkBlockingOrders(encounterId); + if (blockingMsg != null) { + return R.fail(blockingMsg); } // 查询患者待取的药品 List medicationDispenseList = medicationDispenseService @@ -686,25 +682,15 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public R hospitalDischarge(Long encounterId) { if (encounterId == null) { return R.fail("出院失败,请选择有效的患者"); } - // 获取是否还有待执行医嘱 - List medicationRequestList = medicationRequestService - .list(new LambdaQueryWrapper().eq(MedicationRequest::getEncounterId, encounterId) - .ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) - .eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode())); - List serviceRequestList = serviceRequestService - .list(new LambdaQueryWrapper().eq(ServiceRequest::getEncounterId, encounterId) - .ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue()) - .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue()) - .eq(ServiceRequest::getParentId, null) - .eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); - if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) { - return R.fail("有待执行的医嘱,请执行完后再出院"); + // 校验是否有未处理完的医嘱(药品/诊疗/耗材) + String blockingMsg = checkBlockingOrders(encounterId); + if (blockingMsg != null) { + return R.fail(blockingMsg); } // 查询患者待取的药品 List medicationDispenseList = medicationDispenseService @@ -737,6 +723,15 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { || EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) { return R.fail("请等待出院结算完成后再清床"); } + // 待转科患者应使用转科功能,不允许直接清床 + if (EncounterZyStatus.PENDING_TRANSFER.getValue().equals(encounter.getStatusEnum())) { + return R.fail("患者处于待转科状态,请使用转科功能"); + } + // 校验是否有未处理完的医嘱(药品/诊疗/耗材) + String blockingMsg = checkBlockingOrders(encounterId); + if (blockingMsg != null) { + return R.fail(blockingMsg); + } // 更新患者位置状态:已完成 encounterLocationService.updateEncounterLocationStatus(encounterId, true); // 更新患者相关医生状态:已完成 @@ -751,6 +746,73 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { return R.ok("清床完成"); } + /** + * 检查患者是否有未处理完的医嘱(药品/诊疗/耗材),用于转科/出院/清床前的统一校验。 + *

+ * 使用正向白名单方式,仅查询处于"阻塞状态"的医嘱: + * - DRAFT(1) 待发送 —— 医生已开嘱尚未提交 + * - ACTIVE(2) 已发送 —— 待护士校对 + * - COMPLETED(3) 已校对 —— 护士校对通过但尚未执行完 + * - CHECK_VERIFIED(10) 检查已校对 —— 检查类医嘱校对通过,待执行 + * - PENDING_STOP(13) 停嘱待核对 —— 医生已停嘱,待护士核对 + *

+ * 以下状态不会阻塞(已走完流程或已取消): + * - STOPPED(6) 停嘱 + * - CANCELLED(5) 取消/待退 + * - PENDING_RECEIVE(11) 待接收 —— 检查已送检 + * - CHECK_RECEIVED(12) 已接收 —— 医技已接单 + * - DISPENSE_COMPLETED(20) 发药完成 + * + * @param encounterId 住院患者id + * @return 错误提示消息,null 表示无阻塞 + */ + private String checkBlockingOrders(Long encounterId) { + // 阻塞状态白名单:仅这些状态的医嘱会阻止转科/出院/清床 + List blockingStatuses = List.of( + RequestStatus.DRAFT.getValue(), + RequestStatus.ACTIVE.getValue(), + RequestStatus.COMPLETED.getValue(), + RequestStatus.CHECK_VERIFIED.getValue(), + RequestStatus.PENDING_STOP.getValue() + ); + + // 1. 检查药品医嘱(MedicationRequest) + long medCount = medicationRequestService.count( + new LambdaQueryWrapper() + .eq(MedicationRequest::getEncounterId, encounterId) + .in(MedicationRequest::getStatusEnum, blockingStatuses) + .eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode())); + if (medCount > 0) { + return "有未处理完的医嘱,请先处理完再操作"; + } + + // 2. 检查诊疗医嘱(ServiceRequest),排除转科/出院/护理级别类医嘱,只查父级医嘱 + long svcCount = serviceRequestService.count( + new LambdaQueryWrapper() + .eq(ServiceRequest::getEncounterId, encounterId) + .in(ServiceRequest::getStatusEnum, blockingStatuses) + .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue()) + .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue()) + .ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue()) + .eq(ServiceRequest::getParentId, null) + .eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode())); + if (svcCount > 0) { + return "有未处理完的医嘱,请先处理完再操作"; + } + + // 3. 检查耗材医嘱(DeviceRequest) + long devCount = deviceRequestService.count( + new LambdaQueryWrapper() + .eq(DeviceRequest::getEncounterId, encounterId) + .in(DeviceRequest::getStatusEnum, blockingStatuses) + .eq(DeviceRequest::getDeleteFlag, DelFlag.NO.getCode())); + if (devCount > 0) { + return "有未处理完的医嘱,请先处理完再操作"; + } + + return null; + } + /** * 诊断个人账户金额信息获取 * diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 745c25eb4..9e562c357 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -461,15 +461,17 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { } // 处理转科/出院等特殊医嘱 for (ServiceRequest serviceRequest : allServiceRequests) { - // Bug #718: 延迟状态变更时机。核对通过时不立即变更患者就诊状态, - // 而是等到护士在【入出转管理】中手动点击“转科”或“清床”时再处理。 - // 这样可以确保护士在真正转出前,依然能在在科列表中选中患者并处理遗留医嘱。 + // 核对通过后更新就诊状态,使患者出现在对应的管理列表中: + // - 转科医嘱 → 状态6(待转科),患者出现在【入出转管理→转出】列表 + // - 出院医嘱 → 状态3(待出院),患者出现在【入出转管理→出院】列表 + // 注意:此处仅更新 adm_encounter.status_enum,不释放床位。 + // 床位释放发生在护士手动点击”转科”/”出院”时的 transferDepartment()/hospitalDischarge() 中。 if (ActivityDefCategory.TRANSFER.getValue().equals(serviceRequest.getCategoryEnum())) { - // encounterService.updateEncounterStatus(serviceRequest.getEncounterId(), - // EncounterZyStatus.PENDING_TRANSFER.getValue()); + encounterService.updateEncounterStatus(serviceRequest.getEncounterId(), + EncounterZyStatus.PENDING_TRANSFER.getValue()); } else if (ActivityDefCategory.DISCHARGE.getValue().equals(serviceRequest.getCategoryEnum())) { - // encounterService.updateEncounterStatus(serviceRequest.getEncounterId(), - // EncounterZyStatus.AWAITING_DISCHARGE.getValue()); + encounterService.updateEncounterStatus(serviceRequest.getEncounterId(), + EncounterZyStatus.AWAITING_DISCHARGE.getValue()); } } } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java index 0c51cf5fb..069ddfe7f 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/MedicineSummaryAppServiceImpl.java @@ -153,10 +153,11 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService // 就诊ID集合 String encounterIds = dispenseFormSearchParam.getEncounterIds(); dispenseFormSearchParam.setEncounterIds(null); - // 汇总单查询不适用的字段清空(汇总单表无 tcm_flag 等列,避免 SQL 报错) + // 汇总单查询不适用的字段清空(汇总单表无 tcm_flag、summary_status 等列,避免 SQL 报错) dispenseFormSearchParam.setTcmFlag(null); dispenseFormSearchParam.setTherapyEnum(null); dispenseFormSearchParam.setExeTime(null); + dispenseFormSearchParam.setSummaryStatus(null); // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam, @@ -171,7 +172,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService // 汇总单分页列表 Page medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage( - new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(), + new Page<>(pageNo, pageSize), queryWrapper, SupplyType.SUMMARY_DISPENSE.getValue()); medicineSummaryFormPage.getRecords().forEach(e -> { // 发药状态(汇总单展示文案) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/ATDManageAppMapper.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/ATDManageAppMapper.java index 3c285acc8..c79c9e9b1 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/ATDManageAppMapper.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/ATDManageAppMapper.java @@ -144,7 +144,8 @@ public interface ATDManageAppMapper { @Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount, @Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded, @Param("imp") Integer imp, @Param("doctorPrescription") Integer doctorPrescription, - @Param("transfer") String transfer, @Param("discharge") String discharge, @Param("nursing") String nursing); + @Param("transfer") String transfer, @Param("discharge") String discharge, @Param("nursing") String nursing, + @Param("dispenseCompleted") Integer dispenseCompleted); /** * 查询执行记录 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/MedicineSummaryAppMapper.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/MedicineSummaryAppMapper.java index 4ea00c58c..9a27e586e 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/MedicineSummaryAppMapper.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/mapper/MedicineSummaryAppMapper.java @@ -46,13 +46,11 @@ public interface MedicineSummaryAppMapper { * * @param page 分页信息 * @param queryWrapper 查询条件 - * @param preparation 发药状态:待配药 * @param summaryDispense 单据类型:汇总发药 * @return 汇总单列表 */ Page selectMedicineSummaryFormPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, - @Param("preparation") Integer preparation, @Param("summaryDispense") Integer summaryDispense); /** diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java index ff31e4d51..c4514a907 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java @@ -19,6 +19,7 @@ import tools.jackson.databind.JsonNode; import tools.jackson.databind.node.ArrayNode; import tools.jackson.databind.node.ObjectNode; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; @@ -351,6 +352,30 @@ public class InHospitalReturnMedicineAppServiceImpl implements IInHospitalReturn } // 退药更新 medicationDispenseService.updateBatchById(refundMedList); + + // 退药完成后,检查医嘱关联的发药记录是否全部退完,如果是则回写医嘱状态为已停止 + // 解决:医嘱取消(status=5)后退药完成,医嘱状态未变更,导致护士站"待处理执行单"仍显示已退完的医嘱 + Set distinctMedReqIds = refundMedList.stream() + .map(MedicationDispense::getMedReqId).collect(Collectors.toSet()); + for (Long medReqId : distinctMedReqIds) { + // 查询该医嘱下所有发药记录 + List allDispenses = medicationDispenseService.list( + new LambdaQueryWrapper() + .eq(MedicationDispense::getMedReqId, medReqId) + .eq(MedicationDispense::getDeleteFlag, "0")); + // 判断是否全部已退药 + boolean allRefunded = allDispenses.stream() + .allMatch(d -> DispenseStatus.REFUNDED.getValue().equals(d.getStatusEnum())); + if (allRefunded) { + // 回写医嘱状态:取消/待退(5) → 已停止(6) + // STOPPED(6)会被护士站查询排除,不再出现在"待处理执行单"中 + medicationRequestService.update( + new LambdaUpdateWrapper() + .eq(MedicationRequest::getId, medReqId) + .eq(MedicationRequest::getStatusEnum, RequestStatus.CANCELLED.getValue()) + .set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())); + } + } } // 处理退耗材 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/BusinessAnalyticsController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/BusinessAnalyticsController.java index fd9e4a209..95558720e 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/BusinessAnalyticsController.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/BusinessAnalyticsController.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*; import java.util.Map; -@RestController +@RestController("reportBusinessAnalyticsController") @RequestMapping("/report/analytics") @Slf4j @AllArgsConstructor diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/DrgAnalysisController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/DrgAnalysisController.java index d84bf8f2c..e8d64b9a2 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/DrgAnalysisController.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/reportmanage/controller/DrgAnalysisController.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*; import java.util.Map; -@RestController +@RestController("reportDrgAnalysisController") @RequestMapping("/report/drg") @Slf4j @AllArgsConstructor diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/ATDManageAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/ATDManageAppMapper.xml index c553a6032..3e25e5add 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/ATDManageAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/inhospitalnursestation/ATDManageAppMapper.xml @@ -601,6 +601,7 @@ WHERE T1.delete_flag = '0' AND T1.refund_medicine_id IS NULL AND T1.status_enum != #{stopped} + AND T1.status_enum != #{dispenseCompleted} AND T1.generate_source_enum = #{doctorPrescription} AND CASE WHEN T1.status_enum = #{draft} @@ -737,6 +738,7 @@ AND af.delete_flag = '0' WHERE T1.delete_flag = '0' AND T1.status_enum != #{stopped} + AND T1.status_enum != #{dispenseCompleted} AND T1.generate_source_enum = #{doctorPrescription} AND T2.category_code != #{transfer} AND T2.category_code != #{discharge} diff --git a/healthlink-his-ui/src/api/emr.js b/healthlink-his-ui/src/api/emr.js index 2451ecd26..42be812b5 100644 --- a/healthlink-his-ui/src/api/emr.js +++ b/healthlink-his-ui/src/api/emr.js @@ -20,7 +20,7 @@ export function getCompletenessResults(emrId) { return request({ url: "/emr/comp export function checkTimeliness(encounterId) { return request({ url: "/emr/timeliness/check", method: "post", params: { encounterId } }) } export function getTimelinessAlerts(params) { return request({ url: "/emr/timeliness/alerts", method: "get", params }) } -export function extractStructuredData(emrId) { return request({ url: "/emr/structured-data/extract/" + emrId, method: "post" }) } -export function getStructuredData(encounterId) { return request({ url: "/emr/structured-data/" + encounterId, method: "get" }) } -export function calculateQualityScore(encounterId) { return request({ url: "/emr/quality-score/calculate/" + encounterId, method: "post" }) } -export function getQualityScores(encounterId) { return request({ url: "/emr/quality-score/" + encounterId, method: "get" }) } +export function extractStructuredData(emrId) { return request({ url: "/emr/warehouse/extract", method: "post", params: { emrId } }) } +export function getStructuredData(encounterId) { return request({ url: "/emr/warehouse/data/" + encounterId, method: "get" }) } +export function calculateQualityScore(encounterId) { return request({ url: "/emr/warehouse/quality-score", method: "post", params: { encounterId } }) } +export function getQualityScores(encounterId) { return request({ url: "/emr/warehouse/quality-scores", method: "get", params: { encounterId } }) } diff --git a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue index bddfe373c..0251d4517 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue @@ -81,7 +81,6 @@ class="inspection-table" :row-config="{ keyField: 'applicationId', keyField: 'itemId' }" @checkbox-change="handleSelectionChange" - @current-change="handleRowClick" @cell-click="handleCellClick" > { let hasErrors = false // 修复【#406】:保存前尝试从 props 同步患者信息,避免因加载时序导致信息缺失 - if ((!formData.patientName?.trim() || !formData.medicalrecordNumber?.trim()) && props.patientInfo && props.patientInfo.encounterId) { - formData.patientName = props.patientInfo.patientName || '' - formData.medicalrecordNumber = props.patientInfo.identifierNo || '' - formData.encounterId = props.patientInfo.encounterId || '' - formData.visitNo = props.patientInfo.busNo || '' - formData.patientId = props.patientInfo.patientId || '' - formData.applyDepartment = props.patientInfo.organizationName || '' - formData.applyDeptCode = props.patientInfo.organizationName || '' - formData.applyOrganizationId = props.patientInfo.orgId || '' + if (props.patientInfo && props.patientInfo.encounterId) { + // encounterId 来自 adm_encounter 表,lab_apply 表无此字段,需始终从 props 同步 + if (!formData.encounterId) { + formData.encounterId = props.patientInfo.encounterId || '' + } + if (!formData.patientName?.trim()) { + formData.patientName = props.patientInfo.patientName || '' + } + if (!formData.medicalrecordNumber?.trim()) { + formData.medicalrecordNumber = props.patientInfo.identifierNo || '' + } + if (!formData.visitNo) { + formData.visitNo = props.patientInfo.busNo || '' + } + if (!formData.patientId) { + formData.patientId = props.patientInfo.patientId || '' + } + if (!formData.applyDepartment) { + formData.applyDepartment = props.patientInfo.organizationName || '' + } + if (!formData.applyDeptCode) { + formData.applyDeptCode = props.patientInfo.organizationName || '' + } + if (!formData.applyOrganizationId) { + formData.applyOrganizationId = props.patientInfo.orgId || '' + } } // P0:检查患者信息是否已加载 @@ -2457,10 +2473,13 @@ const handleDelete = (row) => { } // 单元格点击 - 点击表格行时加载申请单详情 -const handleCellClick = (row, column) => { +const handleCellClick = (params) => { + // vxe-table cell-click 事件参数是 { row, column, $event, ... } 对象,需安全提取行数据 + const row = params.row || params; + const column = params.column || params; // 如果点击的是操作列或展开列,不触发数据填充 - if (column.property === '操作' || column.label === '操作' || - column.type === 'expand' || column.type === 'selection') { + if (column.type === 'expand' || column.type === 'selection' || + column.title === '操作' || column.property === '操作') { return; } // 点击表格行时,将该申请单的数据加载到表单中 @@ -2470,15 +2489,6 @@ const handleCellClick = (row, column) => { } } -// 行点击事件处理 -const handleRowClick = (currentRow, oldRow) => { - // 点击表格行时,将该申请单的数据加载到表单中 - // 使用 applyNo 判断是否有效,同时检查是否处于删除状态 - if (currentRow && currentRow.applyNo && !isDeleting.value) { - loadApplicationToForm(currentRow); - } -} - // 提取公共方法加载申请单到表单 const loadApplicationToForm = async (row) => { // 停止申请日期实时更新(加载已保存的申请单) diff --git a/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue b/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue index 04590c8d4..f4f618ae2 100755 --- a/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue +++ b/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue @@ -332,7 +332,9 @@ function resetQuery() { getSummaryList(); } -function getDetails(row) { +function getDetails(params) { + // cell-click 事件参数是 { row, column, $event, ... } 对象,需安全提取行数据 + const row = params.row || params; loading.value = true; getFromSummaryDetails({ summaryNo: row.busNo }).then((res) => { summaryDetailsData.value = res.data;