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 2fd45421a..2646713e8 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 @@ -191,10 +191,15 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null); - // 手动拼接requestStatus条件:COMPLETED(3)时同时包含CHECK_VERIFIED(10)和PENDING_RECEIVE(11) + // 手动拼接requestStatus条件: + // 1. ACTIVE(2)时:同时包含已停嘱待核对的 PENDING_STOP(13) + // 2. COMPLETED(3)时:同时包含已校对检查 CHECK_VERIFIED(10) 和已接收 PENDING_RECEIVE(11) // UNION查询外层列名为request_status(T1.status_enum AS request_status),不是status_enum if (requestStatus != null) { - if (RequestStatus.COMPLETED.getValue().equals(requestStatus)) { + if (RequestStatus.ACTIVE.getValue().equals(requestStatus)) { + queryWrapper.in("request_status", + RequestStatus.ACTIVE.getValue(), RequestStatus.PENDING_STOP.getValue()); + } else if (RequestStatus.COMPLETED.getValue().equals(requestStatus)) { queryWrapper.in("request_status", RequestStatus.COMPLETED.getValue(), RequestStatus.CHECK_VERIFIED.getValue(), RequestStatus.PENDING_RECEIVE.getValue()); @@ -414,14 +419,30 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { Date checkDate = new Date(); if (!serviceRequestList.isEmpty()) { List serviceReqIds = serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(); - // 先查询服务请求,按 categoryEnum 分流:检查类(23)走 CHECK_VERIFIED,其余走 COMPLETED + // 先查询服务请求,进行状态分流: + // 1. 如果是停嘱待核对(PENDING_STOP=13),则核对后转为停止(STOPPED=6) + // 2. 否则按类别分流:检查类(23)走 CHECK_VERIFIED,其余走 COMPLETED List allServiceRequests = serviceRequestService.listByIds(serviceReqIds); + List stopReqIds = allServiceRequests.stream() + .filter(sr -> RequestStatus.PENDING_STOP.getValue().equals(sr.getStatusEnum())) + .map(ServiceRequest::getId).toList(); List checkReqIds = allServiceRequests.stream() - .filter(sr -> ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum())) + .filter(sr -> !RequestStatus.PENDING_STOP.getValue().equals(sr.getStatusEnum()) + && ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum())) .map(ServiceRequest::getId).toList(); List otherReqIds = allServiceRequests.stream() - .filter(sr -> !ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum())) + .filter(sr -> !RequestStatus.PENDING_STOP.getValue().equals(sr.getStatusEnum()) + && !ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum())) .map(ServiceRequest::getId).toList(); + + // 停嘱待核对 → 停止(STOPPED=6) + if (!stopReqIds.isEmpty()) { + serviceRequestService.update(new LambdaUpdateWrapper() + .in(ServiceRequest::getId, stopReqIds) + .set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) + .set(ServiceRequest::getPerformerCheckId, practitionerId) + .set(ServiceRequest::getCheckTime, checkDate)); + } // 检查类 → 已校对(CHECK_VERIFIED=10) if (!checkReqIds.isEmpty()) { serviceRequestService.updateCheckVerifiedStatus(checkReqIds, practitionerId, checkDate); @@ -442,14 +463,50 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { } } if (!medRequestList.isEmpty()) { - // 更新药品请求状态已完成 - medicationRequestService.updateCompletedStatusBatch( - medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate); + List medReqIds = medRequestList.stream().map(PerformInfoDto::getRequestId).toList(); + List allMedRequests = medicationRequestService.listByIds(medReqIds); + + List stopMedIds = allMedRequests.stream() + .filter(mr -> RequestStatus.PENDING_STOP.getValue().equals(mr.getStatusEnum())) + .map(MedicationRequest::getId).toList(); + List otherMedIds = allMedRequests.stream() + .filter(mr -> !RequestStatus.PENDING_STOP.getValue().equals(mr.getStatusEnum())) + .map(MedicationRequest::getId).toList(); + + // 停嘱待核对 → 停止(STOPPED=6) + if (!stopMedIds.isEmpty()) { + medicationRequestService.update(new LambdaUpdateWrapper() + .in(MedicationRequest::getId, stopMedIds) + .set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) + .set(MedicationRequest::getPerformerCheckId, practitionerId) + .set(MedicationRequest::getCheckTime, checkDate)); + } + // 其他类 → 已完成(COMPLETED=3) + if (!otherMedIds.isEmpty()) { + medicationRequestService.updateCompletedStatusBatch(otherMedIds, practitionerId, checkDate); + } } if (!deviceRequestList.isEmpty()) { - // 更新耗材请求状态已完成 - deviceRequestService.updateCompletedStatusBatch( - deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList()); + List devReqIds = deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(); + // 同样处理耗材的停嘱核对 + List allDevRequests = deviceRequestService.listByIds(devReqIds); + List stopDevIds = allDevRequests.stream() + .filter(dr -> RequestStatus.PENDING_STOP.getValue().equals(dr.getStatusEnum())) + .map(DeviceRequest::getId).toList(); + List otherDevIds = allDevRequests.stream() + .filter(dr -> !RequestStatus.PENDING_STOP.getValue().equals(dr.getStatusEnum())) + .map(DeviceRequest::getId).toList(); + + if (!stopDevIds.isEmpty()) { + deviceRequestService.update(new LambdaUpdateWrapper() + .in(DeviceRequest::getId, stopDevIds) + .set(DeviceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()) + .set(DeviceRequest::getPerformerCheckId, practitionerId) + .set(DeviceRequest::getCheckTime, checkDate)); + } + if (!otherDevIds.isEmpty()) { + deviceRequestService.updateCompletedStatusBatch(otherDevIds); + } } return R.ok(null, "校对成功"); } diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue b/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue index 95d051fc6..2d88b70a5 100755 --- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue +++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue @@ -259,9 +259,11 @@ {{ scope.row.adviceName }} - + @@ -612,8 +613,9 @@ const adviceTypeList = computed(() => { hasShownPharmacyConfigWarning.value = true; } - // 只返回不需要取药科室配置的类别(诊疗、手术、出院带药) + // 只返回不需要取药科室配置的类别(诊疗、耗材、手术、出院带药) return [ + { label: '耗材', value: 2, adviceType: 2, categoryCode: '' }, { label: '诊疗', value: 3, adviceType: 3, categoryCode: '' }, { label: '手术', value: 6, adviceType: 6, categoryCode: '' }, { label: '出院带药', value: 7, adviceType: 7, categoryCode: '' }, @@ -641,7 +643,8 @@ const adviceTypeList = computed(() => { typeList.push({ label: '中草药', value: '1-4', adviceType: 1, categoryCode: '4' }); } - // 始终添加诊疗和手术(它们不受取药配置限制) + // 始终添加诊疗、耗材和手术(它们不受取药配置限制) + typeList.push({ label: '耗材', value: 2, adviceType: 2, categoryCode: '' }); typeList.push({ label: '诊疗', value: 3, adviceType: 3, categoryCode: '' }); typeList.push({ label: '手术', value: 6, adviceType: 6, categoryCode: '' }); @@ -666,6 +669,10 @@ const statusOption = [ label: '已签发', value: 2, }, + { + label: '已停嘱', + value: 13, + }, { label: '停止', value: 6, @@ -963,6 +970,8 @@ function handleAddPrescription() { statusEnum: 1, therapyEnum: '2', // 默认为临时医嘱 startTime: defaultStartTime, + requesterId_dictText: userStore.nickName, + requesterId: userStore.id, }); getGroupMarkers(); nextTick(() => { @@ -1221,6 +1230,8 @@ function selectAdviceBase(key, row) { // Bug #589: 出院带药需要保留类型和标志,setValue中可能被API数据覆盖 adviceType: prevRow.adviceType || undefined, dischargeFlag: prevRow.dischargeFlag || undefined, + requesterId_dictText: userStore.nickName, + requesterId: userStore.id, }; try { setValue(row); @@ -1714,6 +1725,8 @@ function handleSaveSign(row, index) { } // 更新UI状态 + row.requesterId_dictText = userStore.nickName; + row.requesterId = userStore.id; row.isEdit = false; isAdding.value = false; collapseAllExpanded(); @@ -2075,6 +2088,8 @@ function handleSaveGroup(orderGroupList) { // 创建新的处方项目 const newRow = { ...prescriptionList.value[tempIndex], + requesterId_dictText: userStore.nickName, + requesterId: userStore.id, patientId: patientInfo.value.patientId, encounterId: patientInfo.value.encounterId, accountId: accountId.value, @@ -2134,6 +2149,8 @@ function handleSaveGroup(orderGroupList) { function handleSaveHistory(value) { let saveRow = { ...value, + requesterId_dictText: userStore.nickName, + requesterId: userStore.id, patientId: patientInfo.value.patientId, encounterId: patientInfo.value.encounterId, accountId: accountId.value, @@ -2300,7 +2317,7 @@ function handleStopAdvice() { // 找出停嘱的 for (let index = 0; index < selectRows.length; index++) { const item = selectRows[index]; - if (item.statusEnum == 6) { + if (item.statusEnum == 6 || item.statusEnum == 13) { isStop = false; break; } diff --git a/healthlink-his-ui/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue b/healthlink-his-ui/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue index 27cec9c2d..1ecf87660 100755 --- a/healthlink-his-ui/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue +++ b/healthlink-his-ui/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue @@ -202,7 +202,7 @@