585 [住院医生工作站-手术申请] 手术申请历史列表缺失“手术状态”列,导致医生无法跟踪手术流转进度
This commit is contained in:
@@ -482,6 +482,13 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
if (!checkReqIds.isEmpty()) {
|
||||
serviceRequestService.updatePendingReceiveStatus(checkReqIds);
|
||||
}
|
||||
// 手术类医嘱执行后,状态改为"已执行"(SurgeryAppStatusEnum.EXECUTED=4)
|
||||
List<Long> surgeryReqIds = executedReqs.stream()
|
||||
.filter(sr -> ActivityDefCategory.PROCEDURE.getValue().equals(sr.getCategoryEnum()))
|
||||
.map(ServiceRequest::getId).toList();
|
||||
if (!surgeryReqIds.isEmpty()) {
|
||||
serviceRequestService.updateSurgeryAppStatus(surgeryReqIds, SurgeryAppStatusEnum.EXECUTED.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱执行"}));
|
||||
@@ -726,6 +733,24 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
deviceDispenseService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getId).toList());
|
||||
deviceRequestService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getDeviceReqId).toList());
|
||||
}
|
||||
// 手术类医嘱取消执行后,状态回退为"已校对"(SurgeryAppStatusEnum.VERIFIED=3)
|
||||
List<Long> surgeryCancelReqIds = adviceExecuteParam.getAdviceExecuteDetailList().stream()
|
||||
.filter(e -> CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(e.getAdviceTable()))
|
||||
.map(AdviceExecuteDetailParam::getRequestId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.toList();
|
||||
if (!surgeryCancelReqIds.isEmpty()) {
|
||||
List<ServiceRequest> surgeryRequests = serviceRequestService.list(
|
||||
new LambdaQueryWrapper<ServiceRequest>()
|
||||
.in(ServiceRequest::getId, surgeryCancelReqIds)
|
||||
.eq(ServiceRequest::getCategoryEnum, ActivityDefCategory.PROCEDURE.getValue()));
|
||||
if (!surgeryRequests.isEmpty()) {
|
||||
serviceRequestService.updateSurgeryAppStatus(
|
||||
surgeryRequests.stream().map(ServiceRequest::getId).toList(),
|
||||
SurgeryAppStatusEnum.VERIFIED.getCode());
|
||||
}
|
||||
}
|
||||
return R.ok("取消执行成功,相关汇总领药单已重新生成");
|
||||
}
|
||||
|
||||
|
||||
@@ -192,9 +192,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 药品
|
||||
List<RegAdviceSaveDto> medicineList = regAdviceSaveList.stream()
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 诊疗活动(包含护理adviceType=26)
|
||||
// 诊疗活动(包含护理adviceType=26、手术adviceType=6)
|
||||
List<RegAdviceSaveDto> activityList = regAdviceSaveList.stream()
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|
||||
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|
||||
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
|
||||
.collect(Collectors.toList());
|
||||
// 耗材 🔧 Bug #147 修复
|
||||
|
||||
@@ -30,6 +30,44 @@
|
||||
drf.create_time,
|
||||
ap.NAME AS patient_name,
|
||||
CASE
|
||||
-- ========== 手术专用映射 (categoryEnum=24) ==========
|
||||
-- 手术申请单状态枚举: 1=待签发 2=已签发 3=已校对 4=已执行 5=已安排 6=已完成 10=已作废
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 10
|
||||
) THEN 10
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 6
|
||||
) THEN 6
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 5
|
||||
) THEN 5
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 4
|
||||
) THEN 4
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 3
|
||||
) THEN 3
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 2
|
||||
) THEN 2
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 1
|
||||
) THEN 1
|
||||
-- ========== 通用映射 (非手术类型: 检查/检验/药品/输血) ==========
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 手术申请单状态枚举
|
||||
* <p>
|
||||
* 区别于 {@link SurgeryStatusEnum}(手术管理状态:待排期/已排期/手术中/已完成/已取消/暂停),
|
||||
* 本枚举用于手术申请单的业务流转状态,覆盖从医生开立到手术完成的完整生命周期。
|
||||
*
|
||||
* <pre>
|
||||
* 正向流转:
|
||||
* 待签发(1) → 已签发(2) → 已校对(3) → 已执行(4) → 已安排(5) → 已完成(6)
|
||||
*
|
||||
* 逆向流转:
|
||||
* 已签发(2) → 待签发(1) (医生撤回 / 护士退回)
|
||||
* 已执行(4) → 已校对(3) (护士取消执行)
|
||||
* 任意状态 → 已作废(10) (医生撤销)
|
||||
* </pre>
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-06-02
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SurgeryAppStatusEnum {
|
||||
|
||||
/** 待签发 — 医生已保存但尚未提交,仅在医生站可见 */
|
||||
PENDING_SIGN(1, "待签发"),
|
||||
|
||||
/** 已签发 — 医生已提交,自动流转至护士工作站待校对 */
|
||||
SIGNED(2, "已签发"),
|
||||
|
||||
/** 已校对 — 病区护士已校对手术医嘱 */
|
||||
VERIFIED(3, "已校对"),
|
||||
|
||||
/** 已执行 — 病区护士已执行手术医嘱,已向手麻科提交申请 */
|
||||
EXECUTED(4, "已执行"),
|
||||
|
||||
/** 已安排 — 手麻科已排好手术间及时间,待手术 */
|
||||
SCHEDULED(5, "已安排"),
|
||||
|
||||
/** 已完成 — 手术已结束并录入完毕(终态只读) */
|
||||
COMPLETED(6, "已完成"),
|
||||
|
||||
/** 已作废 — 医生中途撤销了手术申请(终态) */
|
||||
CANCELLED(10, "已作废");
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
/**
|
||||
* 根据状态码获取枚举
|
||||
*
|
||||
* @param code 状态码
|
||||
* @return 对应的枚举,未匹配返回 null
|
||||
*/
|
||||
public static SurgeryAppStatusEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (SurgeryAppStatusEnum val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为终态(不可再变更)
|
||||
*/
|
||||
public boolean isFinal() {
|
||||
return this == COMPLETED || this == CANCELLED;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否允许医生编辑
|
||||
*/
|
||||
public boolean isEditable() {
|
||||
return this == PENDING_SIGN;
|
||||
}
|
||||
}
|
||||
@@ -149,4 +149,12 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
* @return 请求信息列表
|
||||
*/
|
||||
List<ServiceRequest> getServiceRequestListByEncounterId(Long encounterId);
|
||||
|
||||
/**
|
||||
* 更新手术申请单状态(批量)
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum)
|
||||
*/
|
||||
void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode);
|
||||
}
|
||||
|
||||
@@ -278,4 +278,19 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getEncounterId, encounterId).eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新手术申请单状态(批量)
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum: 1=待签发,2=已签发,3=已校对,4=已执行,5=已安排,6=已完成,10=已作废)
|
||||
*/
|
||||
@Override
|
||||
public void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.set(ServiceRequest::getStatusEnum, statusCode)
|
||||
.in(ServiceRequest::getId, serReqIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ getList();
|
||||
}
|
||||
|
||||
/* 表格样式调整,移除默认的最大宽度限制 */
|
||||
.table-scroll-container { :deep(.el-table) {
|
||||
.table-scroll-container :deep(.el-table) {
|
||||
min-width: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@@ -48,31 +48,31 @@
|
||||
/>
|
||||
<el-option
|
||||
label="待签发"
|
||||
value="0"
|
||||
/>
|
||||
<el-option
|
||||
label="已签发"
|
||||
value="1"
|
||||
/>
|
||||
<el-option
|
||||
label="已校对"
|
||||
label="已签发"
|
||||
value="2"
|
||||
/>
|
||||
<el-option
|
||||
label="已执行"
|
||||
label="已校对"
|
||||
value="3"
|
||||
/>
|
||||
<el-option
|
||||
label="已安排"
|
||||
label="已执行"
|
||||
value="4"
|
||||
/>
|
||||
<el-option
|
||||
label="已完成"
|
||||
label="已安排"
|
||||
value="5"
|
||||
/>
|
||||
<el-option
|
||||
label="已完成"
|
||||
value="6"
|
||||
/>
|
||||
<el-option
|
||||
label="已作废"
|
||||
value="7"
|
||||
value="10"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -118,7 +118,7 @@
|
||||
/>
|
||||
<el-table-column
|
||||
label="手术单号"
|
||||
width="160"
|
||||
min-width="160"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
@@ -133,25 +133,40 @@
|
||||
<el-table-column
|
||||
prop="patientName"
|
||||
label="患者姓名"
|
||||
width="120"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="申请单名称"
|
||||
width="140"
|
||||
min-width="140"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
width="160"
|
||||
min-width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="requesterId_dictText"
|
||||
label="申请者"
|
||||
width="120"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getStatusType(scope.row.status)"
|
||||
size="small"
|
||||
>
|
||||
{{ getStatusText(scope.row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="100"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
@@ -397,6 +412,25 @@ const handleRefresh = async () => {
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
/** 手术申请单状态映射 (与后端 SurgeryAppStatusEnum 对齐) */
|
||||
const statusMap = {
|
||||
1: { text: '待签发', type: 'info' },
|
||||
2: { text: '已签发', type: 'primary' },
|
||||
3: { text: '已校对', type: 'success' },
|
||||
4: { text: '已执行', type: 'warning' },
|
||||
5: { text: '已安排', type: 'warning' },
|
||||
6: { text: '已完成', type: 'success' },
|
||||
10: { text: '已作废', type: 'danger' },
|
||||
};
|
||||
|
||||
const getStatusText = (status) => {
|
||||
return statusMap[status]?.text || '未知';
|
||||
};
|
||||
|
||||
const getStatusType = (status) => {
|
||||
return statusMap[status]?.type || 'info';
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
|
||||
Reference in New Issue
Block a user